Beispiel #1
0
 def parse_order_type(order):
     side = TradeOrderSide(order["side"])
     order_type = TradeOrderType(order["type"])
     if side == TradeOrderSide.BUY:
         if order_type == TradeOrderType.LIMIT:
             return TraderOrderType.BUY_LIMIT
         elif order_type == TradeOrderType.MARKET:
             return TraderOrderType.BUY_MARKET
     elif side == TradeOrderSide.SELL:
         if order_type == TradeOrderType.LIMIT:
             return TraderOrderType.SELL_LIMIT
         elif order_type == TradeOrderType.MARKET:
             return TraderOrderType.SELL_MARKET
Beispiel #2
0
 def parse_order_type(order):
     side = TradeOrderSide(order["side"])
     order_type = TradeOrderType(order["type"])
     if side == TradeOrderSide.BUY:
         if order_type == TradeOrderType.LIMIT or order_type == TradeOrderType.LIMIT_MAKER:
             return TraderOrderType.BUY_LIMIT
         elif order_type == TradeOrderType.MARKET:
             return TraderOrderType.BUY_MARKET
         else:
             return Trader._get_sell_and_buy_types(order_type)
     elif side == TradeOrderSide.SELL:
         if order_type == TradeOrderType.LIMIT or order_type == TradeOrderType.LIMIT_MAKER:
             return TraderOrderType.SELL_LIMIT
         elif order_type == TradeOrderType.MARKET:
             return TraderOrderType.SELL_MARKET
         else:
             return Trader._get_sell_and_buy_types(order_type)