
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
och:
I even add a counter passcount is a global variable but is not increasing.
Using static variables on global scope won't help you during an optimization. Every time when new backtesting pass starts all global variables initialize. Finishing a pass means death of all variables.
See Visibility Scope and Lifetime of Variables:
A variable declared outside all functions is located into the global scope. Access to such variables can be done from anywhere in the program.These variables are located in the global pool of memory, so their lifetime coincides with the lifetime of the program.
Using static variables on global scope won't help you during an optimization. Every time when new backtesting pass starts all global variables initialize. Finishing a pass means death of all variables.
See Visibility Scope and Lifetime of Variables:
Thanks a lot Rosh,
Now it works. I completly forgot FileSeek. The issue now is that file is spread in as many Agent directory as I am running agent. Is it possible that all Agents write in the same file?
Regards,
Olivier
och:
The issue now is that file is spread in as many Agent directory as I am running agent. Is it possible that all Agents write in the same file?
We are going to translate the article Основы тестирования в MetaTrader 5 into English, where you can find the answer on this question. At the moment you can use Google Translate service to read how to do it:
Using a shared folder for all client terminals
All testernye agents are isolated from each other and from the client terminal: each agent has its own folder in which the written logs of the agent. In addition, all file operations with test agent originate in the folder imya_agenta/MQL5/Files. However, we can realize the interaction between local agents and the client terminal through a common folder for all client terminals, if you open a file to specify the flag FILE_COMMON :