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

Execution model that submits orders while the current spread is in desirably tight extent. More...

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

Public Member Functions

 SpreadExecutionModel (decimal acceptingSpreadPercent=0.005m)
 Initializes a new instance of the SpreadExecutionModel class More...
 
override void Execute (QCAlgorithm algorithm, IPortfolioTarget[] targets)
 Submit orders for the specified portfolio targets if the spread is tighter/equal to preset level More...
 
- Public Member Functions inherited from QuantConnect.Algorithm.Framework.Execution.ExecutionModel
virtual 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 (Security security)
 Determines if the current spread is equal or tighter than preset level More...
 

Detailed Description

Execution model that submits orders while the current spread is in desirably tight extent.

Note this execution model will not work using Resolution.Daily since Exchange.ExchangeOpen will be false, suggested resolution is Resolution.Minute

Definition at line 28 of file SpreadExecutionModel.cs.

Constructor & Destructor Documentation

◆ SpreadExecutionModel()

QuantConnect.Algorithm.Framework.Execution.SpreadExecutionModel.SpreadExecutionModel ( decimal  acceptingSpreadPercent = 0.005m)

Initializes a new instance of the SpreadExecutionModel class

Parameters
acceptingSpreadPercentMaximum spread accepted comparing to current price in percentage.

Definition at line 37 of file SpreadExecutionModel.cs.

Member Function Documentation

◆ Execute()

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

Submit orders for the specified portfolio targets if the spread is tighter/equal to preset level

Parameters
algorithmThe algorithm instance
targetsThe portfolio targets to be ordered

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

Definition at line 48 of file SpreadExecutionModel.cs.

Here is the call graph for this function:

◆ PriceIsFavorable()

virtual bool QuantConnect.Algorithm.Framework.Execution.SpreadExecutionModel.PriceIsFavorable ( Security  security)
protectedvirtual

Determines if the current spread is equal or tighter than preset level

Definition at line 82 of file SpreadExecutionModel.cs.

Here is the caller graph for this function:

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