From 27bf1920a3eb39856c58fc4b4b9a7f5151509e40 Mon Sep 17 00:00:00 2001 From: olli Date: Wed, 1 Nov 2023 13:57:11 +0100 Subject: [PATCH] fix --- dabo/functions/check_sell_conditions.sh | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/dabo/functions/check_sell_conditions.sh b/dabo/functions/check_sell_conditions.sh index 40a5418..dd6d3d3 100644 --- a/dabo/functions/check_sell_conditions.sh +++ b/dabo/functions/check_sell_conditions.sh @@ -13,13 +13,6 @@ function check_sell_conditions { ### check current result - # result values (sould be reduced to one - f_result!?) - f_result=$(g_percentage-diff ${f_BUY_PRICE} ${f_price}) - f_BUY_PRICE_LAST_RATE_DIFF=${f_result} - result=${f_BUY_PRICE_LAST_RATE_DIFF} - f_real_result=$(echo "${f_result}-${FEE}" | bc) - - # bot if [ -n "${BOT}" ] then @@ -36,14 +29,17 @@ function check_sell_conditions { f_BUY_PRICE=${BUY_PRICE} f_TRADE_HIST_FILE="${g_tmp}/open-${tmpfile}" f_TRADE_HIST_FILE_INTERIM="${g_tmp}/interim-${tmpfile}" - echo "INTERIM RESULT: ${f_BUY_PRICE_LAST_RATE_DIFF}%" fi -# # result values (sould be reduced to one - f_result!?) -# f_result=$(g_percentage-diff ${f_BUY_PRICE} ${f_price}) -# f_BUY_PRICE_LAST_RATE_DIFF=${f_result} -# result=${f_BUY_PRICE_LAST_RATE_DIFF} -# f_real_result=$(echo "${f_result}-${FEE}" | bc) + # result values (sould be reduced to one - f_result!?) + f_result=$(g_percentage-diff ${f_BUY_PRICE} ${f_price}) + f_BUY_PRICE_LAST_RATE_DIFF=${f_result} + result=${f_BUY_PRICE_LAST_RATE_DIFF} + f_real_result=$(echo "${f_result}-${FEE}" | bc) + + # analyze + [ -z "${BOT}" ] && echo "INTERIM RESULT: ${f_BUY_PRICE_LAST_RATE_DIFF}%" + # store new interim result echo ${f_BUY_PRICE_LAST_RATE_DIFF} >>${f_TRADE_HIST_FILE_INTERIM}