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 | Highest Lowest

The Highest Lowest indicator searches for bars having High above the High of bars on the left and on the right, as well as bars having Low below the Low of bars on the left and on the right:

MetaTrader Experts, Indicators, Scripts and Libraries

Fig. 1. Highest Lowest

The indicator is displayed using the DRAW_ARROW style.

Since the indicator analyzes the bar on the right, the value of the indicator may change in some cases. For example, the following bar can be redrawn:

MetaTrader Experts, Indicators, Scripts and Libraries

Fig. 2. Highest Lowest The bar can be redrawn

This bar will not be redrawn:

MetaTrader Experts, Indicators, Scripts and Libraries

Fig. 3. Highest Lowest The bar can not be redrawn

If you want to see the default indexing of bars in indicators, uncomment code in OnCalculate:

/*     int bar_0=0;     int bar_rates_total_minus_1=rates_total-1;     Comment("prev_calculated=",prev_calculated,"\n",             "time[",bar_0,"]=",time[bar_0],"\n",             "time[",bar_rates_total_minus_1,"]=",time[bar_rates_total_minus_1]);  */  

This code displays on the screen the value of the prev_calculated variable, the time of the bar with the 0 index and the time of the bar with the index of rates_total-1.

20300

Best MetaTrader Indicators + Profitable Expert Advisors