So I have a related question I am trying to solve.
With my strategy I am exporting trade records and performance metrics automatically to two csv files. I have it setup for multi-threaded support and it is works great running in the optimizer. To support ppart of this, I am using some "static" variables for the output file names. These file names are automatically calculated based on instrument and time etc.
The issue I have is that because of the use of statics, the filename does not reset for each new optimization run so I have to manually "move them out of the way".
What I was hoping to do was detect when an optimization was being performed and then using the expected number of iterations (using the base.OptimizationMethod.Iterations) track until I am complete and then reset the static file name.
I would have thought that this OptimizationMethod.iterations property (at least looking at the defaultOptimization code should represent the number of iterations that are required to be performed (i.e. a total count), but when I look at this variable it is always one from within a strategy instances.
Anyone have any ideas on if I am being boneheaded or is there something else I am do instead??
Now that code is for 6.5, and is useless for 7 in terms that it won't work. But, you could still analyze the code and possibly learn a few things to do with using your own optimizer.
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.
The following user says Thank You to Big Mike for this post:
I emailed NT also, but it does not seem like there is an easy method inside a Strategy. I could extend/write my own optimizer, which is likely the easiest at stage.
In the interim what I have done is created a "static" that tracks whether a "file name reset" is required, and then just set that to the true in the UI. This works fine, the only issue being that if you forget, you add/overwrite the last files.