fix: dont run exchnage specific functions if STOCK_EXCHANGE is NONE

This commit is contained in:
olli 2024-02-07 11:54:25 +01:00
parent ae99194986
commit ad6f641c8c

View File

@ -98,11 +98,6 @@ do
## watch some manual defined assets ## watch some manual defined assets
watch_assets watch_assets
## if STOCK_EXCHANGE is present
if [ "${STOCK_EXCHANGE}" != "NONE" ]
then
# stock data # stock data
if [ "${STOCK_EXCHANGE}" = "BINANCE" ] if [ "${STOCK_EXCHANGE}" = "BINANCE" ]
then then
@ -114,6 +109,9 @@ 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
## stop here if STOCK_EXCHANGE not present
continue
fi fi
# Get current assets # Get current assets
@ -128,8 +126,6 @@ do
# Buy something? # Buy something?
[ ${FULL_LOOP} = 1 ] && check_for_buy [ ${FULL_LOOP} = 1 ] && check_for_buy
fi
## Update webpage ## Update webpage
if jobs | egrep -q "Running.+webpage" && [ ${FULL_LOOP} = 1 ] if jobs | egrep -q "Running.+webpage" && [ ${FULL_LOOP} = 1 ]
then then