Top and Flop 10 in Webpage

This commit is contained in:
olli 2023-06-22 15:58:28 +02:00
parent 7b0ae0c576
commit b69601abf2

View File

@ -80,6 +80,19 @@ function webpage {
echo -e "<pre>$(egrep ":00:" MARKET_PERFORMANCE | tail -n10)\n$(tail -n1 MARKET_PERFORMANCE)</pre>" >>../index.html.tmp
echo "<a href=\"botdata/MARKET_PERFORMANCE\">Complete list</a>" >>../index.html.tmp
echo "<h2>Top/Flop</h2>" >>../index.html.tmp
ls -1 trade-histories/*.result | cut -d . -f3-6 | sort -u | while read f_asset_results
do
f_asset=$(echo ${f_asset_results} | cut -d\- -f1)
echo $(cat trade-histories/*${f_asset_results} | awk "{ SUM += \$1} END { printf(\"%.2f\", SUM)}") >trade-histories/${f_asset}.complete_result
done
echo "<h3>Top 10</h3>" >>../index.html.tmp
grep [0-9] trade-histories/*.complete_result | sort -t: -k2 -rn | head -n 10 | cut -d/ -f2 | perl -pe 's/\.complete_result:/ /; s/$/%/' >>../index.html.tmp
echo "<h3>Flop 10</h3>" >>../index.html.tmp
grep [0-9] trade-histories/*.complete_result | sort -t: -k2 -n | head -n 10 | cut -d/ -f2 | perl -pe 's/\.complete_result:/ /; s/$/%/' >>../index.html.tmp
echo '<h2>Latest trades</h2>' >>../index.html.tmp
echo '<h3>Open</h3>' >>../index.html.tmp