17 using System.Collections.Generic;
41 public override IReadOnlyDictionary<SecurityType, string>
DefaultMarkets {
get; } = GetDefaultMarkets(Market.Bybit);
58 if (AccountType == AccountType.Cash || security.IsInternalFeed() || security.
Type == SecurityType.Base)
73 return security.
Type switch
77 SecurityType.Base => base.GetFeeModel(security),
78 _ =>
throw new ArgumentOutOfRangeException(nameof(security), security, $
"Not supported security type {security.Type}")
90 if (security.
Type == SecurityType.CryptoFuture &&
91 security.
Symbol.
ID.
Date == SecurityIdentifier.DefaultDate)
96 return base.GetMarginInterestRateModel(security);
106 var symbol = Symbol.Create(
"BTCUSDC", SecurityType.Crypto,
MarketName);
121 out BrokerageMessageEvent message)
124 if (security.
Type != SecurityType.CryptoFuture)
126 message =
new BrokerageMessageEvent(BrokerageMessageType.Warning,
"NotSupported",
127 Messages.DefaultBrokerageModel.OrderUpdateNotSupported);
133 message =
new BrokerageMessageEvent(BrokerageMessageType.Warning,
"NotSupported",
134 $
"Order with status {order.Status} can't be modified");
140 message =
new BrokerageMessageEvent(BrokerageMessageType.Warning,
"NotSupported",
141 Messages.DefaultBrokerageModel.InvalidOrderQuantity(security, request.
Quantity.Value));
162 if (security.
Type != SecurityType.Crypto && security.
Type != SecurityType.CryptoFuture && security.
Type != SecurityType.Base)
164 message =
new BrokerageMessageEvent(BrokerageMessageType.Warning,
"NotSupported",
165 Messages.DefaultBrokerageModel.UnsupportedSecurityType(
this, security));
171 bool quantityIsValid;
182 message =
new BrokerageMessageEvent(BrokerageMessageType.Warning,
"NotSupported",
183 Messages.DefaultBrokerageModel.UnsupportedOrderType(
this, order,
184 new[] { OrderType.StopMarket, OrderType.StopLimit, OrderType.Market, OrderType.Limit }));
188 if (!quantityIsValid)
190 message =
new BrokerageMessageEvent(BrokerageMessageType.Warning,
"NotSupported",
191 Messages.DefaultBrokerageModel.InvalidOrderQuantity(security, order.
Quantity));
196 return base.CanSubmitOrder(security, order, out message);
211 private static IReadOnlyDictionary<SecurityType, string> GetDefaultMarkets(
string marketName)
213 var map = DefaultMarketMap.ToDictionary();
214 map[SecurityType.Crypto] = marketName;
215 map[SecurityType.CryptoFuture] = marketName;
216 return map.ToReadOnlyDictionary();