Support and Resistance Indicator in MetaTrader 5

It’s been a while since the last time I’ve converted some indicator from MT4 to MT5 platform. So, today I present Support and Resistance indicator, which was initially written by Barry Stander for MetaTrader 4. It was a very simple conversion since the code was quite small in the MT4 version. The indicator uses only one standard MetaTrader indicator — Bill Williams’ Fractals. The resulting converted version of the indicator for MT5 has some advantages:

  • The structure is much more clear.
  • Removed unnecessary code and global variables.
  • Now it’s easier to edit and update this indicator.

But there are also some disadvantages compared to MT4 version:

  • For some reason MT5 prohibits the use of ”&” symbol in the indicator’s short name.
  • Code became bigger.
  • A lot of additional code for converting the arrays.
  • There is a bug in MT5 (Build 239) iFractals function that returns “double max” instead of zeros when the fractal value is empty.

You can get the code of MT5 version or read more info about this support and resistance indicator.

Update: It turns out that in MetaTrader 5 the EMPTY_VALUE constant is intentionally equal to DBL_MAX, so it’s a normal behavior for iFractals to return DBL_MAX values when the indicator’s value is empty.
(…)
Read the rest of Support and Resistance Indicator in MetaTrader 5 (25 words)

MetaTrader 4 platform with ECN execution - FXOpen.

Posted on Forex blog.
Go to Source

Leave a Reply