Sets a value of the custom criterion that is to be used for optimization.
(Criterion) - an expression specifying a custom criterion value.
- This function can be used only in signals
- To use the custom fitness value:
- Open Optimization Settings window;
- Select Custom Fitness Value from the dropdown list in Optimize by: section.
- The SetCustomFitnessValue can be used both in Genetic Optimizations and Exhaustive Optimizations.
Set the gross profit to be a custom criterion for genetic optimization
Set the formula to be a custom criterion for genetic optimization
SetCustomFitnessValue (TotalTrades / (GrossLoss + GrossProfit));