fix: market-performance for buy and sell

This commit is contained in:
olli 2023-05-25 09:23:54 +02:00
parent 804cb0fc8e
commit 32ce427a5a

View File

@ -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 "