Lean  $LEAN_TAG$
QuantConnect.Brokerages.IBrokerageModel Interface Reference

Models brokerage transactions, fees, and order More...

Inheritance diagram for QuantConnect.Brokerages.IBrokerageModel:
[legend]

Public Member Functions

bool CanSubmitOrder (Security security, Order order, out BrokerageMessageEvent message)
 Returns true if the brokerage could accept this order. This takes into account order type, security type, and order size limits. More...
 
bool CanUpdateOrder (Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)
 Returns true if the brokerage would allow updating the order as specified by the request More...
 
bool CanExecuteOrder (Security security, Order order)
 Returns true if the brokerage would be able to execute this order at this time assuming market prices are sufficient for the fill to take place. This is used to emulate the brokerage fills in backtesting and paper trading. For example some brokerages may not perform executions during extended market hours. This is not intended to be checking whether or not the exchange is open, that is handled in the Security.Exchange property. More...
 
void ApplySplit (List< OrderTicket > tickets, Split split)
 Applies the split to the specified order ticket More...
 
decimal GetLeverage (Security security)
 Gets the brokerage's leverage for the specified security More...
 
IBenchmark GetBenchmark (SecurityManager securities)
 Get the benchmark for this model More...
 
IFillModel GetFillModel (Security security)
 Gets a new fill model that represents this brokerage's fill behavior More...
 
IFeeModel GetFeeModel (Security security)
 Gets a new fee model that represents this brokerage's fee structure More...
 
ISlippageModel GetSlippageModel (Security security)
 Gets a new slippage model that represents this brokerage's fill slippage behavior More...
 
ISettlementModel GetSettlementModel (Security security)
 Gets a new settlement model for the security More...
 
IMarginInterestRateModel GetMarginInterestRateModel (Security security)
 Gets a new margin interest rate model for the security More...
 
ISettlementModel GetSettlementModel (Security security, AccountType accountType)
 Gets a new settlement model for the security More...
 
IBuyingPowerModel GetBuyingPowerModel (Security security)
 Gets a new buying power model for the security More...
 
IBuyingPowerModel GetBuyingPowerModel (Security security, AccountType accountType)
 Gets a new buying power model for the security More...
 
IShortableProvider GetShortableProvider (Security security)
 Gets the shortable provider More...
 

Properties

AccountType AccountType [get]
 Gets the account type used by this model More...
 
decimal RequiredFreeBuyingPowerPercent [get]
 Gets the brokerages model percentage factor used to determine the required unused buying power for the account. From 1 to 0. Example: 0 means no unused buying power is required. 0.5 means 50% of the buying power should be left unused. More...
 
IReadOnlyDictionary< SecurityType, string > DefaultMarkets [get]
 Gets a map of the default markets to be used for each security type More...
 

Detailed Description

Models brokerage transactions, fees, and order

Definition at line 34 of file IBrokerageModel.cs.

Member Function Documentation

◆ CanSubmitOrder()

bool QuantConnect.Brokerages.IBrokerageModel.CanSubmitOrder ( Security  security,
Order  order,
out BrokerageMessageEvent  message 
)

Returns true if the brokerage could accept this order. This takes into account order type, security type, and order size limits.

For example, a brokerage may have no connectivity at certain times, or an order rate/size limit

Parameters
securityThe security being ordered
orderThe order to be processed
messageIf this function returns false, a brokerage message detailing why the order may not be submitted
Returns
True if the brokerage could process the order, false otherwise

Implemented in QuantConnect.Brokerages.CoinbaseBrokerageModel, QuantConnect.Brokerages.InteractiveBrokersBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, QuantConnect.Brokerages.BitfinexBrokerageModel, QuantConnect.Brokerages.BinanceBrokerageModel, QuantConnect.Brokerages.FTXBrokerageModel, QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Brokerages.AxosClearingBrokerageModel, QuantConnect.Brokerages.TradingTechnologiesBrokerageModel, QuantConnect.Brokerages.SamcoBrokerageModel, QuantConnect.Brokerages.ZerodhaBrokerageModel, QuantConnect.Brokerages.KrakenBrokerageModel, QuantConnect.Brokerages.EzeBrokerageModel, QuantConnect.Brokerages.TradeStationBrokerageModel, QuantConnect.Brokerages.CharlesSchwabBrokerageModel, QuantConnect.Brokerages.OandaBrokerageModel, QuantConnect.Brokerages.FxcmBrokerageModel, QuantConnect.Brokerages.AlpacaBrokerageModel, QuantConnect.Brokerages.ExanteBrokerageModel, QuantConnect.Brokerages.TradierBrokerageModel, QuantConnect.Brokerages.TDAmeritradeBrokerageModel, QuantConnect.Brokerages.RBIBrokerageModel, and QuantConnect.Brokerages.WolverineBrokerageModel.

◆ CanUpdateOrder()

bool QuantConnect.Brokerages.IBrokerageModel.CanUpdateOrder ( Security  security,
Order  order,
UpdateOrderRequest  request,
out BrokerageMessageEvent  message 
)

◆ CanExecuteOrder()

bool QuantConnect.Brokerages.IBrokerageModel.CanExecuteOrder ( Security  security,
Order  order 
)

Returns true if the brokerage would be able to execute this order at this time assuming market prices are sufficient for the fill to take place. This is used to emulate the brokerage fills in backtesting and paper trading. For example some brokerages may not perform executions during extended market hours. This is not intended to be checking whether or not the exchange is open, that is handled in the Security.Exchange property.

Parameters
securityThe security being ordered
orderThe order to test for execution
Returns
True if the brokerage would be able to perform the execution, false otherwise

Implemented in QuantConnect.Brokerages.InteractiveBrokersBrokerageModel, QuantConnect.Brokerages.TradingTechnologiesBrokerageModel, QuantConnect.Brokerages.TradierBrokerageModel, QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, QuantConnect.Brokerages.ZerodhaBrokerageModel, and QuantConnect.Brokerages.SamcoBrokerageModel.

◆ ApplySplit()

void QuantConnect.Brokerages.IBrokerageModel.ApplySplit ( List< OrderTicket tickets,
Split  split 
)

Applies the split to the specified order ticket

Parameters
ticketsThe open tickets matching the split event
splitThe split event data

Implemented in QuantConnect.Brokerages.TradierBrokerageModel, QuantConnect.Brokerages.DefaultBrokerageModel, and QuantConnect.Python.BrokerageModelPythonWrapper.

◆ GetLeverage()

◆ GetBenchmark()

◆ GetFillModel()

IFillModel QuantConnect.Brokerages.IBrokerageModel.GetFillModel ( Security  security)

Gets a new fill model that represents this brokerage's fill behavior

Parameters
securityThe security to get fill model for
Returns
The new fill model for this brokerage

Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, and QuantConnect.Python.BrokerageModelPythonWrapper.

◆ GetFeeModel()

IFeeModel QuantConnect.Brokerages.IBrokerageModel.GetFeeModel ( Security  security)

Gets a new fee model that represents this brokerage's fee structure

Parameters
securityThe security to get a fee model for
Returns
The new fee model for this brokerage

Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Brokerages.TradierBrokerageModel, QuantConnect.Brokerages.SamcoBrokerageModel, QuantConnect.Brokerages.FxcmBrokerageModel, QuantConnect.Brokerages.ZerodhaBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, QuantConnect.Brokerages.KrakenBrokerageModel, QuantConnect.Brokerages.OandaBrokerageModel, QuantConnect.Brokerages.TDAmeritradeBrokerageModel, QuantConnect.Brokerages.InteractiveBrokersBrokerageModel, QuantConnect.Brokerages.RBIBrokerageModel, QuantConnect.Brokerages.CoinbaseBrokerageModel, QuantConnect.Brokerages.ExanteBrokerageModel, QuantConnect.Brokerages.WolverineBrokerageModel, QuantConnect.Brokerages.TradingTechnologiesBrokerageModel, QuantConnect.Brokerages.BitfinexBrokerageModel, QuantConnect.Brokerages.BinanceBrokerageModel, QuantConnect.Brokerages.FTXBrokerageModel, QuantConnect.Brokerages.EzeBrokerageModel, QuantConnect.Brokerages.TradeStationBrokerageModel, QuantConnect.Brokerages.AxosClearingBrokerageModel, QuantConnect.Brokerages.CharlesSchwabBrokerageModel, QuantConnect.Brokerages.BinanceFuturesBrokerageModel, QuantConnect.Brokerages.AlpacaBrokerageModel, QuantConnect.Brokerages.BinanceCoinFuturesBrokerageModel, QuantConnect.Brokerages.FTXUSBrokerageModel, and QuantConnect.Brokerages.AlphaStreamsBrokerageModel.

◆ GetSlippageModel()

ISlippageModel QuantConnect.Brokerages.IBrokerageModel.GetSlippageModel ( Security  security)

Gets a new slippage model that represents this brokerage's fill slippage behavior

Parameters
securityThe security to get a slippage model for
Returns
The new slippage model for this brokerage

Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, and QuantConnect.Brokerages.AlphaStreamsBrokerageModel.

◆ GetSettlementModel() [1/2]

ISettlementModel QuantConnect.Brokerages.IBrokerageModel.GetSettlementModel ( Security  security)

Gets a new settlement model for the security

Parameters
securityThe security to get a settlement model for
Returns
The settlement model for this brokerage

Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, QuantConnect.Brokerages.FxcmBrokerageModel, QuantConnect.Brokerages.OandaBrokerageModel, and QuantConnect.Brokerages.AlphaStreamsBrokerageModel.

◆ GetMarginInterestRateModel()

IMarginInterestRateModel QuantConnect.Brokerages.IBrokerageModel.GetMarginInterestRateModel ( Security  security)

Gets a new margin interest rate model for the security

Parameters
securityThe security to get a margin interest rate model for
Returns
The margin interest rate model for this brokerage

Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, and QuantConnect.Brokerages.BinanceFuturesBrokerageModel.

◆ GetSettlementModel() [2/2]

ISettlementModel QuantConnect.Brokerages.IBrokerageModel.GetSettlementModel ( Security  security,
AccountType  accountType 
)

Gets a new settlement model for the security

Parameters
securityThe security to get a settlement model for
accountTypeThe account type
Returns
The settlement model for this brokerage

Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, and QuantConnect.Python.BrokerageModelPythonWrapper.

◆ GetBuyingPowerModel() [1/2]

IBuyingPowerModel QuantConnect.Brokerages.IBrokerageModel.GetBuyingPowerModel ( Security  security)

Gets a new buying power model for the security

Parameters
securityThe security to get a buying power model for
Returns
The buying power model for this brokerage/security

Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, and QuantConnect.Brokerages.CoinbaseBrokerageModel.

◆ GetBuyingPowerModel() [2/2]

IBuyingPowerModel QuantConnect.Brokerages.IBrokerageModel.GetBuyingPowerModel ( Security  security,
AccountType  accountType 
)

Gets a new buying power model for the security

Parameters
securityThe security to get a buying power model for
accountTypeThe account type
Returns
The buying power model for this brokerage/security

Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, and QuantConnect.Python.BrokerageModelPythonWrapper.

◆ GetShortableProvider()

IShortableProvider QuantConnect.Brokerages.IBrokerageModel.GetShortableProvider ( Security  security)

Property Documentation

◆ AccountType

AccountType QuantConnect.Brokerages.IBrokerageModel.AccountType
get

Gets the account type used by this model

Definition at line 40 of file IBrokerageModel.cs.

◆ RequiredFreeBuyingPowerPercent

decimal QuantConnect.Brokerages.IBrokerageModel.RequiredFreeBuyingPowerPercent
get

Gets the brokerages model percentage factor used to determine the required unused buying power for the account. From 1 to 0. Example: 0 means no unused buying power is required. 0.5 means 50% of the buying power should be left unused.

Definition at line 49 of file IBrokerageModel.cs.

◆ DefaultMarkets

IReadOnlyDictionary<SecurityType, string> QuantConnect.Brokerages.IBrokerageModel.DefaultMarkets
get

Gets a map of the default markets to be used for each security type

Definition at line 56 of file IBrokerageModel.cs.


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