ABC Pullback Pattern

ABC Pullback Pattern

Description

The ABC Pullback Pattern is a NinjaTrader 8 trading indicator designed to identify high-probability pullback entries following a Donchian Channel breakout. It detects setups where price retraces after a new swing high or low, forming an alternating body color pattern (ABC) that reflects weakening counter-pressure.

To qualify, the pullback must occur within a specific number of bars, maintain controlled structure (body/bar ratio, breakout range, and trend bar limits), and offer a favorable risk-reward ratio, validated with ATR and tick-based distance filters. The trader can choose between Market execution or BarBreakout mode, where a breakout of the setup confirms the trade within a defined validity window.

This indicator is ideal for momentum traders looking to time trend continuation entries with strong confluence and low structural risk.

Key Features

  • Donchian Channel Breakout Detection: Anchors signals to fresh highs or lows.
  • Alternating Body Color Filter: Validates pullbacks based on color alternation patterns.
  • Pullback Structure Filters: Controls pullback quality via min/max bars, bar behavior, and shape.
  • Distance Filters: Ensures entry is neither too close nor too far from breakout using ATR and ticks.
  • Risk-Reward Validation: Filters setups based on minimum and maximum R:R using structure-based stops.
  • Execution Mode: Trade on pattern formation (Market) or delayed confirmation (BarBreakout).
  • Signal Validity: Supports multi-bar confirmation for slow markets.

Tips for Implementation

  • Strategic Alignment: Use in trending markets. Confirm with moving averages or higher timeframe bias.
  • Pullback Quality: Tighten MaxTrendBarsInPullback and MinBodyToBarRatio for sharper entries.
  • Volatility Control: Adjust ATRPeriod and distance filters to normalize across instruments.
  • Execution Logic: Use BarBreakout in slow markets, Market in fast-moving setups.
  • Backtesting: Tune parameters across market conditions for robustness and consistency.

Parameters

  • DC Period
    Type: int
    Description: Defines the period for the Donchian Channel used to detect breakout structure.
    Default Value: 5
    Valid Values: 1 to any positive integer
  • Min Pullback Bars
    Type: int
    Description: Minimum number of bars required to form a valid pullback after the Donchian breakout.
    Default Value: 1
  • Max Pullback Bars
    Type: int
    Description: Maximum number of bars allowed to form the pullback. Filters out wide or sluggish retracements.
    Default Value: 5
  • Max Trend Bars In Pullback
    Type: int
    Description: Maximum number of pullback bars that move in the direction of the original breakout.
    Default Value: 2
  • Max Breaks Prev Bar
    Type: int
    Description: Maximum number of pullback bars allowed to break the previous bar’s high (long) or low (short).
    Default Value: 1
  • Min Body To Bar Ratio
    Type: double
    Description: Minimum average ratio of body size to total bar range in the pullback.
    Default Value: 0.1

 

  • Min Distance Ticks
    Type: int
    Description: Minimum distance (in ticks) from the setup to the Donchian breakout level.
    Default Value: 1
  • Max Distance Ticks
    Type: int
    Description: Maximum distance (in ticks) allowed between the setup and the breakout level.
    Default Value: 1000
  • Min Distance ATR
    Type: double
    Description: Minimum allowed distance between the setup and the breakout level, measured in ATR multiples.
    Default Value: 0.0
  • Max Distance ATR
    Type: double
    Description: Maximum allowed distance between the setup and the breakout level, measured in ATR multiples.
    Default Value: 5.0
  • ATR Period
    Type: int
    Description: Period used for ATR calculation to normalize distance filters and risk-reward evaluation.
    Default Value: 14
  • Min RR Ratio
    Type: double
    Description: Minimum risk-reward ratio required from setup to target, assuming a stop just below/above the setup zone.
    Default Value: 0.8
  • Max RR Ratio
    Type: double
    Description: Maximum allowed risk-reward ratio, avoiding setups with impractically distant targets.
    Default Value: 5.0

 

  • Confirmation Candle
    Type: bool
    Description: If enabled, a setup is only confirmed when followed by another candle of the same body color.
    Default Value: true
  • Setup Type
    Type: enum (Market, BarBreakout)
    Description: Defines how the trade is confirmed—immediate on pattern completion (Market) or on breakout of setup level (BarBreakout).
    Default Value: BarBreakout
  • Setup Validity Bars
    Type: int
    Description: For BarBreakout setups, defines how many bars the setup remains valid before expiring.
    Default Value: 3
  • Plot Offset (Ticks)
    Type: int
    Description: Vertical offset for the triangle plot markers in ticks. Helps avoid overlap with candles.
    Default Value: 5

Plots

  • IndicatorSignalUp
    Type: Plot
    Style: Triangle Up
    Color: Green
    Description: Plots a green triangle below the bar when a valid bullish signal is confirmed.
  • SignalUpUpperLevel
    Type: Plot
    Style: Hash
    Color: Green
    Description: Displays the bullish entry level for a valid long setup.
  • SignalUpLowerLevel
    Type: Plot
    Style: Hash
    Color: Green
    Description: Displays the stop level for the long setup.
  • BreakoutHighLevel
    Type: Plot
    Style: Hash
    Color: DeepSkyBlue
    Description: Plots the Donchian breakout high used as the bullish target level.
  • IndicatorSignalDown
    Type: Plot
    Style: Triangle Down
    Color: Red
    Description: Plots a red triangle above the bar when a valid bearish signal is confirmed.
  • SignalDownUpperLevel
    Type: Plot
    Style: Hash
    Color: Red
    Description: Displays the stop level for the short setup.
  • SignalDownLowerLevel
    Type: Plot
    Style: Hash
    Color: Red
    Description: Displays the bearish entry level for a valid short setup.
  • BreakoutLowLevel
    Type: Plot
    Style: Hash
    Color: DeepSkyBlue
    Description: Plots the Donchian breakout low used as the bearish target level.