better performance no sleep necessary
This commit is contained in:
parent
400dfc3fb9
commit
9e918401e7
@ -21,12 +21,9 @@ function f_ccxt {
|
|||||||
local f_exchange_type="swap"
|
local f_exchange_type="swap"
|
||||||
[ -z "$LEVERAGE" ] && f_exchange_type="spot"
|
[ -z "$LEVERAGE" ] && f_exchange_type="spot"
|
||||||
g_python "exchange = ccxt.${STOCK_EXCHANGE,,}({'apiKey': '${API_KEY}','secret': '${API_SECRET}','options': {'defaultType': '${f_exchange_type}',},})" || return 1
|
g_python "exchange = ccxt.${STOCK_EXCHANGE,,}({'apiKey': '${API_KEY}','secret': '${API_SECRET}','options': {'defaultType': '${f_exchange_type}',},})" || return 1
|
||||||
sleep 5
|
|
||||||
f_ccxt_initialized=true
|
f_ccxt_initialized=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
g_python_waitforoutput=1
|
|
||||||
g_python "$@" || return 1
|
g_python "$@" || return 1
|
||||||
unset f_ccxt_result
|
unset f_ccxt_result
|
||||||
f_ccxt_result=${g_python_result[*]}
|
f_ccxt_result=${g_python_result[*]}
|
||||||
|
@ -16,8 +16,12 @@ function get_assets {
|
|||||||
bitpanda-api-call GET "public/v1/market-ticker" || return 1
|
bitpanda-api-call GET "public/v1/market-ticker" || return 1
|
||||||
#cat ${g_tmp}/API_CMD_OUT | jq -r '.[] | select(.state=="ACTIVE") | .instrument_code + "," + .last_price' | sed 's/_//' | grep "${CURRENCY}," | egrep -v "${TRANSFER_CURRENCY},|,0[\.][0]*$" >${f_filename}_OUT.tmp
|
#cat ${g_tmp}/API_CMD_OUT | jq -r '.[] | select(.state=="ACTIVE") | .instrument_code + "," + .last_price' | sed 's/_//' | grep "${CURRENCY}," | egrep -v "${TRANSFER_CURRENCY},|,0[\.][0]*$" >${f_filename}_OUT.tmp
|
||||||
cat ${g_tmp}/API_CMD_OUT | jq -r '.[] | .instrument_code + "," + .last_price' | sed 's/_//' | grep "${CURRENCY}," | egrep -v "${TRANSFER_CURRENCY},|,0[\.][0]*$" >${f_filename}_OUT.tmp
|
cat ${g_tmp}/API_CMD_OUT | jq -r '.[] | .instrument_code + "," + .last_price' | sed 's/_//' | grep "${CURRENCY}," | egrep -v "${TRANSFER_CURRENCY},|,0[\.][0]*$" >${f_filename}_OUT.tmp
|
||||||
else
|
elif [ ${STOCK_EXCHANGE} = "NONE" ]
|
||||||
|
then
|
||||||
f_no_exchange=1
|
f_no_exchange=1
|
||||||
|
else
|
||||||
|
#f_ccxt "print(exchange.fetch_tickers())" && echo $f_ccxt_result >CCXT_TICKERS
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
cat ${g_tmp}/API_CMD_OUT >PRICETICKER
|
cat ${g_tmp}/API_CMD_OUT >PRICETICKER
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user