Is there a way to access the first and last run of Simulations that run in a Portfolio Backtester optimization from Code?
I wrote a MoneyManagement Signal that writes a data-file to a certain directory every time it is been run.
If an optimization run is started with for example 100 simulations it writes 100 different files to that directory, which works fine.
I would now like to access the first run from code (because I would like to clear that directory before the next 100 files come) and the last run in the optimization set (to then also run some code).
Checking for a certain bar-number or so does not work, because every simulation has every bar number.
Are there reserved Words for the number of simulations and the current run?
How to access first and last Run of Simulations in Portfolio Backtester optimization run from code
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: How to access first and last Run of Simulations in Portfolio Backtester optimization run from code
Hello Trade23,
There are no such reserved words. Optimization runs in multiple flows, there is no guarantee that the last iteration number will be the last one to finish.
Instead of bar number you can check any script value to initiate the file delete operation.
There are no such reserved words. Optimization runs in multiple flows, there is no guarantee that the last iteration number will be the last one to finish.
Instead of bar number you can check any script value to initiate the file delete operation.