Exemple #1
0
 def cancel(self, order):
     """撤单"""
     req = VtCancelOrderReq()
     req.orderID = order.orderID
     req.exchange = order.exchange
     req.symbol = order.symbol
     req.frontID = order.frontID
     req.sessionID = order.sessionID
     me.cancelOrder(req, order.gatewayName)
Exemple #2
0
 def cancel(self, order):
     """撤单"""
     req = VtCancelOrderReq()
     req.orderID = order.orderID
     req.exchange = order.exchange
     req.symbol = order.symbol
     req.frontID = order.frontID
     req.sessionID = order.sessionID
     me.cancelOrder(req, order.gatewayName)                
Exemple #3
0
    def cancelOrder(self, algo, vtOrderID):
        """撤单"""
        order = self.mainEngine.getOrder(vtOrderID)
        if not order:
            self.writeLog(u'%s委托撤单失败,找不到委托:%s' % (algo.algoName, vtOrderID))
            return

        req = VtCancelOrderReq()
        req.symbol = order.symbol
        req.exchange = order.exchange
        req.orderID = order.orderID
        req.frontID = order.frontID
        req.sessionID = order.sessionID
        self.mainEngine.cancelOrder(req, order.gatewayName)
Exemple #4
0
    def cancelOrder(self, vtOrderID):
        """撤单"""
        order = self.mainEngine.getOrder(vtOrderID)
        if not order:
            return

        req = VtCancelOrderReq()
        req.symbol = order.symbol
        req.exchange = order.exchange
        req.frontID = order.frontID
        req.sessionID = order.sessionID
        req.orderID = order.orderID

        self.mainEngine.cancelOrder(req, order.gatewayName)
Exemple #5
0
 def cancelOrder(self, vtOrderID):
     """撤单"""
     order = self.mainEngine.getOrder(vtOrderID)        
     if not order:
         return
     
     req = VtCancelOrderReq()
     req.symbol = order.symbol
     req.exchange = order.exchange
     req.frontID = order.frontID
     req.sessionID = order.sessionID
     req.orderID = order.orderID
     
     self.mainEngine.cancelOrder(req, order.gatewayName)
Exemple #6
0
    def cancelOrder(self, algo, vtOrderID):
        """撤单"""
        order = self.mainEngine.getOrder(vtOrderID)
        if not order:
            self.writeLog(u'%s委托撤单失败,找不到委托:%s' %(algo.algoName, vtOrderID))
            return

        req = VtCancelOrderReq()
        req.symbol = order.symbol
        req.exchange = order.exchange
        req.orderID = order.orderID
        req.frontID = order.frontID
        req.sessionID = order.sessionID
        self.mainEngine.cancelOrder(req, order.gatewayName)
Exemple #7
0
    def cancelOrder(self, vtSymbol):
        """
        Cancel all orders of a certain vtSymbol
        """
        l = self.mainEngine.getAllWorkingOrders()
        for order in l:
            if order.vtSymbol == vtSymbol:
                req = VtCancelOrderReq()
                req.orderID = order.orderID
                req.frontID = order.frontID
                req.sessionID = order.sessionID
                req.symbol = order.symbol
                req.exchange = order.exchange
                self.mainEngine.cancelOrder(req, order.gatewayName)

        self.writeLog(u'撤销%s全部活动中委托' % vtSymbol)
Exemple #8
0
 def cancelOrder(self, vtSymbol):
     """
     Cancel all orders of a certain vtSymbol
     """
     l = self.mainEngine.getAllWorkingOrders()
     for order in l:
         if order.vtSymbol == vtSymbol:
             req = VtCancelOrderReq()
             req.orderID = order.orderID
             req.frontID = order.frontID
             req.sessionID = order.sessionID
             req.symbol = order.symbol
             req.exchange = order.exchange
             self.mainEngine.cancelOrder(req, order.gatewayName)
     
     self.writeLog(u'撤销%s全部活动中委托' %vtSymbol)