ccxt check for swap or spot by LEVERAGE

This commit is contained in:
olli 2024-03-26 15:07:14 +01:00
parent bddb49f63c
commit 9d86a49616

View File

@ -17,6 +17,8 @@ function f_ccxt {
g_python 'sys.path.append("/ccxt/python")' || return 1
g_python 'import ccxt' || return 1
sleep 0.5
local f_exchange_type="swap"
[ -z "$LEVERAGE" ] && f_exchange_type="spot"
g_python "exchange = ccxt.${STOCK_EXCHANGE,,}({'apiKey': '${API_KEY}','secret': '${API_SECRET}','options': {'defaultType': 'swap',},})" || return 1
f_ccxt_initialized=true
fi