Lean  $LEAN_TAG$
QuantConnect.Optimizer.Objectives.Constraint Class Reference

A backtest optimization constraint. Allows specifying statistical constraints for the optimization, eg. a backtest can't have a DrawDown less than 10% More...

Inheritance diagram for QuantConnect.Optimizer.Objectives.Constraint:
[legend]

Public Member Functions

 Constraint ()
 Empty Constraint constructor More...
 
 Constraint (string target, ComparisonOperatorTypes @operator, decimal? targetValue)
 Creates a new instance More...
 
bool IsMet (string jsonBacktestResult)
 Asserts the constraint is met More...
 
override string ToString ()
 Pretty representation of a constraint More...
 

Properties

ComparisonOperatorTypes Operator [get, set]
 The target comparison operation, eg. 'Greater' More...
 
- Properties inherited from QuantConnect.Optimizer.Objectives.Objective
string?? Target [get, set]
 Target; property of json file we want to track More...
 
decimal? TargetValue [get, set]
 Target value More...
 
decimal? OldTargetValue [get, set]
 Target value More...
 

Additional Inherited Members

- Protected Member Functions inherited from QuantConnect.Optimizer.Objectives.Objective
 Objective ()
 Creates a new instance of Objective class More...
 
 Objective (string target, decimal? targetValue)
 Creates a new instance More...
 

Detailed Description

A backtest optimization constraint. Allows specifying statistical constraints for the optimization, eg. a backtest can't have a DrawDown less than 10%

Definition at line 29 of file Constraint.cs.

Constructor & Destructor Documentation

◆ Constraint() [1/2]

QuantConnect.Optimizer.Objectives.Constraint.Constraint ( )

Empty Constraint constructor

Definition at line 40 of file Constraint.cs.

◆ Constraint() [2/2]

QuantConnect.Optimizer.Objectives.Constraint.Constraint ( string  target,
ComparisonOperatorTypes operator,
decimal?  targetValue 
)

Creates a new instance

Definition at line 48 of file Constraint.cs.

Member Function Documentation

◆ IsMet()

bool QuantConnect.Optimizer.Objectives.Constraint.IsMet ( string  jsonBacktestResult)

Asserts the constraint is met

Definition at line 61 of file Constraint.cs.

◆ ToString()

override string QuantConnect.Optimizer.Objectives.Constraint.ToString ( )

Pretty representation of a constraint

Definition at line 82 of file Constraint.cs.

Property Documentation

◆ Operator

ComparisonOperatorTypes QuantConnect.Optimizer.Objectives.Constraint.Operator
getset

The target comparison operation, eg. 'Greater'

Definition at line 35 of file Constraint.cs.


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