Pin Bar

A Pin Bar is a candle with a long wick and a small body that signals a potential price reversal.

Role in the strategy

SlotAvailableRole
Entry PointNo—
Entry RuleYesFilters entries by the pin bar pattern.
Exit PointNo—
Exit RuleYesTriggers exits by the pin bar pattern.

The Pin Bar 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 Pin Bar formedthe last closed candle has a small body, a long lower wick, and no upper wickthe last closed candle has a small body, a long upper wick, and no lower wick
Bearish Pin Bar formedthe last closed candle has a small body, a long upper wick, and no lower wickthe last closed candle has a small body, a long lower wick, and no upper wick

Parameters

ParameterTypeDefaultRangePurpose
Max body part %number81 to 100Maximum body size as a percentage of the whole candle range
Min wick part %number301 to 100Minimum wick length as a percentage of the body size

Calculation

engine/indicators/indicator-pin-bar.ts evaluates the last closed candle:

  • The body (|Close − Open|) must be smaller than Max body part % of the candle range (High − Low).
  • A wick counts when its length exceeds Min wick part % of the body size.
  • A bullish pin bar needs the lower wick only; a bearish pin bar needs the upper wick only.

The indicator draws no chart line.

Backtesting

  • The rule fires on the bar after the pin bar candle has 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.