Lean
$LEAN_TAG$
|
Execution model that submits orders while the current spread is in desirably tight extent. More...
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... | |
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.
QuantConnect.Algorithm.Framework.Execution.SpreadExecutionModel.SpreadExecutionModel | ( | decimal | acceptingSpreadPercent = 0.005m | ) |
Initializes a new instance of the SpreadExecutionModel class
acceptingSpreadPercent | Maximum spread accepted comparing to current price in percentage. |
Definition at line 37 of file SpreadExecutionModel.cs.
|
virtual |
Submit orders for the specified portfolio targets if the spread is tighter/equal to preset level
algorithm | The algorithm instance |
targets | The portfolio targets to be ordered |
Reimplemented from QuantConnect.Algorithm.Framework.Execution.ExecutionModel.
Definition at line 48 of file SpreadExecutionModel.cs.
|
protectedvirtual |
Determines if the current spread is equal or tighter than preset level
Definition at line 82 of file SpreadExecutionModel.cs.