diff --git a/dabo/analyze.sh b/dabo/analyze.sh index 617464f..069ba0a 100755 --- a/dabo/analyze.sh +++ b/dabo/analyze.sh @@ -128,7 +128,6 @@ do else analyze ${file} fi - analyzecounter=$((analyzecounter+1)) done @@ -140,7 +139,7 @@ then . /tmp/parallel-$$ 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 cat analyze-${analyzedate}/*.history.csv.log >analyze-${analyzedate}/analyze-overall.log echo "" | tee -a analyze-${analyzedate}/overall-result.log diff --git a/dabo/functions/check_buy_conditions.sh b/dabo/functions/check_buy_conditions.sh index 3ee5ba6..ddf4fc7 100644 --- a/dabo/functions/check_buy_conditions.sh +++ b/dabo/functions/check_buy_conditions.sh @@ -96,7 +96,7 @@ ${f_BUY}" then echo "BUY: ${f_echo_prefix}${f_BUY}" 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} BUY_PRICE=$current f_BUY="" diff --git a/dabo/functions/check_sell_conditions.sh b/dabo/functions/check_sell_conditions.sh index b8c37ca..b4e22ac 100644 --- a/dabo/functions/check_sell_conditions.sh +++ b/dabo/functions/check_sell_conditions.sh @@ -78,7 +78,7 @@ function check_sell_conditions { then echo "SELL: $(tail -n1 ${f_ASSET_HIST_FILE} | cut -d, -f1)" 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}" result=$(g_percentage-diff ${BUY_PRICE} ${current}) result=$(echo "${result}-${FEE}" | bc | sed 's/^\./0./; s/^-\./-0./')