Lean  $LEAN_TAG$
QuantConnect.Brokerages.CoinbaseBrokerageModel Class Reference

Represents a brokerage model for interacting with the Coinbase exchange. This class extends the default brokerage model. More...

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

Public Member Functions

 CoinbaseBrokerageModel (AccountType accountType=AccountType.Cash)
 Initializes a new instance of the CoinbaseBrokerageModel class More...
 
override decimal GetLeverage (Security security)
 Coinbase global leverage rule More...
 
override IBenchmark GetBenchmark (SecurityManager securities)
 Get the benchmark for this model More...
 
override IFeeModel GetFeeModel (Security security)
 Provides Coinbase fee model More...
 
override bool CanUpdateOrder (Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)
 Determines whether the brokerage supports updating an existing order for the specified security. More...
 
override bool CanSubmitOrder (Security security, Order order, out BrokerageMessageEvent message)
 Evaluates whether exchange will accept order. Will reject order update More...
 
override IBuyingPowerModel GetBuyingPowerModel (Security security)
 Gets a new buying power model for the security, returning the default model with the security's configured leverage. For cash accounts, leverage = 1 is used. More...
 
- Public Member Functions inherited from QuantConnect.Brokerages.DefaultBrokerageModel
 DefaultBrokerageModel (AccountType accountType=AccountType.Margin)
 Initializes a new instance of the DefaultBrokerageModel class More...
 
virtual 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...
 
virtual void ApplySplit (List< OrderTicket > tickets, Split split)
 Applies the split to the specified order ticket More...
 
virtual IFillModel GetFillModel (Security security)
 Gets a new fill model that represents this brokerage's fill behavior More...
 
virtual ISlippageModel GetSlippageModel (Security security)
 Gets a new slippage model that represents this brokerage's fill slippage behavior More...
 
virtual ISettlementModel GetSettlementModel (Security security)
 Gets a new settlement model for the security More...
 
ISettlementModel GetSettlementModel (Security security, AccountType accountType)
 Gets a new settlement model for the security More...
 
virtual IShortableProvider GetShortableProvider (Security security)
 Gets the shortable provider More...
 
virtual IMarginInterestRateModel GetMarginInterestRateModel (Security security)
 Gets a new margin interest rate model for the security More...
 
IBuyingPowerModel GetBuyingPowerModel (Security security, AccountType accountType)
 Gets a new buying power model for the security More...
 

Public Attributes

override IReadOnlyDictionary< SecurityType, string > DefaultMarkets => GetDefaultMarkets(Market.Coinbase)
 Gets a map of the default markets to be used for each security type More...
 
- Public Attributes inherited from QuantConnect.Brokerages.DefaultBrokerageModel
virtual decimal RequiredFreeBuyingPowerPercent => 0m
 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...
 

Protected Member Functions

virtual bool IsOrderSizeLargeEnough (Security security, decimal orderQuantity)
 Returns true if the order size is large enough for the given security. More...
 

Static Protected Member Functions

static IReadOnlyDictionary< SecurityType, string > GetDefaultMarkets (string marketName)
 Gets the default markets for different security types, with an option to override the market name for Crypto securities. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from QuantConnect.Brokerages.DefaultBrokerageModel
static bool IsValidOrderSize (Security security, decimal orderQuantity, out BrokerageMessageEvent message)
 Checks if the order quantity is valid, it means, the order size is bigger than the minimum size allowed More...
 
- Static Public Attributes inherited from QuantConnect.Brokerages.DefaultBrokerageModel
static readonly IReadOnlyDictionary< SecurityType, string > DefaultMarketMap
 The default markets for the backtesting brokerage More...
 
- Properties inherited from QuantConnect.Brokerages.DefaultBrokerageModel
virtual AccountType AccountType [get]
 Gets or sets the account type used by this model More...
 
virtual IReadOnlyDictionary< SecurityType, string > DefaultMarkets [get]
 Gets a map of the default markets to be used for each security type More...
 
- Properties inherited from QuantConnect.Brokerages.IBrokerageModel
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

Represents a brokerage model for interacting with the Coinbase exchange. This class extends the default brokerage model.

Definition at line 31 of file CoinbaseBrokerageModel.cs.

Constructor & Destructor Documentation

◆ CoinbaseBrokerageModel()

QuantConnect.Brokerages.CoinbaseBrokerageModel.CoinbaseBrokerageModel ( AccountType  accountType = AccountType.Cash)

Initializes a new instance of the CoinbaseBrokerageModel class

Parameters
accountTypeThe type of account to be modelled, defaults to AccountType.Cash

Definition at line 66 of file CoinbaseBrokerageModel.cs.

Member Function Documentation

◆ GetLeverage()

override decimal QuantConnect.Brokerages.CoinbaseBrokerageModel.GetLeverage ( Security  security)
virtual

Coinbase global leverage rule

Parameters
security
Returns

Reimplemented from QuantConnect.Brokerages.DefaultBrokerageModel.

Definition at line 80 of file CoinbaseBrokerageModel.cs.

◆ GetBenchmark()

override IBenchmark QuantConnect.Brokerages.CoinbaseBrokerageModel.GetBenchmark ( SecurityManager  securities)
virtual

Get the benchmark for this model

Parameters
securitiesSecurityService to create the security with if needed
Returns
The benchmark for this brokerage

Reimplemented from QuantConnect.Brokerages.DefaultBrokerageModel.

Definition at line 91 of file CoinbaseBrokerageModel.cs.

Here is the call graph for this function:

◆ GetFeeModel()

override IFeeModel QuantConnect.Brokerages.CoinbaseBrokerageModel.GetFeeModel ( Security  security)
virtual

Provides Coinbase fee model

Parameters
security
Returns

Reimplemented from QuantConnect.Brokerages.DefaultBrokerageModel.

Definition at line 102 of file CoinbaseBrokerageModel.cs.

◆ CanUpdateOrder()

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

Determines whether the brokerage supports updating an existing order for the specified security.

Parameters
securityThe security of the order
orderThe order to be updated
requestThe requested update to be made to the order
messageIf this function returns false, a brokerage message detailing why the order may not be updated
Returns
true if the brokerage supports updating orders; otherwise, false.

Coinbase: Only limit order types, with time in force type of good-till-cancelled can be edited.

Reimplemented from QuantConnect.Brokerages.DefaultBrokerageModel.

Definition at line 116 of file CoinbaseBrokerageModel.cs.

Here is the call graph for this function:

◆ CanSubmitOrder()

override bool QuantConnect.Brokerages.CoinbaseBrokerageModel.CanSubmitOrder ( Security  security,
Order  order,
out BrokerageMessageEvent  message 
)
virtual

Evaluates whether exchange will accept order. Will reject order update

Parameters
securityThe security of the order
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

Reimplemented from QuantConnect.Brokerages.DefaultBrokerageModel.

Definition at line 163 of file CoinbaseBrokerageModel.cs.

Here is the call graph for this function:

◆ GetBuyingPowerModel()

override IBuyingPowerModel QuantConnect.Brokerages.CoinbaseBrokerageModel.GetBuyingPowerModel ( Security  security)
virtual

Gets a new buying power model for the security, returning the default model with the security's configured leverage. For cash accounts, leverage = 1 is used.

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

Reimplemented from QuantConnect.Brokerages.DefaultBrokerageModel.

Definition at line 220 of file CoinbaseBrokerageModel.cs.

◆ IsOrderSizeLargeEnough()

virtual bool QuantConnect.Brokerages.CoinbaseBrokerageModel.IsOrderSizeLargeEnough ( Security  security,
decimal  orderQuantity 
)
protectedvirtual

Returns true if the order size is large enough for the given security.

Parameters
securityThe security of the order
orderQuantityThe order quantity
Returns
True if the order size is large enough, false otherwise

Definition at line 232 of file CoinbaseBrokerageModel.cs.

Here is the caller graph for this function:

◆ GetDefaultMarkets()

static IReadOnlyDictionary<SecurityType, string> QuantConnect.Brokerages.CoinbaseBrokerageModel.GetDefaultMarkets ( string  marketName)
staticprotected

Gets the default markets for different security types, with an option to override the market name for Crypto securities.

Parameters
marketNameThe default market name for Crypto securities.
Returns
A read-only dictionary where the keys are SecurityType and the values are market names.

Definition at line 247 of file CoinbaseBrokerageModel.cs.

Member Data Documentation

◆ DefaultMarkets

override IReadOnlyDictionary<SecurityType, string> QuantConnect.Brokerages.CoinbaseBrokerageModel.DefaultMarkets => GetDefaultMarkets(Market.Coinbase)

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

Definition at line 60 of file CoinbaseBrokerageModel.cs.


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