compare Trading and Convert price and use the cheaper variant - nicer output
This commit is contained in:
parent
f9000a3606
commit
ec3376f670
@ -27,7 +27,7 @@ function binance_convert {
|
|||||||
|
|
||||||
# get trade commission for comparison with convert
|
# get trade commission for comparison with convert
|
||||||
binance-api-call GET /sapi/v1/asset/tradeFee "&symbol=${f_ASSET}${f_CURRENCY}"
|
binance-api-call GET /sapi/v1/asset/tradeFee "&symbol=${f_ASSET}${f_CURRENCY}"
|
||||||
local FEE=$(echo "$(cat $g_tmp/API_CMD_OUT | jq -r .[].takerCommission)*100" | bc -l)
|
local FEE=$(echo "$(cat $g_tmp/API_CMD_OUT | jq -r .[].takerCommission)*100" | bc -l | sed 's/^\./0./; s/^-\./-0./')
|
||||||
|
|
||||||
if [ "${f_ACTION}" = "buy" ]
|
if [ "${f_ACTION}" = "buy" ]
|
||||||
then
|
then
|
||||||
@ -64,7 +64,7 @@ ${FUNCNAME} $@"
|
|||||||
|
|
||||||
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} ${f_CURRENCY}) and Binance Convert Price (${f_convert_price} ${f_CURRENCY}) is higher then Trading Fee (${f_price_diff}% > ${FEE}%), so I will better use trade then convert"
|
||||||
g_echo_note "$f_note"
|
g_echo_note "$f_note"
|
||||||
g_signal-notify "$f_note"
|
g_signal-notify "$f_note"
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
Reference in New Issue
Block a user