lowbot_microsma_v2.6.py
def pause_bot():
    '''Pause the script when exeternal indicators detect a bearish trend in the market'''
    global bot_paused, session_profit, hsp_head

    # start counting for how long the bot's been paused
    start_time = time.perf_counter()

    while os.path.isfile("signals/paused.exc"):

        if bot_paused == False:
            print(f'{txcolors.WARNING}Pausing buying due to change in market conditions, stop loss and take profit will continue to work...{txcolors.DEFAULT}')
            bot_paused = True

        # Sell function needs to work even while paused
        coins_sold = sell_coins()
        remove_from_portfolio(coins_sold)
        get_price(True)

        # pausing here
        if hsp_head == 1: print(f'Paused...Session profit:{session_profit:.2f}% Est:${(QUANTITY * session_profit)/100:.2f}')
        time.sleep(3)

    else:
        # stop counting the pause time
        stop_time = time.perf_counter()
        time_elapsed = timedelta(seconds=int(stop_time-start_time))

        # resume the bot and ser pause_bot to False
        if  bot_paused == True:
            print(f'{txcolors.WARNING}Resuming buying due to change in market conditions, total sleep time: {time_elapsed}{txcolors.DEFAULT}')
            bot_paused = False

    return
Pause the script when exeternal indicators detect a bearish trend in the market
Pause the script when exeternal indicators detect a bearish trend in the market
Pause the script when exeternal indicators detect a bearish trend in the market
def pause_bot():
    global bot_paused, session_profit, hsp_head
    start_time = time.perf_counter()
    while os.path.isfile("signals/paused.exc"):
        if bot_paused == False:
            print(f'{txcolors.WARNING}Pausing buying due to change in market conditions, stop loss and take profit will continue to work...{txcolors.DEFAULT}')
            bot_paused = True
        coins_sold = sell_coins()
        remove_from_portfolio(coins_sold)
        get_price(True)
        if hsp_head == 1: print(f'Paused...Session profit:{session_profit:.2f}% Est:${(QUANTITY * session_profit)/100:.2f}')
        time.sleep(3)
    else:
        stop_time = time.perf_counter()
        time_elapsed = timedelta(seconds=int(stop_time-start_time))
        if  bot_paused == True:
            print(f'{txcolors.WARNING}Resuming buying due to change in market conditions, total sleep time: {time_elapsed}{txcolors.DEFAULT}')
            bot_paused = False
    return
def pause_bot ( ) : global bot_paused , session_profit , hsp_head start_time = time . perf_counter ( ) while os . path . isfile ( "signals/paused.exc" ) : if bot_paused == False : print ( f'{txcolors.WARNING}Pausing buying due to change in market conditions, stop loss and take profit will continue to work...{txcolors.DEFAULT}' ) bot_paused = True coins_sold = sell_coins ( ) remove_from_portfolio ( coins_sold ) get_price ( True ) if hsp_head == 1 : print ( f'Paused...Session profit:{session_profit:.2f}% Est:${(QUANTITY * session_profit)/100:.2f}' ) time . sleep ( 3 ) else : stop_time = time . perf_counter ( ) time_elapsed = timedelta ( seconds = int ( stop_time - start_time ) ) if bot_paused == True : print ( f'{txcolors.WARNING}Resuming buying due to change in market conditions, total sleep time: {time_elapsed}{txcolors.DEFAULT}' ) bot_paused = False return
Pause the script when exeternal indicators detect a bearish trend in the market
Pause the script when exeternal indicators detect a bearish trend in the market
'''Pause the script when exeternal indicators detect a bearish trend in the market''' # start counting for how long the bot's been paused # Sell function needs to work even while paused # pausing here # stop counting the pause time # resume the bot and ser pause_bot to False