Lean
$LEAN_TAG$
|
Models brokerage transactions, fees, and order More...
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... | |
Models brokerage transactions, fees, and order
Definition at line 34 of file IBrokerageModel.cs.
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
security | The security being ordered |
order | The order to be processed |
message | If this function returns false, a brokerage message detailing why the order may not be submitted |
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.
bool QuantConnect.Brokerages.IBrokerageModel.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
security | The security of the order |
order | The order to be updated |
request | The requested updated to be made to the order |
message | If this function returns false, a brokerage message detailing why the order may not be updated |
Implemented in QuantConnect.Brokerages.InteractiveBrokersBrokerageModel, QuantConnect.Brokerages.FTXBrokerageModel, QuantConnect.Brokerages.EzeBrokerageModel, QuantConnect.Brokerages.TradingTechnologiesBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, QuantConnect.Brokerages.SamcoBrokerageModel, QuantConnect.Brokerages.AxosClearingBrokerageModel, QuantConnect.Brokerages.ZerodhaBrokerageModel, QuantConnect.Brokerages.FxcmBrokerageModel, QuantConnect.Brokerages.TradierBrokerageModel, QuantConnect.Brokerages.KrakenBrokerageModel, QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Brokerages.TradeStationBrokerageModel, QuantConnect.Brokerages.CoinbaseBrokerageModel, QuantConnect.Brokerages.BinanceBrokerageModel, QuantConnect.Brokerages.BitfinexBrokerageModel, QuantConnect.Brokerages.AlpacaBrokerageModel, QuantConnect.Brokerages.TDAmeritradeBrokerageModel, QuantConnect.Brokerages.RBIBrokerageModel, and QuantConnect.Brokerages.WolverineBrokerageModel.
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.
security | The security being ordered |
order | The order to test for execution |
Implemented in QuantConnect.Brokerages.InteractiveBrokersBrokerageModel, QuantConnect.Brokerages.TradingTechnologiesBrokerageModel, QuantConnect.Brokerages.TradierBrokerageModel, QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, QuantConnect.Brokerages.ZerodhaBrokerageModel, and QuantConnect.Brokerages.SamcoBrokerageModel.
void QuantConnect.Brokerages.IBrokerageModel.ApplySplit | ( | List< OrderTicket > | tickets, |
Split | split | ||
) |
Applies the split to the specified order ticket
tickets | The open tickets matching the split event |
split | The split event data |
Implemented in QuantConnect.Brokerages.TradierBrokerageModel, QuantConnect.Brokerages.DefaultBrokerageModel, and QuantConnect.Python.BrokerageModelPythonWrapper.
decimal QuantConnect.Brokerages.IBrokerageModel.GetLeverage | ( | Security | security | ) |
Gets the brokerage's leverage for the specified security
security | The security's whose leverage we seek |
Implemented in QuantConnect.Python.BrokerageModelPythonWrapper, QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Brokerages.SamcoBrokerageModel, QuantConnect.Brokerages.ZerodhaBrokerageModel, QuantConnect.Brokerages.KrakenBrokerageModel, QuantConnect.Brokerages.InteractiveBrokersBrokerageModel, QuantConnect.Brokerages.ExanteBrokerageModel, QuantConnect.Brokerages.CoinbaseBrokerageModel, QuantConnect.Brokerages.FTXBrokerageModel, QuantConnect.Brokerages.BinanceBrokerageModel, QuantConnect.Brokerages.AlphaStreamsBrokerageModel, QuantConnect.Brokerages.BinanceUSBrokerageModel, and QuantConnect.Brokerages.BitfinexBrokerageModel.
IBenchmark QuantConnect.Brokerages.IBrokerageModel.GetBenchmark | ( | SecurityManager | securities | ) |
Get the benchmark for this model
securities | SecurityService to create the security with if needed |
Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Brokerages.KrakenBrokerageModel, QuantConnect.Brokerages.SamcoBrokerageModel, QuantConnect.Brokerages.FxcmBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, QuantConnect.Brokerages.OandaBrokerageModel, QuantConnect.Brokerages.InteractiveBrokersBrokerageModel, QuantConnect.Brokerages.CoinbaseBrokerageModel, QuantConnect.Brokerages.AxosClearingBrokerageModel, QuantConnect.Brokerages.FTXBrokerageModel, QuantConnect.Brokerages.BinanceBrokerageModel, QuantConnect.Brokerages.TradingTechnologiesBrokerageModel, QuantConnect.Brokerages.BitfinexBrokerageModel, QuantConnect.Brokerages.BinanceFuturesBrokerageModel, QuantConnect.Brokerages.ExanteBrokerageModel, and QuantConnect.Brokerages.BinanceCoinFuturesBrokerageModel.
IFillModel QuantConnect.Brokerages.IBrokerageModel.GetFillModel | ( | Security | security | ) |
Gets a new fill model that represents this brokerage's fill behavior
security | The security to get fill model for |
Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, and QuantConnect.Python.BrokerageModelPythonWrapper.
Gets a new fee model that represents this brokerage's fee structure
security | The security to get a fee model for |
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.BinanceBrokerageModel, QuantConnect.Brokerages.TradingTechnologiesBrokerageModel, QuantConnect.Brokerages.BitfinexBrokerageModel, 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.
ISlippageModel QuantConnect.Brokerages.IBrokerageModel.GetSlippageModel | ( | Security | security | ) |
Gets a new slippage model that represents this brokerage's fill slippage behavior
security | The security to get a slippage model for |
Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, and QuantConnect.Brokerages.AlphaStreamsBrokerageModel.
ISettlementModel QuantConnect.Brokerages.IBrokerageModel.GetSettlementModel | ( | Security | security | ) |
Gets a new settlement model for the security
security | The security to get a settlement model for |
Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, QuantConnect.Brokerages.FxcmBrokerageModel, QuantConnect.Brokerages.OandaBrokerageModel, and QuantConnect.Brokerages.AlphaStreamsBrokerageModel.
IMarginInterestRateModel QuantConnect.Brokerages.IBrokerageModel.GetMarginInterestRateModel | ( | Security | security | ) |
Gets a new margin interest rate model for the security
security | The security to get a margin interest rate model for |
Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, and QuantConnect.Brokerages.BinanceFuturesBrokerageModel.
ISettlementModel QuantConnect.Brokerages.IBrokerageModel.GetSettlementModel | ( | Security | security, |
AccountType | accountType | ||
) |
Gets a new settlement model for the security
security | The security to get a settlement model for |
accountType | The account type |
Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, and QuantConnect.Python.BrokerageModelPythonWrapper.
IBuyingPowerModel QuantConnect.Brokerages.IBrokerageModel.GetBuyingPowerModel | ( | Security | security | ) |
Gets a new buying power model for the security
security | The security to get a buying power model for |
Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, and QuantConnect.Brokerages.CoinbaseBrokerageModel.
IBuyingPowerModel QuantConnect.Brokerages.IBrokerageModel.GetBuyingPowerModel | ( | Security | security, |
AccountType | accountType | ||
) |
Gets a new buying power model for the security
security | The security to get a buying power model for |
accountType | The account type |
Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, and QuantConnect.Python.BrokerageModelPythonWrapper.
IShortableProvider QuantConnect.Brokerages.IBrokerageModel.GetShortableProvider | ( | Security | security | ) |
Gets the shortable provider
Implemented in QuantConnect.Brokerages.DefaultBrokerageModel, QuantConnect.Python.BrokerageModelPythonWrapper, and QuantConnect.Brokerages.AxosClearingBrokerageModel.
|
get |
Gets the account type used by this model
Definition at line 40 of file IBrokerageModel.cs.
|
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.
|
get |
Gets a map of the default markets to be used for each security type
Definition at line 56 of file IBrokerageModel.cs.