Custom Pin Bar Indicator for Metatrader 4

The Pin bars are candlesticks or patterns composed of a single candle that can be formed in any market and time frame, both short and long term. When these candlesticks appear they offer price action signals as trend change patterns that indicate that there is a possibility that the price direction changes, at least temporarily. Of course, like any candlestick pattern, it should not be used as the sole criterion to enter the market as it can sometimes fail.

What are pin bars?

The pin bar is a candlestick that is characterized by having a small body and a large lower or upper tail (the length of the tail is greater than that of the candle body). When a pin bar is presented, it indicates that the market trend can be reversed. A peculiarity of these patterns is that the color of the candle’s body is not relevant so a bearish pin bar can have a bullish body and vice versa. However, the pattern is more valid if the color of the body matches the type of pin bar.

Pinbar indicator for MT4

Below we include a custom indicator for Metatrader 4 which shows bullish and bearish pin bar patterns in the price chart.

  • Bullish pin bars (buy signals) are shown by green arrows with a bullish direction.
  • Bearish pin bars (sell signals) are shown by red arrows with a bearish direction.

It is an indicator based solely on the pure price action, which does not use any standard technical indicator in its code. The configuration of this pin bar detector can be modified through the input parameters of the indicator. This indicator, simply called Pinbar, can also emit alarm signals on the platform and email alerts when it detects Pinbar patterns.

Indicator Settings

This indicator does not require further configuration. It only requires the installation to work optimally. In fact, the only thing that can modify the trader is the colors of the arrows that indicate the pin bar.


Pin bar indicator MT4
H4 price chart of the GBP/USD currency pair with the Pin bar indicator for MT4


In the previous image, we see an H4 price chart of the GBP/USD pair (Metatrader 4 platform of the broker Alpari) in which we are using the Pinbar indicator. As we can see, the indicator shows several bullish and bearish signals in the chart that offer opportunities to buy and sell. However, pin bars do not always precede a change in trend, that is, their signals are not 100% reliable, as is the case with any price pattern, including the most recognized. For this reason, this custom indicator, as well as pin bar patterns in general, should not be used by themselves as the sole criteria to open and close new positions in the market.

Instead, pin bars should be part of a more developed strategy that includes filters and other tools that allow signals to be verified to increase their reliability.

Download and installation of the indicator

You can download the indicator at no cost at the following link:

Leave a Comment