Candle Color

Candle Color detects bullish and bearish candles by comparing their close and open prices.

Role in the strategy

SlotAvailableRole
Entry PointNo—
Entry RuleYesFilters entries by consecutive candle bodies.
Exit PointNo—
Exit RuleYesTriggers exits by consecutive candle bodies.

The Candle Color produces conditions, not order prices. As an entry rule it is ANDed with the entry point and the other entry rules; as an exit rule it is ORed with the other exit rules. See Indicators for the slot semantics.

Logic rules

RuleLong signal is 1 whenShort signal is 1 when
Bullish Candle formedthe last N candles closed at least Min body height above their openthe last N candles closed at least Min body height below their open
Bearish Candle formedthe last N candles closed at least Min body height below their openthe last N candles closed at least Min body height above their open

N is the Consecutive candles parameter. The candles are evaluated on the closed bars preceding the current one.

Parameters

ParameterTypeDefaultRangePurpose
Min body height [pips]number51 to 1000Minimum close-to-open distance of a candle body
Consecutive candlesnumber11 to 10Number of candles that must match in a row

Calculation

engine/indicators/indicator-candle-color.ts scans the bars: a candle counts as bullish when Close − Open is at least the pip distance of the Min body height, and as bearish when Open − Close is at least that distance. The counter resets on a non-matching candle; the rule fires when the counter reaches Consecutive candles. The indicator draws no chart line.

Backtesting

  • The rule fires on the bar after the matching candles have closed — it never uses the in-progress bar.
  • The indicator contributes only long/short signal arrays — it never changes the entry or exit order price.
  • An entry happens only when the entry point allows the direction and every entry rule passes; an exit happens when the exit point is reached and any exit rule passes.