Why would you want to create ten thousand files with one line in each? Append the line to one file, the step is the line number.
Each file will by more than one line. I need more value for each step optimization for all input data therefore I want one file on one step optimization.
Question is: How do I do it? I don´t know ... :-(
endy5:
Each file will by more than one line. I need more value for each step optimization for all input data therefore I want one file on one step optimization.
Question is: How do I do it? I don´t know ... :-(
I have been using following code for generating the serial log file names for long time, perhaps it could give you inspiration:
// creates string from a current date and compare to a string in the global. ! Not synchronous ! double todayString = StrToDouble(padZero(Year(),4) + padZero(Month()) + padZero(Day()) + /*str*/("0000")); string DEBUG_VAR=/*str*/("debugcounter"); if(!GlobalVariableCheck(DEBUG_VAR)) GlobalVariableSet(DEBUG_VAR, todayString); double debugIncrement = GlobalVariableGet(DEBUG_VAR); // replace date the next day. Still not synchronous !. while(todayString > debugIncrement) { GlobalVariableSetOnCondition(DEBUG_VAR, todayString, debugIncrement); debugIncrement = GlobalVariableGet(DEBUG_VAR); } // read synchronously the value of global and increment it for(debugIncrement = GlobalVariableGet(DEBUG_VAR);!GlobalVariableSetOnCondition(DEBUG_VAR, debugIncrement + 1, debugIncrement);) {} GlobalVariablesFlush(); // define logfile name fileName = /*str*/("LOGS\\") + DoubleToStr(debugIncrement,0) + /*str*/("-") + fileName + /*str*/(".log"); this.logHandle = FileOpen(fileName, FILE_WRITE|FILE_BIN|FILE_SHARE_READ|FILE_SHARE_WRITE);
Solution by global variables works all right. Maybe exist better solution but I am all right.
Thank you very mutch for idea!!!
I was thinking of creating a CRC32 of all the parameters. That way would allow reading the file back in.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hi quys,
I have EA preparing for optimize process and my EA create new file for each variant input parameters EA.
How create unique file name for every step optimization process?
example:
1th setting input parameters => filename: "optimize_step_0001.csv"
2nd setting input parameters => filename: "optimize_step_0002.csv"
etc. ----- etc. ------- => --------- etc. ------------
If exist any way how count steps in optimization process?
If exist any way how write actual setting value all input parameters for actual step optimization to file?
Thank you.