python ccxt

This commit is contained in:
olli 2024-03-26 14:09:06 +01:00
parent 3b16b56d27
commit 24fc7249a0
2 changed files with 13 additions and 12 deletions

View File

@ -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

View File

@ -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