Example #1
0
def topscan(market):
    print("{}".format(market))
    try:
        mongo = MongoWrapper.getInstance().getClient()
        bot = ScanBot({
            "market": market,
            "candlesize": "1d"
        },
                      name='topscanner')
        res = bot.process({'scrape': True})
        mongo.crypto.scanner.replace_one({
            'market': market,
            'candlesize': '1d'
        },
                                         res,
                                         upsert=True)

        bot = ScanBot({
            "market": market,
            "candlesize": "1h"
        },
                      name='topscanner')
        res = bot.process({'scrape': True})
        mongo.crypto.scanner.replace_one({
            'market': market,
            'candlesize': '1h'
        },
                                         res,
                                         upsert=True)

        bot = ScanBot({
            "market": market,
            "candlesize": "15m"
        },
                      name='topscanner')
        res = bot.process({'scrape': True})
        mongo.crypto.scanner.replace_one(
            {
                'market': market,
                'candlesize': '15m'
            }, res, upsert=True)

        bot = ScanBot({
            "market": market,
            "candlesize": "5m"
        },
                      name='topscanner')
        res = bot.process({'scrape': False})
        mongo.crypto.scanner.replace_one({
            'market': market,
            'candlesize': '5m'
        },
                                         res,
                                         upsert=True)
    except Exception as ex:
        print("Exception: {}".format(ex))
Example #2
0
 def __init__(self, config={}):
     self.bittrex = Bittrex()
     self.mongo = MongoWrapper.getInstance().getClient()
     self.history = None
     self.pendingorders = None
     self.bal = None