From 24fc7249a0e616787cf69b25fb906fb0b418f43f Mon Sep 17 00:00:00 2001 From: olli Date: Tue, 26 Mar 2024 14:09:06 +0100 Subject: [PATCH] python ccxt --- dabo/dabo-bot.sh | 24 ++++++++++++------------ dabo/functions/ccxt.sh | 1 + 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/dabo/dabo-bot.sh b/dabo/dabo-bot.sh index 0963738..28c2ce5 100755 --- a/dabo/dabo-bot.sh +++ b/dabo/dabo-bot.sh @@ -118,25 +118,25 @@ do fi # Get current assets - #get_assets || continue + get_assets || continue # Sell something? - #check_for_sell + check_for_sell # Get current balances - #[ ${FULL_LOOP} = 1 ] && get_ccxt_balances || continue - get_ccxt_balances || continue + [ ${FULL_LOOP} = 1 ] && get_ccxt_balances || continue + [ ${FULL_LOOP} = 1 ] && get_balances || continue # Buy something? - #[ ${FULL_LOOP} = 1 ] && check_for_buy + [ ${FULL_LOOP} = 1 ] && check_for_buy - ## Update webpage - #if jobs | egrep -q "Running.+webpage" && [ ${FULL_LOOP} = 1 ] - #then - # g_echo_note "webpage already running" - #else - # webpage & - #fi + # Update webpage + if jobs | egrep -q "Running.+webpage" && [ ${FULL_LOOP} = 1 ] + then + g_echo_note "webpage already running" + else + webpage & + fi done diff --git a/dabo/functions/ccxt.sh b/dabo/functions/ccxt.sh index becba2f..7d48c90 100644 --- a/dabo/functions/ccxt.sh +++ b/dabo/functions/ccxt.sh @@ -16,6 +16,7 @@ function f_ccxt { g_python 'import sys' || return 1 g_python 'sys.path.append("/ccxt/python")' || return 1 g_python 'import ccxt' || return 1 + sleep 0.5 g_python "exchange = ccxt.${STOCK_EXCHANGE}({'apiKey': '${API_KEY}','secret': '${API_SECRET}','options': {'defaultType': 'swap',},})" || return 1 f_ccxt_initialized=true fi