Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Indicator | PinBar

The indicator detects and visualizes one of the fundamental patterns of Price Action. On high timeframes (from 1 day to a month) the pin bar is a strong signal to enter the market in a direction opposite to the long shadow. The indicator is calculated only on complete bars.

The input parameters are:

input int      MinBarSize=200;         //Minimal bar range in points
input int      PriceOffset=50;         //Shift of the open price and stop loss from the bar boundaries in points
input double   BarRatio=2.2;           //Minimal ratio of the bar range to the body
input double   TailRatio=1.3;          //Minimal ratio of a larger tail to the remaining part of the bar
input bool     UseBodyDirection=false; //Flag for checking the direction of the bar body. Bearish pin bar - bearish body, bullish bar - bullish body
input bool     UseCloseThirds=true;    //Flag for checking the bar part in which it closed. For bearish bars - in the lower third of the bar,
                                     //for bullish bars - upper one 
input int      ExtremumOfBars=10;     //Checking the condition of location of the pin bar at the extreme relative to the specified number of previous bars

MetaTrader Experts, Indicators, Scripts and Libraries

Tips:

  • The indicator contains two buffers. One of them stores values of the recommended price for opening a stop order (green points), the second one contains recommended values for stop loss (red points). The indicator is built into an Expert Advisor traditionally using the iCustom() function.
  • In the figure some pin bars with suitable proportions are not indicated because of the value of the ExtremumOfBars parameter. By changing the parameters of recognition you can achieve the desired results.
1768

Best MetaTrader Indicators + Profitable Expert Advisors