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)

        # get zscore
        priceZscore=self.__priceZscore.getLastValue()
        volumeZscore=self.__volumeZscore.getLastValue()

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

        # if not enough data, skip to reduce risk
        if priceZscore is None or volumeZscore is None:
            return

        if self.__position > 0:
            self.__dayCounter += 1

        if priceZscore > self.__buyThreshold and self.__preZscore and self.__preZscore < self.__buyThreshold and self.__position <= 0 and abs(volumeZscore) > 1:
            self.__placeBuyOrder(tick)
        elif self.__position > 0:
            if (self.__dayCounter > self.__dayCounterThreshold and priceZscore < self.__sellThreshold)\
                    or priceZscore < 0 or self.__buyPrice * 0.9 > tick.close:
                self.__placeSellOrder(tick)
                self.__dayCounter=0

        self.__preZscore=priceZscore