Skip to main content

Pattern Recognition

Pattern recognition indicators automatically detect recurring price structures such as peaks, troughs, and divergences. They are real-time but require a confirmation delay of several bars to validate each pattern. Use them for systematic scanning of setups that would be time-consuming to spot manually.

Indicators at a glance

IndicatorTypeWarmupLagWhen to use
Detect Peaks🟢 Real-time2 × number_of_neighbors_to_compare + 1 barsnumber_of_neighbors_to_compare barsIdentifies local highs (Higher Highs / Lower Highs) and lows (Higher Lows / Lower Lows) in price data. Use it as a building block for trend analysis, divergence detection, and swing structure mapping.
Detect Bullish Divergence🟢 Real-time2 × number_of_neighbors_to_compare + 1 barsnumber_of_neighbors_to_compare bars after the peakDetects when price makes lower lows but an oscillator (e.g. RSI) makes higher lows — a classic reversal signal. Use it to spot potential bottoms in a downtrend.
Detect Bearish Divergence🟢 Real-time2 × number_of_neighbors_to_compare + 1 barsnumber_of_neighbors_to_compare bars after the peakDetects when price makes higher highs but an oscillator makes lower highs. Use it to spot potential tops in an uptrend.

Detailed descriptions

Detect Peaks

🟢 Real-time — ≈ number_of_neighbors_to_compare bars

Warmup: 2 × number_of_neighbors_to_compare + 1 bars (default: 11 bars (number_of_neighbors_to_compare=5))

Identifies local highs (Higher Highs / Lower Highs) and lows (Higher Lows / Lower Lows) in price data. Use it as a building block for trend analysis, divergence detection, and swing structure mapping.

Detect Bullish Divergence

🟢 Real-time — ≈ number_of_neighbors_to_compare bars after the peak

Warmup: 2 × number_of_neighbors_to_compare + 1 bars (default: 11 bars (number_of_neighbors_to_compare=5))

Detects when price makes lower lows but an oscillator (e.g. RSI) makes higher lows — a classic reversal signal. Use it to spot potential bottoms in a downtrend.

Detect Bearish Divergence

🟢 Real-time — ≈ number_of_neighbors_to_compare bars after the peak

Warmup: 2 × number_of_neighbors_to_compare + 1 bars (default: 11 bars (number_of_neighbors_to_compare=5))

Detects when price makes higher highs but an oscillator makes lower highs. Use it to spot potential tops in an uptrend.