Is metatrader itself well optimized?
The microseconds that the EA takes to run is nothing compared to the 50 milliseconds the network takes. Optimization there is irrelevant.
In the tester/optimizer, adjust your code.
-
EAs : Don't do per tick what 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) -
Indicators: Code it properly so it only recomputes bar zero (after the initial run).
How to do your lookbacks correctly. (2016)
3 Methods of Indicators Acceleration by the Example of the Linear Regression - MQL5 Articles. (2011)
Or, reduce Tools → Options (control+O) → Charts → Max bars in chart to something reasonable (like 1K.)
Is it written with for example branchless programming and bit twiddling? Or is it written in an academic software programmer way?
I have been reading https://johnnysswlab.com/ and started wondering how much performance can be squeezed out from an ea if the platform is not well optimized? Is it well optimized?
Also metaeditor's limited debugging/profiling capabilities, and using an unknown subset of C/C++ makes it difficult to evaluate what can be done and what can't.
Anybody with knowledge on this topic?