コード例 #1
0
ファイル: Bot_CustomStrategy.py プロジェクト: ynzheng/pyjuque
def Main():
    bot_controller = defineBot(bot_config)
    while True:
        try:
            bot_controller.executeBot()
        except KeyboardInterrupt:
            return
        time.sleep(60)
コード例 #2
0
def Main():
    # The following will run the strategy on the exchange
    bot_controller = defineBot(bot_config)
    while True:
        try:
            bot_controller.executeBot()
        except KeyboardInterrupt:
            return
        time.sleep(60)
コード例 #3
0
def Main():
    bot_controller = defineBot(bot_config)
    while True:
        print(time.ctime())
        try:
            bot_controller.executeBot()
            time.sleep(30)

        except KeyboardInterrupt:
            return
コード例 #4
0
ファイル: AdvancedBotTemplate.py プロジェクト: gyromb/pyjuque
def Main():
    if os.path.isfile('./AdvancedBotTemplate.db'):
        os.remove('./AdvancedBotTemplate.db')

    symbols = ['DASH/ETH']
    bot_config['symbols'] = symbols

    bot_controller = defineBot(bot_config)
    bot_controller.kline_interval = '1m'   
    while True:
        try:
            bot_controller.executeBot()
        except KeyboardInterrupt:
            return
        except Exception as e:
            exc_type, exc_obj, exc_tb = sys.exc_info()
            fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
            print(str(e))

            # if we had an exception then the database will probably be corrupt --> start a new one
            if os.path.isfile('./AdvancedBotTemplate.db'):
                os.remove('./AdvancedBotTemplate.db')
        
        time.sleep(1)