def main(args):
    l = logging.getLogger()
    l.setLevel(logging.DEBUG)
    l.handlers.append(logging.StreamHandler(sys.stdout))

    client = api.API()
    client.login('aristotle137', 'Antiquark_87')

    bot = LiquidBot1(client, args.market_id, args.selection_id)
    mt = MasterTimer()
    qf = QuoteFeed(client, args.market_id, [bot.process_quotes])
    #tf = TradeFeed(client, args.market_id)
    mt.add_feed(qf, 1)
    #mt.add_feed(tf, 1)
    mt.run()
Exemple #2
0
def main(args):
    l = logging.getLogger()
    l.setLevel(logging.DEBUG)
    l.handlers.append(logging.StreamHandler(sys.stdout))

    client = api.API()
    client.login('aristotle137', 'Antiquark_87')

    bot = LiquidBot1(client, args.market_id, args.selection_id)
    mt = MasterTimer()
    qf = QuoteFeed(client, args.market_id, [bot.process_quotes])
    #tf = TradeFeed(client, args.market_id)
    mt.add_feed(qf, 1)
    #mt.add_feed(tf, 1)
    mt.run()
Exemple #3
0
        self._db['quotes'].insert(quotes)


    def store_trade(self, timestamp, trades):
        logging.debug('Inserting trades for market_id=%s' % self._market_id)
        trades['runners'] = dict(map(lambda x: (x[0], {'prices': x[1].index.tolist(), 'amount': x[1].values.tolist()}), trades['runners'].items()))
        self._db['trades'].insert(trades)


if __name__ == '__main__':
    from betfair import api
    from harb.feeds import MasterTimer, QuoteFeed, TradeFeed

    import sys

    market_id = '107514860'

    l = logging.getLogger()
    l.setLevel(logging.DEBUG)
    l.handlers.append(logging.StreamHandler(sys.stdout))

    client = api.API()
    client.login('aristotle137', 'Antiquark_87')

    mt = MasterTimer()
    qf = QuoteFeed(client, market_id)
    tf = TradeFeed(client, market_id)
    MarketStore(client, market_id, qf, tf)
    mt.add_feed(qf, 3)
    mt.add_feed(tf, 3)
    mt.run()
Exemple #4
0
        trades['runners'] = dict(
            map(
                lambda x: (x[0], {
                    'prices': x[1].index.tolist(),
                    'amount': x[1].values.tolist()
                }), trades['runners'].items()))
        self._db['trades'].insert(trades)


if __name__ == '__main__':
    from betfair import api
    from harb.feeds import MasterTimer, QuoteFeed, TradeFeed

    import sys

    market_id = '107514860'

    l = logging.getLogger()
    l.setLevel(logging.DEBUG)
    l.handlers.append(logging.StreamHandler(sys.stdout))

    client = api.API()
    client.login('aristotle137', 'Antiquark_87')

    mt = MasterTimer()
    qf = QuoteFeed(client, market_id)
    tf = TradeFeed(client, market_id)
    MarketStore(client, market_id, qf, tf)
    mt.add_feed(qf, 3)
    mt.add_feed(tf, 3)
    mt.run()