Sorry if this has been asked before but I'm finding it a bit difficult to search for.
I have an expert that writes out a lot of information to CSV files. The problem is, if I forget to turn this off before I start optimization, it will write these CSV files for every thread that it uses. These then gobble-up all the disk space and the optimization run fails.
The ideal solution to this would be detecting when using optimization mode or where the EA is running on a thread other than the first thread normally used by back-testing, and then disable the CSV output.
Does anyone know how I can achieve this?
- www.mql5.com
I'm not sure how that answers the question. Is there something I'm missing here?
I'm not sure how that answers the question. Is there something I'm missing here?
I understand about the Tester events but what I want to know is how to detect 'Optimization'.
enum termnal_Mode{ MODE_DEBUG, MODE_LIVE, MODE_VISUAL, MODE_OPTIMIZER}; termnal_Mode get_modus_operandi(void){ if (IS_DEBUG_MODE) return MODE_DEBUG; // debugging. if (!MQLInfoInteger(MQL_TESTER) ) return MODE_LIVE; // IsTesting() if ( MQLInfoInteger(MQL_VISUAL_MODE) ) return MODE_VISUAL; // IsVisualMode() return MODE_OPTIMIZER; }
I
I understand about the Tester events but what I want to know is how to detect 'Optimization'.
OnTesterInit is called before optimization starts, allowing you to make decisions based upon that.
and William's method allows you to detect it anywhere in your code
regards
- www.mql5.com
MQLInfoInteger(MQL_OPTIMIZATION)
That's the one I'm looking for. Thanks Alain.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Sorry if this has been asked before but I'm finding it a bit difficult to search for.
I have an expert that writes out a lot of information to CSV files. The problem is, if I forget to turn this off before I start optimization, it will write these CSV files for every thread that it uses. These then gobble-up all the disk space and the optimization run fails.
The ideal solution to this would be detecting when using optimization mode or where the EA is running on a thread other than the first thread normally used by back-testing, and then disable the CSV output.
Does anyone know how I can achieve this?