Пример #1
0
                    self.logger.info("UPWARDS BREAKOUT %s" % ohlc.mdiId)
                    # let's also pull up the breakout point
                    self.upperBoundaries[
                        ohlc.mdiId] = ohlc.close + self.currentPriceRanges[
                            ohlc.mdiId]
                    self.xmpp.outgoingQueue.put(
                        [self.targetjid, ohlc.mdiId + ' UPWARDS BREAKOUT'])
                if ohlc.close < lowerBoundary:
                    self.logger.info("DOWNWARDS BREAKOUT %s" % ohlc.mdiId)
                    # let's pull it down ...
                    self.lowerBoundaries[
                        ohlc.mdiId] = ohlc.close - self.currentPriceRanges[
                            ohlc.mdiId]
                    self.xmpp.outgoingQueue.put(
                        [self.targetjid, ohlc.mdiId + ' DOWNWARDS BREAKOUT'])
        return


############### MAIN CODE START
# let's create the listener.
logging.basicConfig(level=logging.INFO,
                    format='%(asctime)-15s %(name)s| %(message)s')

brokeraqUid = 'XXXX'
brokeraqPwd = 'XXXX'

listener = MyListener()
aqsPrice = AqSocket(listener)
aqsPrice.host = '78.47.96.150'
aqsPrice.connect()