OnOptimize()

View as Markdown

Definition

This method must be overridden in order to optimize a strategy. This method is called once per optimization run (not once per iteration).

Method Return Value

This method does not return a value.

Syntax

You must override the method in your Optimizer with the following syntax.

protected override void OnOptimize() \{ \}

Examples

1protected override void OnOptimize()
2{
3 // If there is no optimization objective, return
4 if (Strategies[0].OptimizationParameters.Count == 0)
5 return;
6
7 // Optimizer logic
8}