Difference between revisions of "SetCustomFitnessValue"
(Created page with " Category:Strategy Performance") |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | Sets a value of the custom criterion that is to be used for [[:Category:Optimization|optimization]]. | ||
+ | |||
+ | == Usage == | ||
+ | <syntaxhighlight>SetCustomFitnessValue (Criterion);</syntaxhighlight>''' | ||
+ | Where: ''<code>(Criterion)</code>'' - an expression specifying a custom criterion value. | ||
+ | == Note == | ||
+ | * 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. | ||
+ | |||
+ | == Example == | ||
+ | Set the gross profit to be a custom criterion for genetic optimization | ||
+ | |||
+ | <syntaxhighlight>SetCustomFitnessValue (GrossProfit);</syntaxhighlight> | ||
+ | |||
+ | Set the formula to be a custom criterion for genetic optimization | ||
+ | |||
+ | <syntaxhighlight>SetCustomFitnessValue (TotalTrades / (GrossLoss + GrossProfit));</syntaxhighlight> | ||
[[Category:Strategy Performance]] | [[Category:Strategy Performance]] |
Latest revision as of 11:38, 3 October 2018
Sets a value of the custom criterion that is to be used for optimization.
Usage
SetCustomFitnessValue (Criterion);
Where: (Criterion)
- an expression specifying a custom criterion value.
Note
- 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.
Example
Set the gross profit to be a custom criterion for genetic optimization
SetCustomFitnessValue (GrossProfit);
Set the formula to be a custom criterion for genetic optimization
SetCustomFitnessValue (TotalTrades / (GrossLoss + GrossProfit));