Lean  $LEAN_TAG$
QuantConnect.Algorithm.Framework.Execution.StandardDeviationExecutionModel Class Reference

Execution model that submits orders while the current market prices is at least the configured number of standard deviations away from the mean in the favorable direction (below/above for buy/sell respectively) More...

Inheritance diagram for QuantConnect.Algorithm.Framework.Execution.StandardDeviationExecutionModel:
[legend]

Classes

class  SymbolData
 Symbol Data for this Execution Model More...
 

Public Member Functions

 StandardDeviationExecutionModel (int period=60, decimal deviations=2m, Resolution resolution=Resolution.Minute)
 Initializes a new instance of the StandardDeviationExecutionModel class More...
 
override void Execute (QCAlgorithm algorithm, IPortfolioTarget[] targets)
 Executes market orders if the standard deviation of price is more than the configured number of deviations in the favorable direction. More...
 
override void OnSecuritiesChanged (QCAlgorithm algorithm, SecurityChanges changes)
 Event fired each time the we add/remove securities from the data feed More...
 

Protected Member Functions

virtual bool PriceIsFavorable (SymbolData data, decimal unorderedQuantity)
 Determines if the current price is more than the configured number of standard deviations away from the mean in the favorable direction. More...
 
virtual bool IsSafeToRemove (QCAlgorithm algorithm, Symbol symbol)
 Determines if it's safe to remove the associated symbol data More...
 

Properties

decimal MaximumOrderValue = 20 * 1000 [get, set]
 Gets or sets the maximum order value in units of the account currency. This defaults to $20,000. For example, if purchasing a stock with a price of $100, then the maximum order size would be 200 shares. More...
 

Detailed Description

Execution model that submits orders while the current market prices is at least the configured number of standard deviations away from the mean in the favorable direction (below/above for buy/sell respectively)

Definition at line 32 of file StandardDeviationExecutionModel.cs.

Constructor & Destructor Documentation

◆ StandardDeviationExecutionModel()

QuantConnect.Algorithm.Framework.Execution.StandardDeviationExecutionModel.StandardDeviationExecutionModel ( int  period = 60,
decimal  deviations = 2m,
Resolution  resolution = Resolution.Minute 
)

Initializes a new instance of the StandardDeviationExecutionModel class

Parameters
periodPeriod of the standard deviation indicator
deviationsThe number of deviations away from the mean before submitting an order
resolutionThe resolution of the STD and SMA indicators

Definition at line 53 of file StandardDeviationExecutionModel.cs.

Member Function Documentation

◆ Execute()

override void QuantConnect.Algorithm.Framework.Execution.StandardDeviationExecutionModel.Execute ( QCAlgorithm  algorithm,
IPortfolioTarget[]  targets 
)
virtual

Executes market orders if the standard deviation of price is more than the configured number of deviations in the favorable direction.

Parameters
algorithmThe algorithm instance
targetsThe portfolio targets

Reimplemented from QuantConnect.Algorithm.Framework.Execution.ExecutionModel.

Definition at line 72 of file StandardDeviationExecutionModel.cs.

Here is the call graph for this function:

◆ OnSecuritiesChanged()

override void QuantConnect.Algorithm.Framework.Execution.StandardDeviationExecutionModel.OnSecuritiesChanged ( QCAlgorithm  algorithm,
SecurityChanges  changes 
)
virtual

Event fired each time the we add/remove securities from the data feed

Parameters
algorithmThe algorithm instance that experienced the change in securities
changesThe security additions and removals from the algorithm

Reimplemented from QuantConnect.Algorithm.Framework.Execution.ExecutionModel.

Definition at line 115 of file StandardDeviationExecutionModel.cs.

Here is the call graph for this function:

◆ PriceIsFavorable()

virtual bool QuantConnect.Algorithm.Framework.Execution.StandardDeviationExecutionModel.PriceIsFavorable ( SymbolData  data,
decimal  unorderedQuantity 
)
protectedvirtual

Determines if the current price is more than the configured number of standard deviations away from the mean in the favorable direction.

Definition at line 145 of file StandardDeviationExecutionModel.cs.

Here is the caller graph for this function:

◆ IsSafeToRemove()

virtual bool QuantConnect.Algorithm.Framework.Execution.StandardDeviationExecutionModel.IsSafeToRemove ( QCAlgorithm  algorithm,
Symbol  symbol 
)
protectedvirtual

Determines if it's safe to remove the associated symbol data

Definition at line 156 of file StandardDeviationExecutionModel.cs.

Here is the caller graph for this function:

Property Documentation

◆ MaximumOrderValue

decimal QuantConnect.Algorithm.Framework.Execution.StandardDeviationExecutionModel.MaximumOrderValue = 20 * 1000
getset

Gets or sets the maximum order value in units of the account currency. This defaults to $20,000. For example, if purchasing a stock with a price of $100, then the maximum order size would be 200 shares.

Definition at line 45 of file StandardDeviationExecutionModel.cs.


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