Lean
$LEAN_TAG$
|
Provides a base class for all fill models More...
Public Member Functions | |
void | SetPythonWrapper (FillModelPythonWrapper pythonWrapper) |
Used to set the FillModelPythonWrapper instance if any More... | |
virtual Fill | Fill (FillModelParameters parameters) |
Return an order event with the fill details More... | |
virtual List< OrderEvent > | ComboMarketFill (Order order, FillModelParameters parameters) |
Default combo market fill model for the base security class. Fills at the last traded price for each leg. More... | |
virtual List< OrderEvent > | ComboLimitFill (Order order, FillModelParameters parameters) |
Default combo limit fill model for the base security class. Fills at the sum of prices for the assets of every leg. More... | |
virtual List< OrderEvent > | ComboLegLimitFill (Order order, FillModelParameters parameters) |
Default combo limit fill model for the base security class. Fills at the limit price for each leg More... | |
virtual OrderEvent | MarketFill (Security asset, MarketOrder order) |
Default market fill model for the base security class. Fills at the last traded price. More... | |
virtual OrderEvent | StopMarketFill (Security asset, StopMarketOrder order) |
Default stop fill model implementation in base class security. (Stop Market Order Type) More... | |
virtual OrderEvent | TrailingStopFill (Security asset, TrailingStopOrder order) |
Default trailing stop fill model implementation in base class security. (Trailing Stop Order Type) More... | |
virtual OrderEvent | StopLimitFill (Security asset, StopLimitOrder order) |
Default stop limit fill model implementation in base class security. (Stop Limit Order Type) More... | |
virtual OrderEvent | LimitIfTouchedFill (Security asset, LimitIfTouchedOrder order) |
Default limit if touched fill model implementation in base class security. (Limit If Touched Order Type) More... | |
virtual OrderEvent | LimitFill (Security asset, LimitOrder order) |
Default limit order fill model in the base security class. More... | |
virtual OrderEvent | MarketOnOpenFill (Security asset, MarketOnOpenOrder order) |
Market on Open Fill Model. Return an order event with the fill details More... | |
virtual OrderEvent | MarketOnCloseFill (Security asset, MarketOnCloseOrder order) |
Market on Close Fill Model. Return an order event with the fill details More... | |
Protected Member Functions | |
virtual HashSet< Type > | GetSubscribedTypes (Security asset) |
Get data types the Security is subscribed to More... | |
virtual Prices | GetPricesCheckingPythonWrapper (Security asset, OrderDirection direction) |
This is required due to a limitation in PythonNet to resolved overriden methods. GetPrices More... | |
virtual Prices | GetPrices (Security asset, OrderDirection direction) |
Get the minimum and maximum price for this security in the last bar: More... | |
virtual bool | IsExchangeOpen (Security asset, bool isExtendedMarketHours) |
Determines if the exchange is open using the current time of the asset More... | |
Properties | |
FillModelParameters | Parameters [get, set] |
The parameters instance to be used by the different XxxxFill() implementations More... | |
FillModelPythonWrapper | PythonWrapper [get, set] |
This is required due to a limitation in PythonNet to resolved overriden methods. When Python calls a C# method that calls a method that's overriden in python it won't run the python implementation unless the call is performed through python too. More... | |
Provides a base class for all fill models
Definition at line 30 of file FillModel.cs.
void QuantConnect.Orders.Fills.FillModel.SetPythonWrapper | ( | FillModelPythonWrapper | pythonWrapper | ) |
Used to set the FillModelPythonWrapper instance if any
Definition at line 47 of file FillModel.cs.
|
virtual |
Return an order event with the fill details
parameters | A FillModelParameters object containing the security and order |
Implements QuantConnect.Orders.Fills.IFillModel.
Reimplemented in QuantConnect.Python.FillModelPythonWrapper.
Definition at line 57 of file FillModel.cs.
|
virtual |
Default combo market fill model for the base security class. Fills at the last traded price for each leg.
order | Order to fill |
parameters | Fill parameters for the order |
Reimplemented in QuantConnect.Python.FillModelPythonWrapper.
Definition at line 134 of file FillModel.cs.
|
virtual |
Default combo limit fill model for the base security class. Fills at the sum of prices for the assets of every leg.
order | Order to fill |
parameters | Fill parameters for the order |
Reimplemented in QuantConnect.Python.FillModelPythonWrapper.
Definition at line 159 of file FillModel.cs.
|
virtual |
Default combo limit fill model for the base security class. Fills at the limit price for each leg
order | Order to fill |
parameters | Fill parameters for the order |
Reimplemented in QuantConnect.Python.FillModelPythonWrapper.
Definition at line 242 of file FillModel.cs.
|
virtual |
Default market fill model for the base security class. Fills at the last traded price.
asset | Security asset we're filling |
order | Order packet to model |
Reimplemented in QuantConnect.Orders.Fills.EquityFillModel, QuantConnect.Python.FillModelPythonWrapper, and QuantConnect.Orders.Fills.FutureFillModel.
Definition at line 271 of file FillModel.cs.
|
virtual |
Default stop fill model implementation in base class security. (Stop Market Order Type)
asset | Security asset we're filling |
order | Order packet to model |
Reimplemented in QuantConnect.Orders.Fills.EquityFillModel, QuantConnect.Python.FillModelPythonWrapper, and QuantConnect.Orders.Fills.FutureFillModel.
Definition at line 332 of file FillModel.cs.
|
virtual |
Default trailing stop fill model implementation in base class security. (Trailing Stop Order Type)
asset | Security asset we're filling |
order | Order packet to model |
Reimplemented in QuantConnect.Python.FillModelPythonWrapper.
Definition at line 391 of file FillModel.cs.
|
virtual |
Default stop limit fill model implementation in base class security. (Stop Limit Order Type)
asset | Security asset we're filling |
order | Order packet to model |
There is no good way to model limit orders with OHLC because we never know whether the market has gapped past our fill price. We have to make the assumption of a fluid, high volume market.
Stop limit orders we also can't be sure of the order of the H - L values for the limit fill. The assumption was made the limit fill will be done with closing price of the bar after the stop has been triggered..
Reimplemented in QuantConnect.Orders.Fills.EquityFillModel, and QuantConnect.Python.FillModelPythonWrapper.
Definition at line 471 of file FillModel.cs.
|
virtual |
Default limit if touched fill model implementation in base class security. (Limit If Touched Order Type)
asset | |
order |
There is no good way to model limit orders with OHLC because we never know whether the market has gapped past our fill price. We have to make the assumption of a fluid, high volume market.
With Limit if Touched orders, whether or not a trigger is surpassed is determined by the high (low) of the previous tradebar when making a sell (buy) request. Following the behaviour of StopLimitFill, current quote information is used when determining fill parameters (e.g., price, quantity) as the tradebar containing the incoming data is not yet consolidated. This conservative approach, however, can lead to trades not occuring as would be expected when compared to future consolidated data.
Reimplemented in QuantConnect.Python.FillModelPythonWrapper, and QuantConnect.Orders.Fills.EquityFillModel.
Definition at line 561 of file FillModel.cs.
|
virtual |
Default limit order fill model in the base security class.
asset | Security asset we're filling |
order | Order packet to model |
Reimplemented in QuantConnect.Orders.Fills.EquityFillModel, and QuantConnect.Python.FillModelPythonWrapper.
Definition at line 655 of file FillModel.cs.
|
virtual |
Market on Open Fill Model. Return an order event with the fill details
asset | Asset we're trading with this order |
order | Order to be filled |
Reimplemented in QuantConnect.Orders.Fills.EquityFillModel, and QuantConnect.Python.FillModelPythonWrapper.
Definition at line 724 of file FillModel.cs.
|
virtual |
Market on Close Fill Model. Return an order event with the fill details
asset | Asset we're trading with this order |
order | Order to be filled |
Reimplemented in QuantConnect.Orders.Fills.EquityFillModel, and QuantConnect.Python.FillModelPythonWrapper.
Definition at line 785 of file FillModel.cs.
|
protectedvirtual |
Get data types the Security is subscribed to
asset | Security which has subscribed data types |
Reimplemented in QuantConnect.Orders.Fills.EquityFillModel.
Definition at line 953 of file FillModel.cs.
|
protectedvirtual |
This is required due to a limitation in PythonNet to resolved overriden methods. GetPrices
Reimplemented in QuantConnect.Orders.Fills.EquityFillModel.
Definition at line 1014 of file FillModel.cs.
|
protectedvirtual |
Get the minimum and maximum price for this security in the last bar:
asset | Security asset we're checking |
direction | The order direction, decides whether to pick bid or ask |
Reimplemented in QuantConnect.Orders.Fills.EquityFillModel, QuantConnect.Python.FillModelPythonWrapper, and QuantConnect.Orders.Fills.LatestPriceFillModel.
Definition at line 1028 of file FillModel.cs.
|
protectedvirtual |
Determines if the exchange is open using the current time of the asset
Definition at line 1086 of file FillModel.cs.
|
getsetprotected |
The parameters instance to be used by the different XxxxFill() implementations
Definition at line 35 of file FillModel.cs.
|
getsetprotected |
This is required due to a limitation in PythonNet to resolved overriden methods. When Python calls a C# method that calls a method that's overriden in python it won't run the python implementation unless the call is performed through python too.
Definition at line 42 of file FillModel.cs.