tmp path
This commit is contained in:
parent
55c6303f0f
commit
7baed40c0f
@ -111,30 +111,32 @@ do
|
|||||||
then
|
then
|
||||||
TOKEN_INFO_CMD="bitpanda_get_token_info"
|
TOKEN_INFO_CMD="bitpanda_get_token_info"
|
||||||
TRADE_CMD='bitpanda-api-call POST public/v1/account/orders "--header \"Content-Type: application/json\" --data \"{\\\"instrument_code\\\":\\\"TOKEN\\\",\\\"side\\\":\\\"ACTION\\\",\\\"type\\\":\\\"MARKET\\\",\\\"amount\\\":\\\"QUANTITY\\\"}\""'
|
TRADE_CMD='bitpanda-api-call POST public/v1/account/orders "--header \"Content-Type: application/json\" --data \"{\\\"instrument_code\\\":\\\"TOKEN\\\",\\\"side\\\":\\\"ACTION\\\",\\\"type\\\":\\\"MARKET\\\",\\\"amount\\\":\\\"QUANTITY\\\"}\""'
|
||||||
else
|
elif [ "${STOCK_EXCHANGE}" = "NONE" ]
|
||||||
|
then
|
||||||
## stop here if STOCK_EXCHANGE not present
|
## stop here if STOCK_EXCHANGE not present
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get current assets
|
# Get current assets
|
||||||
get_assets || continue
|
#get_assets || continue
|
||||||
|
|
||||||
# Sell something?
|
# Sell something?
|
||||||
check_for_sell
|
#check_for_sell
|
||||||
|
|
||||||
# Get current balances
|
# Get current balances
|
||||||
[ ${FULL_LOOP} = 1 ] && get_balances || continue
|
#[ ${FULL_LOOP} = 1 ] && get_ccxt_balances || continue
|
||||||
|
get_ccxt_balances || continue
|
||||||
|
|
||||||
# Buy something?
|
# Buy something?
|
||||||
[ ${FULL_LOOP} = 1 ] && check_for_buy
|
#[ ${FULL_LOOP} = 1 ] && check_for_buy
|
||||||
|
|
||||||
## Update webpage
|
## Update webpage
|
||||||
if jobs | egrep -q "Running.+webpage" && [ ${FULL_LOOP} = 1 ]
|
#if jobs | egrep -q "Running.+webpage" && [ ${FULL_LOOP} = 1 ]
|
||||||
then
|
#then
|
||||||
g_echo_note "webpage already running"
|
# g_echo_note "webpage already running"
|
||||||
else
|
#else
|
||||||
webpage &
|
# webpage &
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -7,17 +7,26 @@ function f_ccxt {
|
|||||||
g_echo_error "No secrets found (/dabo/.${STOCK_EXCHANGE}-secrets) found"
|
g_echo_error "No secrets found (/dabo/.${STOCK_EXCHANGE}-secrets) found"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
g_python 'import os' || return 1
|
|
||||||
g_python 'import sys' || return 1
|
|
||||||
|
|
||||||
g_python 'sys.path.append("/ccxt/python")' || return 1
|
|
||||||
|
|
||||||
g_python 'import ccxt' || return 1
|
# Initialize ccxt in python
|
||||||
|
if [ -z "$g_python_running" ] || [ -z "$f_ccxt_initialized" ]
|
||||||
g_python "exchange = ccxt.${STOCK_EXCHANGE}({'apiKey': '${API_KEY}','secret': '${API_SECRET}','options': {'defaultType': 'swap',},})" || return 1
|
then
|
||||||
|
g_python 'import os' || return 1
|
||||||
g_python_wantoutput=1
|
g_python 'import sys' || return 1
|
||||||
g_python 'print(exchange.fetch_balance ({"currency": "USDT"}))' || return 1
|
|
||||||
|
g_python 'sys.path.append("/ccxt/python")' || return 1
|
||||||
|
|
||||||
|
g_python 'import ccxt' || return 1
|
||||||
|
|
||||||
|
g_python "exchange = ccxt.${STOCK_EXCHANGE}({'apiKey': '${API_KEY}','secret': '${API_SECRET}','options': {'defaultType': 'swap',},})" || return 1
|
||||||
|
|
||||||
|
f_ccxt_initialized=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
g_python_waitforoutput=1
|
||||||
|
g_python "$@" || return 1
|
||||||
|
unset f_ccxt_result
|
||||||
|
f_ccxt_result=${g_python_result[*]}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user