Back test every tick very slow (EA SOURCE CODE HELP)

 

Hi,

I have a simple EA source code, when I try a back test with every tick, he is very slow ... I would like to improve more performance ... anyone can help me looking this ea code?


Sorry for my bad english ...


==============

Olá,

Possuo um EA que quando executo o back test no tick a tick ele fica muito devagar para concluir. Alguem poderia olhar meu codigo e dar algumas dicas de como melhorar a perfomance?

Files:
disMA.mq5  71 kb
enum.mqh  4 kb
Logger.mqh  2 kb
 

Without viewing at your code to increase the speed of a program use from the editor: Debug => Profiling with hist. Data.

There you can see what functions and what 'lines' in your program consume the most cpu time - then it's up to you to improve that.

 
  1. EAs : Don't do per tick that you can do per bar, or on open.
    If you are waiting for a level, don't reevaluate, wait until price reaches it (or a new bar starts and you recalculate.)
    If you are waiting for an order to close, only look when OrdersTotal (or MT5 equivalent) has changed.
              How to get backtesting faster ? - MT4 - MQL4 programming forum 2017.08.07

  2. Indicators: Code it properly so it only recomputes bar zero (after the initial run.)
              How to do your lookbacks correctly. 2016.05.11
    Or, reduce Tools → Options (control+O) → Charts → Max bars in chart to something reasonable (like 1K.)

 
thanks, i will try this