Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonabreul committed Nov 14, 2023
1 parent 03588ab commit 8667ef9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions QuantConnect.BybitBrokerage/Api/BybitTradeApiEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ private ByBitPlaceOrderRequest CreateRequest(BybitProductCategory category, Orde
var price = GetTickerPrice(category, order);
// Spot market buy orders require price in quote currency
req.Quantity *= price;
Logging.Log.Trace($"BybitTradeApiEndpoint.CreateRequest(): SPOT MARKET ORDER PRICE: {price}. SETTING NEW QUANTITY {req.Quantity}");
}

break;
Expand Down Expand Up @@ -201,6 +202,7 @@ private decimal GetTickerPrice(BybitProductCategory category, Order order)
{
var security = SecurityProvider.GetSecurity(order.Symbol);
var tickerPrice = order.Direction == OrderDirection.Buy ? security.AskPrice : security.BidPrice;
Logging.Log.Trace($"BybitTradeApiEndpoint.GetTickerPrice(): GETTING TICKER PRICE FOR {order.Symbol}: {tickerPrice}");
if (tickerPrice == 0)
{
var brokerageSymbol = SymbolMapper.GetBrokerageSymbol(order.Symbol);
Expand All @@ -212,6 +214,7 @@ private decimal GetTickerPrice(BybitProductCategory category, Order order)
}

tickerPrice = order.Direction == OrderDirection.Buy ? ticker.Ask1Price!.Value : ticker.Bid1Price!.Value;
Logging.Log.Trace($"BybitTradeApiEndpoint.GetTickerPrice(): GETTING TICKER PRICE FROM MARKET API CLIENT FOR {order.Symbol}: {tickerPrice}");
}

return tickerPrice;
Expand Down

0 comments on commit 8667ef9

Please sign in to comment.