compare Trading and Convert price and use the cheaper variant fix
This commit is contained in:
parent
9f9b236c61
commit
f9000a3606
@ -49,6 +49,7 @@ ${FUNCNAME} $@"
|
|||||||
cat ${g_tmp}/API_CMD_OUT >${f_CMDFILE}_QUOTE_OUT
|
cat ${g_tmp}/API_CMD_OUT >${f_CMDFILE}_QUOTE_OUT
|
||||||
# get convert price
|
# get convert price
|
||||||
local f_convert_price=$(cat ${f_CMDFILE}_QUOTE_OUT | grep '^{' | jq -r .inverseRatio | head -n1)
|
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
|
fi
|
||||||
|
|
||||||
if [ "${f_ACTION}" = "sell" ]
|
if [ "${f_ACTION}" = "sell" ]
|
||||||
@ -58,9 +59,9 @@ ${FUNCNAME} $@"
|
|||||||
cat ${g_tmp}/API_CMD_OUT >${f_CMDFILE}_QUOTE_OUT
|
cat ${g_tmp}/API_CMD_OUT >${f_CMDFILE}_QUOTE_OUT
|
||||||
# get convert price
|
# get convert price
|
||||||
local f_convert_price=$(cat ${f_CMDFILE}_QUOTE_OUT | grep '^{' | jq -r .ratio | head -n1)
|
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
|
fi
|
||||||
|
|
||||||
local f_price_diff=$(g_percentage-diff ${f_market_price} ${f_convert_price})
|
|
||||||
if [ $(echo "${f_price_diff} > ${FEE}" | bc -l) -eq 1 ]
|
if [ $(echo "${f_price_diff} > ${FEE}" | bc -l) -eq 1 ]
|
||||||
then
|
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"
|
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user