def _convert_order_format(self, o):
    '将交易所订单结构转换为本交易系统标准订单结构格式\n        '
    order_no = str(o['id'])
    state = o['status']
    remain = float(o['remainingSize'])
    filled = float(o['filledSize'])
    size = float(o['size'])
    price = (None if (o['price'] == None) else float(o['price']))
    avg_price = (None if (o['avgFillPrice'] == None) else float(o['avgFillPrice']))
    if (state == 'new'):
        status = ORDER_STATUS_SUBMITTED
    elif (state == 'open'):
        if (remain < size):
            status = ORDER_STATUS_PARTIAL_FILLED
        else:
            status = ORDER_STATUS_SUBMITTED
    elif (state == 'closed'):
        if (filled < size):
            status = ORDER_STATUS_CANCELED
        else:
            status = ORDER_STATUS_FILLED
    else:
        return None
    info = {'platform': self._platform, 'account': self._account, 'strategy': self._strategy, 'order_no': order_no, 'action': (ORDER_ACTION_BUY if (o['side'] == 'buy') else ORDER_ACTION_SELL), 'symbol': o['market'], 'price': price, 'quantity': size, 'order_type': (ORDER_TYPE_LIMIT if (o['type'] == 'limit') else ORDER_TYPE_MARKET), 'remain': remain, 'status': status, 'avg_price': avg_price}
    order = Order(**info)
    return order
将交易所订单结构转换为本交易系统标准订单结构格式
def _convert_order_format(self, o):
    '\n        '
    order_no = str(o['id'])
    state = o['status']
    remain = float(o['remainingSize'])
    filled = float(o['filledSize'])
    size = float(o['size'])
    price = (None if (o['price'] == None) else float(o['price']))
    avg_price = (None if (o['avgFillPrice'] == None) else float(o['avgFillPrice']))
    if (state == 'new'):
        status = ORDER_STATUS_SUBMITTED
    elif (state == 'open'):
        if (remain < size):
            status = ORDER_STATUS_PARTIAL_FILLED
        else:
            status = ORDER_STATUS_SUBMITTED
    elif (state == 'closed'):
        if (filled < size):
            status = ORDER_STATUS_CANCELED
        else:
            status = ORDER_STATUS_FILLED
    else:
        return None
    info = {'platform': self._platform, 'account': self._account, 'strategy': self._strategy, 'order_no': order_no, 'action': (ORDER_ACTION_BUY if (o['side'] == 'buy') else ORDER_ACTION_SELL), 'symbol': o['market'], 'price': price, 'quantity': size, 'order_type': (ORDER_TYPE_LIMIT if (o['type'] == 'limit') else ORDER_TYPE_MARKET), 'remain': remain, 'status': status, 'avg_price': avg_price}
    order = Order(**info)
    return order