Lean  $LEAN_TAG$
BybitBrokerageModel Class Reference

Provides Bybit specific properties More...

Inheritance diagram for BybitBrokerageModel:
[legend]

Public Member Functions

 BybitBrokerageModel (AccountType accountType=AccountType.Cash)
 Initializes a new instance of the BybitBrokerageModel class More...
 
override decimal GetLeverage (Security security)
 Bybit global leverage rule More...
 
override IFeeModel GetFeeModel (Security security)
 Provides Bybit fee model More...
 
override IMarginInterestRateModel GetMarginInterestRateModel (Security security)
 Gets a new margin interest rate model for the security More...
 
override IBenchmark GetBenchmark (SecurityManager securities)
 Get the benchmark for this model More...
 
override bool CanUpdateOrder (Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message)
 Returns true if the brokerage could accept this order update. This takes into account order type, security type, and order size limits. Bybit can only update inverse, linear, and option orders More...
 
override 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...
 

Protected Member Functions

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

Protected Attributes

virtual string MarketName => Market.Bybit
 Market name More...
 

Properties

override IReadOnlyDictionary< SecurityType, string > DefaultMarkets = GetDefaultMarkets(Market.Bybit) [get]
 Gets a map of the default markets to be used for each security type More...
 

Detailed Description

Provides Bybit specific properties

Definition at line 30 of file BybitBrokerageModel.cs.

Constructor & Destructor Documentation

◆ BybitBrokerageModel()

BybitBrokerageModel.BybitBrokerageModel ( AccountType  accountType = AccountType.Cash)

Initializes a new instance of the BybitBrokerageModel class

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

Definition at line 46 of file BybitBrokerageModel.cs.

Member Function Documentation

◆ GetLeverage()

override decimal BybitBrokerageModel.GetLeverage ( Security  security)

Bybit global leverage rule

Parameters
security
Returns

Definition at line 55 of file BybitBrokerageModel.cs.

◆ GetFeeModel()

override IFeeModel BybitBrokerageModel.GetFeeModel ( Security  security)

Provides Bybit fee model

Parameters
security
Returns

Definition at line 70 of file BybitBrokerageModel.cs.

◆ GetMarginInterestRateModel()

override IMarginInterestRateModel BybitBrokerageModel.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

Definition at line 86 of file BybitBrokerageModel.cs.

◆ GetBenchmark()

override IBenchmark BybitBrokerageModel.GetBenchmark ( SecurityManager  securities)

Get the benchmark for this model

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

Definition at line 103 of file BybitBrokerageModel.cs.

Here is the call graph for this function:

◆ CanUpdateOrder()

override bool BybitBrokerageModel.CanUpdateOrder ( Security  security,
Order  order,
UpdateOrderRequest  request,
out BrokerageMessageEvent  message 
)

Returns true if the brokerage could accept this order update. This takes into account order type, security type, and order size limits. Bybit can only update inverse, linear, and option orders

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 could update the order, false otherwise

Definition at line 119 of file BybitBrokerageModel.cs.

Here is the call graph for this function:

◆ CanSubmitOrder()

override bool BybitBrokerageModel.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 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

Definition at line 159 of file BybitBrokerageModel.cs.

Here is the call graph for this function:

◆ IsOrderSizeLargeEnough()

virtual bool BybitBrokerageModel.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 204 of file BybitBrokerageModel.cs.

Here is the caller graph for this function:

Member Data Documentation

◆ MarketName

virtual string BybitBrokerageModel.MarketName => Market.Bybit
protected

Market name

Definition at line 35 of file BybitBrokerageModel.cs.

Property Documentation

◆ DefaultMarkets

override IReadOnlyDictionary<SecurityType, string> BybitBrokerageModel.DefaultMarkets = GetDefaultMarkets(Market.Bybit)
get

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

Definition at line 40 of file BybitBrokerageModel.cs.


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