Skip to content
Forex Indicator System Thailand
Back to marketplace
PatternIndicator

Pinbar Detector (pin bar finder)

An indicator that marks candles matching a pin bar pattern with a smiley face above or below, with alerts

Pinbar Detector (pin bar finder) on an MT5 chart
Example on an MT5 chart

Download the indicator free

Download right away. Nothing to fill in.

Version
1.03
Published
11/21/2026
File size
21 KB

Open source, Apache License 2.0, by EarnForex.com. See licences

Version history

  1. 1.03Current11/21/2026 · 21 KB

    First release on this site.

How to read it

A green smiley face below a candle is a bullish pin bar and a red smiley face above a candle is a bearish pin bar. The candle with the smiley has a small body at one end, its other wick pokes past the low (bullish) or high (bearish) of the previous candle (the Left Eye), and its body stays inside the previous candle's high-low range. The smiley appears only after the bar has closed.

The defaults require a body of no more than 33% of the candle length, sitting in the 40% at one end, a wick that protrudes past the previous candle by at least half of the candle length, and a Left Eye of the opposite direction (for example a bearish candle before a bullish pin bar). CountBars sets how many bars are calculated (0 = all) and DisplayDistance sets how far the smileys sit from the candle.

UseAlerts turns on a popup alert with a sound. UseEmailAlerts needs SMTP and UseNotificationAlerts needs push notifications set up in the terminal first. Alerts are sent only for a pin bar on the bar that has just closed. The Custom* parameters apply only when UseCustomSettings is on. Note from the code: the CustomNoseBodyInsideLeftEyeBody option is declared but never applied, so it has no effect on detection.

Parameters

NameDefaultDescription
CountBars0Number of bars to calculate. 0 = all.
DisplayDistance5Distance of the smiley from the candle. A higher value places it farther away.
UseAlertstruetrue = show a popup alert with a sound when a pin bar is found.
UseEmailAlertsfalsetrue = send an email when a pin bar is found (set up SMTP in the terminal).
UseNotificationAlertsfalsetrue = send a push notification to the mobile app when a pin bar is found (set up push in the terminal).
UseCustomSettingsfalsetrue = use the Custom* criteria below instead of the built-in values.
CustomMaxNoseBodySize0.33Maximum body-to-candle-length ratio of the Nose bar (the pin bar itself).
CustomNoseBodyPosition0.4Body position in the Nose bar, e.g. 0.4 = within the top or bottom 40% of the bar.
CustomLeftEyeOppositeDirectiontruetrue = the Left Eye must be the opposite colour to the pattern (bearish for a bullish pin bar and vice versa).
CustomNoseSameDirectionfalsetrue = the Nose must be the same colour as the pattern (bullish for a bullish pin bar).
CustomNoseBodyInsideLeftEyeBodyfalsetrue = the Nose body must sit inside the Left Eye body (in the code this option is not applied).
CustomLeftEyeMinBodySize0.1Minimum body-to-candle-length ratio of the Left Eye.
CustomNoseProtruding0.5Minimum protrusion of the Nose past the Left Eye, relative to the Nose length.
CustomNoseBodyToLeftEyeBody1Maximum Nose body size relative to the Left Eye body.
CustomNoseLengthToLeftEyeLength0Minimum Nose length relative to the Left Eye length.
CustomLeftEyeDepth0.1Minimum depth of the Left Eye relative to its length (the difference from the back of the Nose).
CustomMinimumNoseLength1Minimum Nose candle length in points.

Defaults are the values shipped with the EA, not a recommendation. Results depend on the market and on each account. Past results do not guarantee future results. Trading carries a high risk of loss.

How to install

  1. Download the .ex5 file.
  2. In MT5, choose File > Open Data Folder.
  3. Copy the file into the MQL5\Indicators folder.
  4. Right-click Indicators in the Navigator window and choose Refresh (or restart MT5).
  5. Drag the indicator onto a chart, adjust the Inputs if you like, then click OK.

Description

Pinbar Detector looks for the pin bar candlestick pattern: a candle whose wick extends past the previous candle with a small body at one end. It compares each closed candle with the one before it (called the Left Eye). A bullish pin bar is shown as a green smiley face below the candle, and a bearish pin bar as a red smiley face above it.

The defaults use the indicator's built-in criteria. Turn on UseCustomSettings to set your own, such as body-to-candle ratio, body position, how far the wick protrudes past the previous candle, and size relative to the Left Eye.

When a pin bar is found on the latest closed bar, it sends a popup alert with a sound, and can also send an email or a mobile push. It opens no trades.

Banners from the Exness partner programme

Exness banner: gold spreads*

FXIDTH is an independent IB partner of Exness. This channel is not owned or operated by Exness.*Spreads may fluctuate and widen due to factors including market volatility, news events, market open/close, and others.*Processing times may vary depending on the chosen payment method.