Lean
$LEAN_TAG$
|
Provides Bybit specific properties More...
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... | |
Provides Bybit specific properties
Definition at line 30 of file BybitBrokerageModel.cs.
BybitBrokerageModel.BybitBrokerageModel | ( | AccountType | accountType = AccountType.Cash | ) |
Initializes a new instance of the BybitBrokerageModel class
accountType | The type of account to be modeled, defaults to AccountType.Cash |
Definition at line 46 of file BybitBrokerageModel.cs.
override decimal BybitBrokerageModel.GetLeverage | ( | Security | security | ) |
Bybit global leverage rule
security |
Definition at line 55 of file BybitBrokerageModel.cs.
Provides Bybit fee model
security |
Definition at line 70 of file BybitBrokerageModel.cs.
override IMarginInterestRateModel BybitBrokerageModel.GetMarginInterestRateModel | ( | Security | security | ) |
Gets a new margin interest rate model for the security
security | The security to get a margin interest rate model for |
Definition at line 86 of file BybitBrokerageModel.cs.
override IBenchmark BybitBrokerageModel.GetBenchmark | ( | SecurityManager | securities | ) |
Get the benchmark for this model
securities | SecurityService to create the security with if needed |
Definition at line 103 of file BybitBrokerageModel.cs.
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
security | The security of the order |
order | The order to be updated |
request | The requested update to be made to the order |
message | If this function returns false, a brokerage message detailing why the order may not be updated |
Definition at line 119 of file BybitBrokerageModel.cs.
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
security | The security of the order |
order | The order to be processed |
message | If this function returns false, a brokerage message detailing why the order may not be submitted |
Definition at line 159 of file BybitBrokerageModel.cs.
|
protectedvirtual |
Returns true if the order size is large enough for the given security.
security | The security of the order |
orderQuantity | The order quantity |
Definition at line 204 of file BybitBrokerageModel.cs.
|
protected |
Market name
Definition at line 35 of file BybitBrokerageModel.cs.
|
get |
Gets a map of the default markets to be used for each security type
Definition at line 40 of file BybitBrokerageModel.cs.