CALCULATING MARKET PATTERNS...