Lean  $LEAN_TAG$
QuantConnect.Python.FillModelPythonWrapper Class Reference

Wraps a PyObject object that represents a model that simulates order fill events More...

Inheritance diagram for QuantConnect.Python.FillModelPythonWrapper:
[legend]

Public Member Functions

 FillModelPythonWrapper (PyObject model)
 Constructor for initialising the FillModelPythonWrapper class with wrapped PyObject object More...
 
override Fill Fill (FillModelParameters parameters)
 Return an order event with the fill details More...
 
override OrderEvent LimitFill (Security asset, LimitOrder order)
 Limit Fill Model. Return an order event with the fill details. More...
 
override OrderEvent LimitIfTouchedFill (Security asset, LimitIfTouchedOrder order)
 Limit if Touched Fill Model. Return an order event with the fill details. More...
 
override OrderEvent MarketFill (Security asset, MarketOrder order)
 Model the slippage on a market order: fixed percentage of order price More...
 
override OrderEvent MarketOnCloseFill (Security asset, MarketOnCloseOrder order)
 Market on Close Fill Model. Return an order event with the fill details More...
 
override OrderEvent MarketOnOpenFill (Security asset, MarketOnOpenOrder order)
 Market on Open Fill Model. Return an order event with the fill details More...
 
override OrderEvent StopLimitFill (Security asset, StopLimitOrder order)
 Stop Limit Fill Model. Return an order event with the fill details. More...
 
override OrderEvent StopMarketFill (Security asset, StopMarketOrder order)
 Stop Market Fill Model. Return an order event with the fill details. More...
 
override OrderEvent TrailingStopFill (Security asset, TrailingStopOrder order)
 Trailing Stop Fill Model. Return an order event with the fill details. More...
 
override List< OrderEventComboMarketFill (Order order, FillModelParameters parameters)
 Default combo market fill model for the base security class. Fills at the last traded price for each leg. More...
 
override List< OrderEventComboLimitFill (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...
 
override List< OrderEventComboLegLimitFill (Order order, FillModelParameters parameters)
 Default combo limit fill model for the base security class. Fills at the limit price for each leg More...
 
- Public Member Functions inherited from QuantConnect.Orders.Fills.FillModel
void SetPythonWrapper (FillModelPythonWrapper pythonWrapper)
 Used to set the FillModelPythonWrapper instance if any More...
 

Protected Member Functions

override Prices GetPrices (Security asset, OrderDirection direction)
 Get the minimum and maximum price for this security in the last bar: More...
 
- Protected Member Functions inherited from QuantConnect.Orders.Fills.FillModel
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 bool IsExchangeOpen (Security asset, bool isExtendedMarketHours)
 Determines if the exchange is open using the current time of the asset More...
 

Additional Inherited Members

- Protected Attributes inherited from QuantConnect.Orders.Fills.FillModel
FillModelPythonWrapper PythonWrapper
 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...
 
- Properties inherited from QuantConnect.Orders.Fills.FillModel
FillModelParameters Parameters [get, set]
 The parameters instance to be used by the different XxxxFill() implementations More...
 

Detailed Description

Wraps a PyObject object that represents a model that simulates order fill events

Definition at line 27 of file FillModelPythonWrapper.cs.

Constructor & Destructor Documentation

◆ FillModelPythonWrapper()

QuantConnect.Python.FillModelPythonWrapper.FillModelPythonWrapper ( PyObject  model)

Constructor for initialising the FillModelPythonWrapper class with wrapped PyObject object

Parameters
modelRepresents a model that simulates order fill events

Definition at line 35 of file FillModelPythonWrapper.cs.

Here is the call graph for this function:

Member Function Documentation

◆ Fill()

override Fill QuantConnect.Python.FillModelPythonWrapper.Fill ( FillModelParameters  parameters)
virtual

Return an order event with the fill details

Parameters
parametersA parameters object containing the security and order
Returns
Order fill information detailing the average price and quantity filled.

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 49 of file FillModelPythonWrapper.cs.

◆ LimitFill()

override OrderEvent QuantConnect.Python.FillModelPythonWrapper.LimitFill ( Security  asset,
LimitOrder  order 
)
virtual

Limit Fill Model. Return an order event with the fill details.

Parameters
assetStock Object to use to help model limit fill
orderOrder to fill. Alter the values directly if filled.
Returns
Order fill information detailing the average price and quantity filled.

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 61 of file FillModelPythonWrapper.cs.

◆ LimitIfTouchedFill()

override OrderEvent QuantConnect.Python.FillModelPythonWrapper.LimitIfTouchedFill ( Security  asset,
LimitIfTouchedOrder  order 
)
virtual

Limit if Touched Fill Model. Return an order event with the fill details.

Parameters
assetAsset we're trading this order
orderLimitIfTouchedOrder Order to Check, return filled if true
Returns
Order fill information detailing the average price and quantity filled.

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 72 of file FillModelPythonWrapper.cs.

◆ MarketFill()

override OrderEvent QuantConnect.Python.FillModelPythonWrapper.MarketFill ( Security  asset,
MarketOrder  order 
)
virtual

Model the slippage on a market order: fixed percentage of order price

Parameters
assetAsset we're trading this order
orderOrder to update
Returns
Order fill information detailing the average price and quantity filled.

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 83 of file FillModelPythonWrapper.cs.

◆ MarketOnCloseFill()

override OrderEvent QuantConnect.Python.FillModelPythonWrapper.MarketOnCloseFill ( Security  asset,
MarketOnCloseOrder  order 
)
virtual

Market on Close Fill Model. Return an order event with the fill details

Parameters
assetAsset we're trading with this order
orderOrder to be filled
Returns
Order fill information detailing the average price and quantity filled.

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 94 of file FillModelPythonWrapper.cs.

◆ MarketOnOpenFill()

override OrderEvent QuantConnect.Python.FillModelPythonWrapper.MarketOnOpenFill ( Security  asset,
MarketOnOpenOrder  order 
)
virtual

Market on Open Fill Model. Return an order event with the fill details

Parameters
assetAsset we're trading with this order
orderOrder to be filled
Returns
Order fill information detailing the average price and quantity filled.

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 105 of file FillModelPythonWrapper.cs.

◆ StopLimitFill()

override OrderEvent QuantConnect.Python.FillModelPythonWrapper.StopLimitFill ( Security  asset,
StopLimitOrder  order 
)
virtual

Stop Limit Fill Model. Return an order event with the fill details.

Parameters
assetAsset we're trading this order
orderStop Limit Order to Check, return filled if true
Returns
Order fill information detailing the average price and quantity filled.

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 116 of file FillModelPythonWrapper.cs.

◆ StopMarketFill()

override OrderEvent QuantConnect.Python.FillModelPythonWrapper.StopMarketFill ( Security  asset,
StopMarketOrder  order 
)
virtual

Stop Market Fill Model. Return an order event with the fill details.

Parameters
assetAsset we're trading this order
orderTrailing Stop Order to check, return filled if true
Returns
Order fill information detailing the average price and quantity filled.

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 127 of file FillModelPythonWrapper.cs.

◆ TrailingStopFill()

override OrderEvent QuantConnect.Python.FillModelPythonWrapper.TrailingStopFill ( Security  asset,
TrailingStopOrder  order 
)
virtual

Trailing Stop Fill Model. Return an order event with the fill details.

Parameters
assetAsset we're trading this order
orderStop Order to Check, return filled if true
Returns
Order fill information detailing the average price and quantity filled.

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 138 of file FillModelPythonWrapper.cs.

◆ ComboMarketFill()

override List<OrderEvent> QuantConnect.Python.FillModelPythonWrapper.ComboMarketFill ( Order  order,
FillModelParameters  parameters 
)
virtual

Default combo market fill model for the base security class. Fills at the last traded price for each leg.

Parameters
orderOrder to fill
parametersFill parameters for the order
Returns
Order fill information detailing the average price and quantity filled for each leg. If any of the fills fails, none of the orders will be filled and the returned list will be empty

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 149 of file FillModelPythonWrapper.cs.

◆ ComboLimitFill()

override List<OrderEvent> QuantConnect.Python.FillModelPythonWrapper.ComboLimitFill ( Order  order,
FillModelParameters  parameters 
)
virtual

Default combo limit fill model for the base security class. Fills at the sum of prices for the assets of every leg.

Parameters
orderOrder to fill
parametersFill parameters for the order
Returns
Order fill information detailing the average price and quantity filled for each leg. If any of the fills fails, none of the orders will be filled and the returned list will be empty

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 160 of file FillModelPythonWrapper.cs.

◆ ComboLegLimitFill()

override List<OrderEvent> QuantConnect.Python.FillModelPythonWrapper.ComboLegLimitFill ( Order  order,
FillModelParameters  parameters 
)
virtual

Default combo limit fill model for the base security class. Fills at the limit price for each leg

Parameters
orderOrder to fill
parametersFill parameters for the order
Returns
Order fill information detailing the average price and quantity filled for each leg. If any of the fills fails, none of the orders will be filled and the returned list will be empty

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 171 of file FillModelPythonWrapper.cs.

◆ GetPrices()

override Prices QuantConnect.Python.FillModelPythonWrapper.GetPrices ( Security  asset,
OrderDirection  direction 
)
protectedvirtual

Get the minimum and maximum price for this security in the last bar:

Parameters
assetSecurity asset we're checking
directionThe order direction, decides whether to pick bid or ask

Reimplemented from QuantConnect.Orders.Fills.FillModel.

Definition at line 181 of file FillModelPythonWrapper.cs.


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