I'm adding a perturbation analysis to my strategy development that save a different equity curve each simulation run.
I would have a dynamic variable inside the strategy identifying the backtest index.
To make an example:
Strategy name: "MySTrategy"
Optimization parameter: take profit, from 60 to 100, step 10
When launching the strategy analyzer, five backtests will be executed.
I'm looking for a variable available IterationIndex inside the strategy, say from 1 to 5, so to be able to save results like:
SaveFileName = "MyStrategy" + IterationIndex.ToString()
At the moment I'm using a combination of all optimization parameters converted into a string. That's a working solution but not a general one neither elegant.
SaveFileName = "MyStrategy" + TakeProfit.ToString() + StopLoss.ToString() + ....... + ".csv"
I also tried to generate a brute random variable but it seems that this approach cannot work being the seed linked to at internal clock at ms value, too slow indeed.
Btw, here the typical result of this kind of analysis when plotted with my python script.
Thanks
Comment