Exemple #1
0
        self.fire(new_k=new_k)

    def data(self):
        return self.k

    def timestamp(self):
        return self.last_period.name

    def current(self):
        return self.last_period


if __name__ == "__main__":

    import os
    from Application import Application as App

    App.read_config(
        os.path.split(os.path.realpath(__file__))[0] + '/../global.conf')

    logging.basicConfig(level=logging.INFO)

    def gaga(event):
        k = event.source
        print(dt.now(), len(k.data()), k.timestamp(),
              k.current()[K.VOLUME], event.new_k)

    k = K.k(App.get_exchange('quarter'), symbol='eos_usd', period='1min')
    k.subscribe(gaga)
    k.start()