Search code examples
mql4algorithmic-tradingmetatrader4mql5metatrader5

Can a MQL5 EA draw an (uninterrupted) stop loss line?


Can a MQL5 EA draw an (uninterrupted) stop loss line, like an indicator could?

If yes: how?

If no: what‘s next best solution?

And will they also show in the strategy tester ( backtesting ) visualization?

Thank you!


Solution

  • Yes, it can

    As of 2018-03, any MQL4/5 EA can draw exactly the same range of visualisation effects on MT4/5's GUI Graphs as the Custom Indicator can, so only one's imagination is the limit.

    Strategy Tester will do the same ( in case it has been invoked in a visual mode [x] set on ).


    If yes, how?

    Principally using:

    ObjectCreate( anObjectNAME,
                  { OBJ_TREND, OBJ_CHANNEL, OBJ_ARROW, OBJ_HLINE, OBJ_VLINE, ... },
                  ...
                  );
    ObjectSet(    anObjectNAME,
                  { OBJPROP_ANGLE, OBJPROP_COLOR, OBJPROP_PRICE1, ... },
                  ...
                  );
    

    and related GUI tools, present in the MQL4/5 language.

    Several "point-and-move" trading automation frameworks have been built this way and are known to support a fully graphically-based human-trader:trading-engine automation, using but mouse on GUI.

    Another option is to integrate the MT4/5 Terminal platform, using as an example an external signalling/messaging plane, like ZeroMQ or nanomsg, with another GUI / MMI / smart-analytics proxies and an external GUI-front-end(s), where indeed no limits apply on one's imagination and fulfillment of visually / analytically augmented-trading needs.

    Using this technology, I can confirm ~ < 80 ms RTT latencies to be reasonably achievable ( which is 2+ orders of magnitude faster, than a human-trader's perception and reactive latencies are )