Search code examples
tradingalgorithmic-tradingmql4mql5

annotate charts using mql4 or mql5


In the near future I will begin trading. Looking at all the different brokers the trading platform used is MetaTrader 4 or 5, which is fine.

I believe it is possible to carry out back testing using mql 4 or 5. However to save time I intend to continue using my own back testing engine which I have created.

What I would like to know is if it is possible to write code in mql 4 or 5 to annotate charts? Is so can you please tell me where I can find a good example for me to learn from.


Solution

  • MT4 or MT5 dilemma?

    For the sake of rapid prototyping, MT4 is for many reasons the safer choice.

    Backtesting engine being run externally to the MT4 is possible.

    MT4 code-execution engine allows to integrate process-to-process communications with external systems ( fully distributed heterogeneous multi-process & multi-platform system, be it called a Cloud or a Grid-computing or a MATRIX ).

    One can similarly equip MT4 with a remote console and type manually commands or run script-batches of such command from a remote terminal CLI.

    In the very same way one may operate a remote Backtesting engine on MT4 grounds via the same process-to-process messaging framework.

    Chart annotations? Yes, of course!

    MT4 code-execution engine, using a C-family MQL4 language, has a feature-rich palette for chart annotations. Both [TimeDOMAIN,PriceDOMAIN] grid-locked and a screen-layout PixelDOMAIN [x,y] grid-locked. As a starting point, use the MQL4 language reference, Chapter on ( visual ) Objects.

    Samples for inspiration?

    As just a teaser,

    check the MT4 possibilities:

    <aMouseRightCLICK>.openPictureOnAnotherTab to see full HiRes picture details
    

    enter image description here

    or

    enter image description here