- Why do you care? Other than diagnostics during non-live/non-optimizer modes, you shouldn't be doing anything different.
- Test for it.
Detect optimization mode programmatically - Expert Advisors - MQL5 programming forum (2020.05.15)
- Why do you care? Other than diagnostics during non-live/non-optimizer modes, you shouldn't be doing anything different.
- Test for it.
Detect optimization mode programmatically - Expert Advisors - MQL5 programming forum (2020.05.15)
- Why do you care? Other than diagnostics during non-live/non-optimizer modes, you shouldn't be doing anything different.
- Test for it.
Detect optimization mode programmatically - Expert Advisors - MQL5 programming forum (2020.05.15)
Your point 1 is really the worst advice you ever gave on this forum.
Actually it's almost the reverse which is true, you should be doing almost all different. Why ? for optimization (speed) reasons.
Ontester() I believe it is called. It shows up in a textbox when you open a new project. It will have a checkbox asking if you want the code pre-added to your template (image attached)
Your point 1 is really the worst advice you ever gave on this forum.
Actually it's almost the reverse which is true, you should be doing almost all different. Why ? for optimization (speed) reasons.
The Optimizer will change the parameters, the code follows them. My comment is nothing about that.
If the code tests for optimization and does something different, the results are now meaningless for live trading.
The Optimizer will change the parameters, the code follows them. My comment is nothing about that.
If the code tests for optimization and does something different, the results are now meaningless for live trading.
Not sure what you are saying here.
I am talking about optimization of the code (I wrote "for optimization (speed)" which maybe is not clear enough), not about Strategy Tester optimization. Yes you have to take care if your code is executed on a live chart or within the Strategy Tester, just one example :
On your live chart you have a loop on Positions to count open positions, it's mandatory as you can have several EAs running, manual intervention... but a loop repeated millions of times (supposing you test on real ticks) is costly. A code running on the Strategy Tester could just use a counter to increment/decrement when a position is open/close. It's speed optimization which needs to "detect that I'm doing a backtesting? "
There are a lot of speed optimizations that can be done when running the Strategy Tester, of course in the end the results must be the same than the live version. But it can make the difference between a backtest that take 1 hour and 1 that take some seconds.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use