Difference between revisions of "SetCustomFitnessValue"

From MultiCharts
Jump to navigation Jump to search
(Created page with " Category:Strategy Performance")
 
Line 1: Line 1:
 +
Sets a value of the custom criterion that is to be used for 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 genetic algorithm properties window;
 +
*# Set the number of simulations by changing the inputs range;
 +
*# Select the '''Algorithm-Specified Properties''' tab
 +
*# Select the '''Custom Fitness Value''' from the list under the '''Standard Criteria''' section
 +
 +
== 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]]

Revision as of 11:50, 24 February 2012

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:
    1. Open genetic algorithm properties window;
    2. Set the number of simulations by changing the inputs range;
    3. Select the Algorithm-Specified Properties tab
    4. Select the Custom Fitness Value from the list under the Standard Criteria section

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));