- Issue with Optimization on Strategy Tester
- Various
- Changing The Template Automatically Based on Day and Time
A simple way:
The OnTester() event runs after every step of the optimization.
So, at the bottom of OnTester(), open a file, append your custom values (perhaps as CSV), and close the file.
Thus, the file is opened and closed once per each step of the optimization.
Since the optimizer can use multiple threads, it's possible that two OnTester() events may try to write to the file at the same time. I haven't actually seen this happen yet.
There is a slightly more complex way using OnTesterInit() and OnTesterDeinit(), but because OnTester() is on it's own thread, you must pass data between the memory spaces using frames.
A simple way:
The OnTester() event runs after every step of the optimization.
So, at the bottom of OnTester(), open a file, append your custom values (perhaps as CSV), and close the file.
Thus, the file is opened and closed once per each step of the optimization.
Since the optimizer can use multiple threads, it's possible that two OnTester() events may try to write to the file at the same time. I haven't actually seen this happen yet.
There is a slightly more complex way using OnTesterInit() and OnTesterDeinit(), but because OnTester() is on it's own thread, you must pass data between the memory spaces using frames.
You forgot it's MT4 topic. No muliple threads, no OnTesterInit() or OnTesterDeinit().
You forgot it's MT4 topic. No muliple threads, no OnTesterInit() or OnTesterDeinit().
Ah, yes. Good catch.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use