Lean  $LEAN_TAG$
QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy Class Referenceabstract

Base class for any optimization built on top of brute force optimization method More...

Inheritance diagram for QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy:
[legend]

Public Member Functions

virtual void Initialize (Target target, IReadOnlyList< Constraint > constraints, HashSet< OptimizationParameter > parameters, OptimizationStrategySettings settings)
 Initializes the strategy using generator, extremum settings and optimization parameters More...
 
abstract void PushNewResults (OptimizationResult result)
 Checks whether new lean compute job better than previous and run new iteration if necessary. More...
 
int GetTotalBacktestEstimate ()
 Calculate number of parameter sets within grid More...
 

Protected Member Functions

virtual void OnNewParameterSet (ParameterSet parameterSet)
 Handles new parameter set More...
 
virtual void ProcessNewResult (OptimizationResult result)
 
IEnumerable< ParameterSetStep (HashSet< OptimizationParameter > args)
 Enumerate all possible arrangements More...
 

Properties

bool Initialized [get, set]
 Indicates was strategy initialized or no More...
 
HashSet< OptimizationParameterOptimizationParameters [get, set]
 Optimization parameters More...
 
Target Target [get, set]
 Optimization target, i.e. maximize or minimize More...
 
IEnumerable< ConstraintConstraints [get, set]
 Optimization constraints; if it doesn't comply just drop the backtest More...
 
OptimizationResult Solution [get, protected set]
 Keep the best found solution - lean computed job result and corresponding parameter set More...
 
OptimizationStrategySettings Settings [get, protected set]
 Advanced strategy settings More...
 
- Properties inherited from QuantConnect.Optimizer.Strategies.IOptimizationStrategy
OptimizationResult Solution [get]
 Best found solution, its value and parameter set More...
 

Events

EventHandler< ParameterSetNewParameterSet
 Fires when new parameter set is generated More...
 
- Events inherited from QuantConnect.Optimizer.Strategies.IOptimizationStrategy
EventHandler< ParameterSetNewParameterSet
 Fires when new parameter set is retrieved More...
 

Detailed Description

Base class for any optimization built on top of brute force optimization method

Definition at line 28 of file StepBaseOptimizationStrategy.cs.

Member Function Documentation

◆ Initialize()

virtual void QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy.Initialize ( Target  target,
IReadOnlyList< Constraint constraints,
HashSet< OptimizationParameter parameters,
OptimizationStrategySettings  settings 
)
virtual

Initializes the strategy using generator, extremum settings and optimization parameters

Parameters
targetThe optimization target
constraintsThe optimization constraints to apply on backtest results
parametersOptimization parameters
settingsOptimization strategy settings

Implements QuantConnect.Optimizer.Strategies.IOptimizationStrategy.

Reimplemented in QuantConnect.Optimizer.Strategies.EulerSearchOptimizationStrategy.

Definition at line 74 of file StepBaseOptimizationStrategy.cs.

◆ PushNewResults()

abstract void QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy.PushNewResults ( OptimizationResult  result)
pure virtual

Checks whether new lean compute job better than previous and run new iteration if necessary.

Parameters
resultLean compute job result and corresponding parameter set

Implements QuantConnect.Optimizer.Strategies.IOptimizationStrategy.

Implemented in QuantConnect.Optimizer.Strategies.EulerSearchOptimizationStrategy, and QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy.

◆ GetTotalBacktestEstimate()

int QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy.GetTotalBacktestEstimate ( )

Calculate number of parameter sets within grid

Returns
Number of parameter sets for given optimization parameters

Implements QuantConnect.Optimizer.Strategies.IOptimizationStrategy.

Definition at line 113 of file StepBaseOptimizationStrategy.cs.

◆ OnNewParameterSet()

virtual void QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy.OnNewParameterSet ( ParameterSet  parameterSet)
protectedvirtual

Handles new parameter set

Parameters
parameterSetNew parameter set

Reimplemented in QuantConnect.Optimizer.Strategies.EulerSearchOptimizationStrategy.

Definition at line 152 of file StepBaseOptimizationStrategy.cs.

Here is the caller graph for this function:

◆ Step()

IEnumerable<ParameterSet> QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy.Step ( HashSet< OptimizationParameter args)
protected

Enumerate all possible arrangements

Parameters
args
Returns
Collection of possible combinations for given optimization parameters settings

Definition at line 178 of file StepBaseOptimizationStrategy.cs.

Here is the caller graph for this function:

Property Documentation

◆ Initialized

bool QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy.Initialized
getsetprotected

Indicates was strategy initialized or no

Definition at line 35 of file StepBaseOptimizationStrategy.cs.

◆ OptimizationParameters

HashSet<OptimizationParameter> QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy.OptimizationParameters
getsetprotected

Optimization parameters

Definition at line 40 of file StepBaseOptimizationStrategy.cs.

◆ Target

Target QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy.Target
getsetprotected

Optimization target, i.e. maximize or minimize

Definition at line 45 of file StepBaseOptimizationStrategy.cs.

◆ Constraints

IEnumerable<Constraint> QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy.Constraints
getsetprotected

Optimization constraints; if it doesn't comply just drop the backtest

Definition at line 50 of file StepBaseOptimizationStrategy.cs.

◆ Solution

OptimizationResult QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy.Solution
getprotected set

Keep the best found solution - lean computed job result and corresponding parameter set

Definition at line 55 of file StepBaseOptimizationStrategy.cs.

◆ Settings

OptimizationStrategySettings QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy.Settings
getprotected set

Advanced strategy settings

Definition at line 60 of file StepBaseOptimizationStrategy.cs.

Event Documentation

◆ NewParameterSet

EventHandler<ParameterSet> QuantConnect.Optimizer.Strategies.StepBaseOptimizationStrategy.NewParameterSet

Fires when new parameter set is generated

Definition at line 65 of file StepBaseOptimizationStrategy.cs.


The documentation for this class was generated from the following file: