Forex Blog

First-hand Forex trading experience and information about foreign exchange market that will be useful to traders

Archives

Support and Resistance Indicator in MetaTrader 5

January 18, 2010 (Last updated on January 19, 2010) by

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.

If you find some bugs in this MT5 indicator or want to make a suggestion regarding its functionality or what should be my next MT4->MT5 conversion, please, use the commentary form below.

3 Responses to “Support and Resistance Indicator in MetaTrader 5”

  1. Cuddle Monter

    Yeah I don’t use mt4 either, I don’t think its trustworthy… well I trade with acm and since they own they trading software the platforms have no technical problem, but given that mt4 is provided by a 3rd party they can ensure anything regarding this platform, and neither can any other broker…
    What can you say about this?

    Reply

    Andrei Reply:

    I can say that a company whose primary objective are the financial transaction isn’t necessarily better at ensuring a program’s stability than a company whose objective is actually the “program’s stability”.

    Reply

Leave a Reply

required
required (will not be published)
optional