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
| Slot | Available | Role |
|---|---|---|
| Entry Point | No | — |
| Entry Rule | Yes | Filters entries by the pin bar pattern. |
| Exit Point | No | — |
| Exit Rule | Yes | Triggers 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
| Rule | Long signal is 1 when | Short signal is 1 when |
|---|---|---|
| Bullish Pin Bar formed | the last closed candle has a small body, a long lower wick, and no upper wick | the last closed candle has a small body, a long upper wick, and no lower wick |
| Bearish Pin Bar formed | the last closed candle has a small body, a long upper wick, and no lower wick | the last closed candle has a small body, a long lower wick, and no upper wick |
Parameters
| Parameter | Type | Default | Range | Purpose |
|---|---|---|---|---|
| Max body part % | number | 8 | 1 to 100 | Maximum body size as a percentage of the whole candle range |
| Min wick part % | number | 30 | 1 to 100 | Minimum 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.