From e44461d321f6cefcabf9e91a74cbe93e812fc825 Mon Sep 17 00:00:00 2001 From: olli Date: Tue, 28 Nov 2023 17:25:37 +0100 Subject: [PATCH] analyze 2 analyze --- dabo/analyze.sh | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/dabo/analyze.sh b/dabo/analyze.sh index 0f5e2ec..8b4204f 100755 --- a/dabo/analyze.sh +++ b/dabo/analyze.sh @@ -101,7 +101,6 @@ function analyze { g_num_valid_number "${f_market_performance}" >/dev/null 2>&1 || f_market_performance=0 - echo "=== OPEN TRADE: ${f_open_trade}" if [ -n "${f_open_trade}" ] then if [ "${ANALYZE_VERBOSE}" -eq "0" ] @@ -118,7 +117,6 @@ function analyze { check_buy_conditions ${g_tmp}/${tmpfile} #| tee -a ${g_tmp}/output-${tmpfile} fi fi - echo "=== END " if [ -n "${f_BUY}" ] then @@ -128,18 +126,18 @@ function analyze { unset f_BUY fi -# 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 + 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