예제 #1
0
    def checkCanceled(self, broker, bars):
        # This check is only for accepted orders that are not GTC.
        if self.getGoodTillCanceled() or not self.isAccepted():
            return

        # If its the last bar of the session and the order was not filled then cancel it.
        bar_ = bars.getBar(self.getInstrument())
        if bar_ != None and bar_.getSessionClose():
            broker.cancelOrder(self)
예제 #2
0
    def checkCanceled(self, broker, bars):
        # This check is only for accepted orders that are not GTC.
        if self.getGoodTillCanceled() or not self.isAccepted():
            return

        # If its the last bar of the session and the order was not filled then cancel it.
        bar = bars.getBar(self.getInstrument())
        if bar is not None and bar.getSessionClose():
            broker.cancelOrder(self)
예제 #3
0
	def checkCanceled(self, broker, bars):
		# If its the last bar of the session and the order is not GTC, then cancel it.
		bar_ = bars.getBar(self.getInstrument())
		if bar_ != None and self.isAccepted() and self.getGoodTillCanceled() == False and bar_.getSessionClose():
			broker.cancelOrder(self)