From 32ce427a5a841ec4fb2a9f6e413a6ce55ee01cfd Mon Sep 17 00:00:00 2001 From: olli Date: Thu, 25 May 2023 09:23:54 +0200 Subject: [PATCH] fix: market-performance for buy and sell --- dabo/analyze.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dabo/analyze.sh b/dabo/analyze.sh index c40b458..99eb3bf 100755 --- a/dabo/analyze.sh +++ b/dabo/analyze.sh @@ -44,6 +44,7 @@ function analyze { IFS="$ORIGIFS" current=$(echo $line | cut -d, -f2) time=$(echo $line | cut -d, -f1 | cut -d: -f1,2) + f_market_performance=$(grep "^$time" data/botdata/MARKET_PERFORMANCE | tail -n1 | cut -d: -f4 | cut -d"%" -f1 | sed 's/ *//') echo "$line" >>${g_tmp}/${tmpfile} if [ -f "${g_tmp}/open-${tmpfile}" ] then @@ -56,7 +57,6 @@ function analyze { fi if ! [ -f "${g_tmp}/open-${tmpfile}" ] then - f_market_performance=$(grep "^$time" data/botdata/MARKET_PERFORMANCE | tail -n1 | cut -d: -f4 | cut -d"%" -f1 | sed 's/ *//') if [ "${ANALYZE_VERBOSE}" -eq "0" ] then check_buy_conditions ${g_tmp}/${tmpfile} >>${g_tmp}/output-${tmpfile} 2>&1 @@ -87,7 +87,7 @@ function analyze { hodlresult=$(g_percentage-diff $(egrep "^${ANALYZE_TIME}" "$file" | grep -v ',,' | head -n1 | cut -d, -f2) $(egrep "^${ANALYZE_TIME}" "$file" | grep -v ',,' | tail -n1 | cut -d, -f2)) - echo "COMPLETE RESULT $file analyze-${analyzedate}/${tmpfile}.log: ${complete_result}% (HODL: ${hodlresult})" | tee -a ${g_tmp}/output-${tmpfile} + echo "COMPLETE-RESULT ${complete_result}% (HODL:${hodlresult}%) -> $file analyze-${analyzedate}/${tmpfile}.log" | perl -pe 's/ /\t/g' | tee -a ${g_tmp}/output-${tmpfile} echo "=====================================" >>${g_tmp}/output-${tmpfile} echo "${complete_result}" >>${g_tmp}/overall-result-${tmpfile} @@ -162,7 +162,7 @@ echo "First interim result after BUY neutral 0.00: $(grep "BUY: " -A6 analyze-${ echo " Complete Results" >>analyze-${analyzedate}/overall-result.log -grep "COMPLETE RESULT " analyze-${analyzedate}/analyze-overall.log | grep -v ": 0%" >>analyze-${analyzedate}/overall-result.log +grep "COMPLETE-RESULT " analyze-${analyzedate}/analyze-overall.log | grep -v ": 0%" >>analyze-${analyzedate}/overall-result.log echo "