Skip to content
All library documents

Pin Bar Detection Rules and Signal Filtering

Article MQL5 code base

Summary

This document explains how a chart indicator identifies bullish and bearish Pin Bars. It looks for candles with a small body and one shadow substantially longer than the other, and checks the candle against the previous candle’s range. When it finds a pattern on the previous bar, it places a signal arrow at the opening price of the current bar. The document also describes how external programs can read the pattern and signal buffers.

Four settings control candle height, body size, body placement relative to the previous candle, and the ratio between the longer and shorter shadows. Tightening these conditions reduces signals; loosening them increases signals. The text recommends choosing settings for the instrument and timeframe and using another indicator, such as key price levels, for confirmation. It explains the pattern logic and parameter choices but provides no performance tests, win rates, or evidence that the signals predict reversals. Pin Bars are presented as possible reversal patterns, so the signals require independent evaluation.

Key ideas

  • The indicator flags candles with a small body and a distinctly longer upper or lower shadow.
  • It checks the candidate candle’s body against the prior candle’s range before marking a pattern.
  • A detected pattern appears on the prior bar, while its buy or sell signal is placed on the current bar.
  • Candle height, body size, body placement, and shadow ratio settings determine which patterns qualify.
  • The document recommends additional confirmation and tuning settings to the instrument and timeframe.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.