better analyze.sh output

This commit is contained in:
olli 2023-05-24 15:34:44 +02:00
parent 63e603b00a
commit a02b1ac350
3 changed files with 3 additions and 4 deletions

View File

@ -128,7 +128,6 @@ do
else else
analyze ${file} analyze ${file}
fi fi
analyzecounter=$((analyzecounter+1))
done done
@ -140,7 +139,7 @@ then
. /tmp/parallel-$$ . /tmp/parallel-$$
fi fi
analyzecounter=$(cat ${g_tmp}/overall-result-* | egrep -v "^0$" | wc -l)
echo "OVERALL RESULT (average): $(cat ${g_tmp}/overall-result-* | awk "{ SUM += \$1 / ${analyzecounter} } END { printf(\"%2.2f\", SUM) }")%" | tee analyze-${analyzedate}/overall-result.log echo "OVERALL RESULT (average): $(cat ${g_tmp}/overall-result-* | awk "{ SUM += \$1 / ${analyzecounter} } END { printf(\"%2.2f\", SUM) }")%" | tee analyze-${analyzedate}/overall-result.log
cat analyze-${analyzedate}/*.history.csv.log >analyze-${analyzedate}/analyze-overall.log cat analyze-${analyzedate}/*.history.csv.log >analyze-${analyzedate}/analyze-overall.log
echo "" | tee -a analyze-${analyzedate}/overall-result.log echo "" | tee -a analyze-${analyzedate}/overall-result.log

View File

@ -96,7 +96,7 @@ ${f_BUY}"
then then
echo "BUY: ${f_echo_prefix}${f_BUY}" echo "BUY: ${f_echo_prefix}${f_BUY}"
echo "${csv_headline},Marketperformance echo "${csv_headline},Marketperformance
${f_last_line},${f_market_performance}" | cut -d, -f 2-22 | perl -pe 's/((?<=,)|(?<=^)),/ ,/g;' | column -t -s, ${f_last_line}" | cut -d, -f 2-22 | perl -pe 's/((?<=,)|(?<=^)),/ ,/g;' | column -t -s,
echo "$f_BUY" >${g_tmp}/open-${tmpfile} echo "$f_BUY" >${g_tmp}/open-${tmpfile}
BUY_PRICE=$current BUY_PRICE=$current
f_BUY="" f_BUY=""

View File

@ -78,7 +78,7 @@ function check_sell_conditions {
then then
echo "SELL: $(tail -n1 ${f_ASSET_HIST_FILE} | cut -d, -f1)" echo "SELL: $(tail -n1 ${f_ASSET_HIST_FILE} | cut -d, -f1)"
echo "${csv_headline},Marketperformace echo "${csv_headline},Marketperformace
${f_last_line},${f_market_performance}" | cut -d, -f 2-222 | perl -pe 's/((?<=,)|(?<=^)),/ ,/g;' | column -t -s, ${f_last_line}" | cut -d, -f 2-222 | perl -pe 's/((?<=,)|(?<=^)),/ ,/g;' | column -t -s,
echo "${f_SELL}" echo "${f_SELL}"
result=$(g_percentage-diff ${BUY_PRICE} ${current}) result=$(g_percentage-diff ${BUY_PRICE} ${current})
result=$(echo "${result}-${FEE}" | bc | sed 's/^\./0./; s/^-\./-0./') result=$(echo "${result}-${FEE}" | bc | sed 's/^\./0./; s/^-\./-0./')