consume ticks

def tickUpdate(self, tick):
        ''' consume ticks '''
        LOG.debug("tickUpdate %s with tick %s, price %s" % (self.__symbol, tick.time, tick.close))
        self.__priceZscore(tick.close)
        self.__volumeZscore(tick.volume)

        # if haven't started, don't do any trading
        if tick.time <= self.__startDate:
            return

        # if not enough data, skip to reduce risk
        if not self.__priceZscore.getLastValue() or not self.__volumeZscore.getLastValue():
            return

        # get zscore
        priceZscore=self.__priceZscore.getLastValue()
        volumeZscore=self.__volumeZscore.getLastValue()
        if priceZscore is None or volumeZscore is None:
            return

        if priceZscore < self.__buyThreshold and self.__position <= 0 and abs(volumeZscore) > 1:
            self.__placeBuyOrder(tick)

        elif priceZscore > self.__sellThreshold and self.__position > 0 and abs(volumeZscore) > 1:
            self.__placeSellOrder(tick)
        """
        if self.__toBuy:
            self.__placeBuyOrder(tick)
            self.__toBuy=False
            return

        if self.__toSell:
            self.__placeSellOrder(tick)
            self.__toSell=False
            return

        if priceZscore < (-self.__threshold) and not self.__buyOrder and abs(volumeZscore) > 1.5:
            self.__toBuy=True

        elif self.__buyOrder and priceZscore > 0.5:
            self.__toSell=True
        """