Suggesting a button on Optimization to copy all (100+) Parameter values from Backtesting and untick most or all
Suggesting a button on Optimization to copy all (100+) Parameter values from Backtesting and untick most or all
10 Sep 2024, 01:52
During development oc cBots for cTrader Automate on Windows, after a cBot has been rebuilt, currently Optimization seems to start with parameter values based completely on the program defaults & steps or ranges.
I would find it very useful to be able to copy to Optimization the values already manually set in Backtesting, and also to turn off all the range ticks (or perhaps all but the few I used for the last optimization run). Possibly to copy the date range too.
My testing cBot has over 100 parameters and although some may well still have default values in a Backtest, it can be tedious checking if I've missed one when the Optimize result set does not include an exact match with the Backtest it was supposed to be optimising. Thanks for reading.
Update: I've just realised that since I'm already using C#'s System.Reflection in the cBot to find the parameters that were supplied so they can be logged, I could have the cBot also write them to a file in the text format used for .optset files and then manually load that file into the Optimization.
It seems I'm already logging ALL the fields needed (Property name, value, type, & the CustomAttributeData where I can see some have DefaultValue, MinValue, & Step.
The copy button would be nice but I'll try this anyway, hopefully there'll be no pressing reason for you to change the format of .optset data (or .cbotset) too drastically in the near future.
martins
27 Nov 2024, 15:14 ( Updated at: 27 Nov 2024, 15:29 )
Best way would be to add a green button to the top of the Parameter tab next to save & load, to have the effect of copying all the current values to replace the optimise values, a bit like the green “Apply” on each line of Optimisation results but in reverse.
I suppose everything else already in the current optimise parameters could be left unchanged - the min/max/steps and tick boxes - although that still means the 1st time you have to untick loads of them.
(We did add logic to OnStart for creating an .optset file from all the parameter values to allow easy optimising starting with the same parameters as a backtest, but a button to do it would be better and for everyone. And thanks for changing the .optset & .cbotset keywords output by save back to starting with uppercase for backward compatibility, lowercase (of 5.0.39 or .40?) didn't load into v4 during the switchover so we had to write a conversion)
@martins