From 3b1873616c7ae414c35fb74d3e18a9acfa6e7ca2 Mon Sep 17 00:00:00 2001 From: olli Date: Tue, 28 Nov 2023 17:13:13 +0100 Subject: [PATCH] analyze 2 analyze --- dabo/analyze.sh | 37 ++++++++++++-------------- dabo/functions/check_buy_conditions.sh | 10 +++---- 2 files changed, 22 insertions(+), 25 deletions(-) diff --git a/dabo/analyze.sh b/dabo/analyze.sh index 9f95636..9b4c465 100755 --- a/dabo/analyze.sh +++ b/dabo/analyze.sh @@ -118,31 +118,28 @@ function analyze { check_buy_conditions ${g_tmp}/${tmpfile} #| tee -a ${g_tmp}/output-${tmpfile} fi fi - - if [ -n "$f_BUY" ] + + set -x + if [ -n "${f_BUY}" ] then - set -x echo "BUY: ${f_BUY}" f_open_trade=1 BUY_PRICE=$f_price - f_BUY="" - set +x - fi - - if [ -n "${f_SELL}" ] - then - set -x - echo "SELL: ${f_date} ${f_SELL}" - g_percentage-diff ${BUY_PRICE} ${f_price} - g_calc "${g_percentage_diff_result}-${FEE}" - result=${g_calc_result} - echo "${result}" >>${g_tmp}/result-${tmpfile} - rm -f "${f_TRADE_HIST_FILE}" - rm -f "${f_TRADE_HIST_FILE_INTERIM}" - unset f_open_trade - echo "RESULT: ${result}% (${BUY_PRICE} -> ${f_price})" - set +x fi + set +x + +# if [ -n "${f_SELL}" ] +# then +# echo "SELL: ${f_date} ${f_SELL}" +# g_percentage-diff ${BUY_PRICE} ${f_price} +# g_calc "${g_percentage_diff_result}-${FEE}" +# result=${g_calc_result} +# echo "${result}" >>${g_tmp}/result-${tmpfile} +# rm -f "${f_TRADE_HIST_FILE}" +# rm -f "${f_TRADE_HIST_FILE_INTERIM}" +# unset f_open_trade +# echo "RESULT: ${result}% (${BUY_PRICE} -> ${f_price})" +# fi ## Chart Part diff --git a/dabo/functions/check_buy_conditions.sh b/dabo/functions/check_buy_conditions.sh index 28187f2..5a1b078 100644 --- a/dabo/functions/check_buy_conditions.sh +++ b/dabo/functions/check_buy_conditions.sh @@ -44,11 +44,11 @@ function check_buy_conditions { done # if this checks came from sell function - if [ "$2" == "SELL" ] - then - [ -n "$f_BUY" ] && return 1 - return 0 - fi + #if [ "$2" == "SELL" ] + #then + # [ -n "$f_BUY" ] && return 1 + # return 0 + #fi ### Buy or not buy? # BOT