def loopeth():
global clock
global old_price
global etheur_sell_price
# Current local time getter
clock = datetime.now().strftime('[%Y-%m-%d %H:%M]')
# Print LOOP ETH price
etheur_sell_price = get_etheur_sell_price()
etheur_buy_price = get_etheur_buy_price()
""" print colors
Fore.GREEN
Fore.RED
Fore.CYAN """
if old_price < etheur_sell_price:
logthis(clock+color_green(" ETH sell price raised: "
+ str(etheur_sell_price)+" EUR, ")
+ color_cyan('Balance: ')
+ str(get_etheur_balance(etheur_sell_price))+color_cyan(' EUR')
+ color_cyan(', BUY: ')
+ str(get_etheur_buy_price())+color_cyan(' EUR'))
elif old_price > etheur_sell_price:
logthis(clock+color_red(" ETH sell price dropped: "
+ str(etheur_sell_price)+" EUR, ")
+ color_cyan('Balance: ')
+ str(get_etheur_balance(etheur_sell_price))
+ color_cyan(' EUR')
+ color_cyan(', BUY: ')
+ str(get_etheur_buy_price())+color_cyan(' EUR'))
#else:
# Optional tick for the current price
#print clock+color_cyan(" ETH sell price: ")+str(etheur_sell_price),
color_cyan("EUR, ")+str(etheur_sell_price * CURR_EUR) \
+ color_cyan(" "+CURRENCY)
eth_monitor()
old_price = etheur_sell_price
threading.Timer(60, loopeth).start()
评论列表
文章目录