Training method; affects the way how parameters and factors are generated in the
The following flags can be set :
||Ascent optimization (default). Evaluates the effect
of any parameter on the strategy separately. Walks through all
parameter ranges and seeks for 'plateaus' in the parameter space, while
ignoring single peaks. This is normally the best algorithm for a robust strategy,
except in special cases with many mutually dependent parameters.
||Brute force optimization (Zorro S required). Evaluates all
parameter combinations and selects the most profitable combination
that is not a single peak. Can take a long time when many parameters are
optimized or when parameter ranges have many steps. Useful when parameters can
affect each other in complex ways. Brute force optimization will likely overfit the strategy, so out-of-sample or walk-forward testing
||Genetic optimization (Zorro S required). A population of parameter combinations is evolved toward the best
solution in an iterative process. In each iteration, the best combinations
are stochastically selected, and their parameters are then pair-wise
recombined and randomly mutated to form a new generation. This algorithm is
useful when a large number of parameters per component must be optimized or
when parameters affect each other in complex ways. It will likely overfit the strategy, so out-of-sample or walk-forward testing
||Optimize using trade sizes (Lots). Large trades get more weight.
Set this flag when the trade volume matters, f.i. for portfolio systems that
calculate their capital distribution by script. Otherwise trade sizes are ignored in the training process.
||Optimize ignoring phantom trades. Otherwise phantom trades are
treated as normal trades in the training process.
||Optimize toward the highest single peak in the
parameter space, rather than toward hills or plateaus. This can generate
unstable strategies and is for special purposes only. For instance when
optimizing not a parameter range, but a set of different algorithms or
||Generate individual OptimalF
factor files for all WFO cycles, instead of a single file for the whole
simulation. This produces low-quality factors due to less trades, but
prevents backtest bias.
factor files not with the OptimalF algorithm, but by
script with a user-defined algorithm. For this, set OptimalF, OptimalFLong,
OptimalFShort to a script calculated value in the
FACTORS training run (if(is(FACTORS)) ...).
Number of parameters to optimize in the current
loop in training mode (read/only).
Current parameter or current generation, runs from 1 to NumParameters
in Ascent mode, or from 1 to Generations in
Genetic mode (read/only).
Number of the optimize cycle, starting with 1 (read/only).
Set this to 0 for early aborting the optimization.
Maximum population size for the genetic algorithm (default = 50). Any parameter
combination is an individual of the population. The population
size reduces automatically when the algorithm converges and only the fittest
individuals and the mutants remain.
Maximum number of generations for the genetic algorithm (default = 50).
Evolution terminates when this number is reached or when the overall fitness does not increase for 10
Average number of mutants in any generation, in percent (default =
5%). More mutants can find more parameter combinations, but let the
algorithm converge slower.
Average number of parameter recombinations in any generation, in
percent (default = 80%).
- Training methods for rules generation are set up with the
- Brute force and genetic optimizations do not produce parameter charts.
It is recommended to do first a training run with the Ascent algorithm for
determining the parameter dependence of a strategy.
- Percent steps (4th parameter of the optimize function)
are replaced by 10 equal steps for brute force and genetic optimization.
- In genetic optimization, parameter combinations that were already
evaluated in the previous generation are not evaluated again and are skipped in the log.
This lets the algorithm run faster with higher generations.
- Genetic optimization is also possible with the free Zorro version using
the Z Optimizer tool from the Download page.
optimize, advise, OptimalF,
TrainCycle, setf, resf
► latest version online