Skip to content

Commit

Permalink
Refine BybitEnumParser for Bybit
Browse files Browse the repository at this point in the history
  • Loading branch information
sunlei committed Dec 14, 2024
1 parent ac55a2f commit fa96783
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nautilus_trader/adapters/bybit/common/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,11 @@ def parse_trigger_direction(
order_type: OrderType,
order_side: OrderSide,
) -> BybitTriggerDirection | None:
if order_side == OrderSide.BUY:
return self.trigger_direction_map_buy.get(order_type)
else: # SELL
return self.trigger_direction_map_sell.get(order_type)
return (
self.trigger_direction_map_buy.get(order_type)
if order_side == OrderSide.BUY
else self.trigger_direction_map_sell.get(order_type)
)

def parse_bybit_kline(self, bar_type: BarType) -> BybitKlineInterval:
try:
Expand Down

0 comments on commit fa96783

Please sign in to comment.