diff --git a/dabo/functions/binance_convert.sh b/dabo/functions/binance_convert.sh index 9013fce..7411f0e 100644 --- a/dabo/functions/binance_convert.sh +++ b/dabo/functions/binance_convert.sh @@ -49,6 +49,7 @@ ${FUNCNAME} $@" cat ${g_tmp}/API_CMD_OUT >${f_CMDFILE}_QUOTE_OUT # get convert price local f_convert_price=$(cat ${f_CMDFILE}_QUOTE_OUT | grep '^{' | jq -r .inverseRatio | head -n1) + local f_price_diff=$(g_percentage-diff ${f_market_price} ${f_convert_price}) fi if [ "${f_ACTION}" = "sell" ] @@ -58,9 +59,9 @@ ${FUNCNAME} $@" cat ${g_tmp}/API_CMD_OUT >${f_CMDFILE}_QUOTE_OUT # get convert price local f_convert_price=$(cat ${f_CMDFILE}_QUOTE_OUT | grep '^{' | jq -r .ratio | head -n1) + local f_price_diff=$(g_percentage-diff ${f_convert_price} ${f_market_price}) fi - local f_price_diff=$(g_percentage-diff ${f_market_price} ${f_convert_price}) if [ $(echo "${f_price_diff} > ${FEE}" | bc -l) -eq 1 ] then local f_note="Price difference between Market Price (${f_market_price}) and Binance Convert Price (${f_convert_price}) is higher then Trading Fee (${f_price_diff} > ${FEE}), so I will better use trade then convert"