def send_order(self, vt_symbol: str, direction: Direction, offset: Offset, price: float, volume: float, stop: bool=False, lock: bool=False, order_type: OrderType=OrderType.LIMIT, order_time: datetime=None, grid: CtaGrid=None):
    '\n        Send a new order.\n        '
    if (vt_symbol == ''):
        vt_symbol = self.vt_symbol
    if (not self.trading):
        self.write_log(f'非交易状态')
        return []
    vt_orderids = self.cta_engine.send_order(strategy=self, vt_symbol=vt_symbol, direction=direction, offset=offset, price=price, volume=volume, stop=stop, lock=lock, order_type=order_type)
    if (len(vt_orderids) == 0):
        self.write_error(f'{self.strategy_name}调用cta_engine.send_order委托返回失败,vt_symbol:{vt_symbol}')
    if (order_time is None):
        order_time = datetime.now()
    for vt_orderid in vt_orderids:
        d = {'direction': direction, 'offset': offset, 'vt_symbol': vt_symbol, 'price': price, 'volume': volume, 'order_type': order_type, 'traded': 0, 'order_time': order_time, 'status': Status.SUBMITTING}
        if grid:
            d.update({'grid': grid})
            grid.order_ids.append(vt_orderid)
        self.active_orders.update({vt_orderid: d})
    if (direction == Direction.LONG):
        self.entrust = 1
    elif (direction == Direction.SHORT):
        self.entrust = (- 1)
    return vt_orderids
Send a new order.
def send_order(self, vt_symbol: str, direction: Direction, offset: Offset, price: float, volume: float, stop: bool=False, lock: bool=False, order_type: OrderType=OrderType.LIMIT, order_time: datetime=None, grid: CtaGrid=None):
    '\n        \n        '
    if (vt_symbol == ):
        vt_symbol = self.vt_symbol
    if (not self.trading):
        self.write_log(f'非交易状态')
        return []
    vt_orderids = self.cta_engine.send_order(strategy=self, vt_symbol=vt_symbol, direction=direction, offset=offset, price=price, volume=volume, stop=stop, lock=lock, order_type=order_type)
    if (len(vt_orderids) == 0):
        self.write_error(f'{self.strategy_name}调用cta_engine.send_order委托返回失败,vt_symbol:{vt_symbol}')
    if (order_time is None):
        order_time = datetime.now()
    for vt_orderid in vt_orderids:
        d = {'direction': direction, 'offset': offset, 'vt_symbol': vt_symbol, 'price': price, 'volume': volume, 'order_type': order_type, 'traded': 0, 'order_time': order_time, 'status': Status.SUBMITTING}
        if grid:
            d.update({'grid': grid})
            grid.order_ids.append(vt_orderid)
        self.active_orders.update({vt_orderid: d})
    if (direction == Direction.LONG):
        self.entrust = 1
    elif (direction == Direction.SHORT):
        self.entrust = (- 1)
    return vt_orderids