ASCENT |
Ascent parameter optimization and parameter chart export. Evaluates the effect of any parameter on the strategy separately. Starts with the first parameter and applies the results of already optimized parameters and the defaults of the rest. 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 highly irregular parameter spaces or with interdependent parameters. |

BRUTE |
Brute force parameter optimization and parameter
spreadheet export (Zorro S required). Evaluates all
parameter combinations, exports them to a *par.csv
file in the Log folder, 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 affect each other in complex ways,
or when it is necessary to evaluate results from any parameter combination. Brute force optimization
tends to overfit the strategy, so out-of-sample
testing or walk-forward optimization is mandatory. |

GENETIC |
Genetic parameter 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 - 5 or more 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 is mandatory. |

TRADES |
Use trade sizes (Lots or Margin) determined by the script. Large trades get then more weight in the optimization process. Set this flag in special cases when the trade volume matters, f.i. for optimizing the money management or for portfolio systems that calculate their capital distribution by script. Otherwise trade sizes are ignored in the training process. |

PHANTOM |
Exclude phantom trades. Otherwise phantom trades are treated as normal trades in the training process. |

PEAK |
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 different assets. |

ALLCYCLES |
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. |

SETFACTORS |
Don't calculate OptimalF factors.
For generating them with a user-defined algorithm, set OptimalF, OptimalFLong,
OptimalFShort to a script calculated value in the
FACCYCLE training run (if(is(FACCYCLE)) ...). |

**TrainMode**must be set up before the first optimize call.- Training methods for machine learning or rules generating are set up with the advise function.
- Alternative optimization algorithms from external libraries or individual optimization targets can be set up with the parameters and objective functions.
- Parameter charts are only produced by
**Ascent**optimization when LOGFILE is set. It is recommended to do first an Ascent training for determining the parameter dependence of a strategy. Afterwards the final optimization can done with a different algorithm if requried. - Parameter spreadsheets are exported by
**Brute Force**optimization. They can be used for generating 2-d parameter heatmaps or 3-d parameter surfaces with Excel or other programs. - 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.
- When parameters are trained several times by using
**NumTrainCycles**, each time the start values are taken from the last optimization cycle in Ascent mode. This sometimes improves the result, but requires a longer time for the training process and increases the likeliness of overfitting. To prevent overfitting, use not more than 2 subsequent parameter training cycles.

setf(TrainMode,TRADES+PEAK);

► latest version online