My backtest speed with MQL5 is quite slow. Is there anyone with ideas of how to go around this problem? It takes hours to backtest 2 years worth of
data. Or could it be my code which is inefficient|
- Projects and MQL5 Storage
- OpenCL support - Developing programs
- Workspace
Try to optimize the codes and number of operations you are doing each tick.
Limit even some calculations to be done only once per candle.
Limit even some calculations to be done only once per candle.
- 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 open or close, only look when OrdersTotal (or MT5 equivalent) has changed.
How to get backtesting faster ? - MT4 - MQL4 programming forum - Indicators: Code it properly so it only recomputes bar zero (after the initial run.)
How to do your lookbacks correctly.
Or, reduce Tools → Options (control-O) → Charts → Max bars in chart to something reasonable (like 1K.)
William Roeder:
- 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 open or close, only look when OrdersTotal (or MT5 equivalent) has changed.
How to get backtesting faster ? - MT4 - MQL4 programming forum - Indicators: Code it properly so it only recomputes bar zero (after the initial run.)
How to do your lookbacks correctly.
Or, reduce Tools → Options (control-O) → Charts → Max bars in chart to something reasonable (like 1K.)
very useful thank you
Ramon Sobrevals Arce:
Try to optimize the codes and number of operations you are doing each tick.
Limit even some calculations to be done only once per candle.
Try to optimize the codes and number of operations you are doing each tick.
Limit even some calculations to be done only once per candle.
thankyou
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register