Compare commits

..

2 Commits

3 changed files with 12 additions and 7 deletions

View File

@ -33,6 +33,14 @@ touch firstloop
# am I the bot (important for functions used by analyze.sh # am I the bot (important for functions used by analyze.sh
echo $0 | grep -q "dabo-bot\.sh" && BOT=1 echo $0 | grep -q "dabo-bot\.sh" && BOT=1
# cleanup trashlines in asset-histories (possibly generated by kill further of this progress)
find asset-histories -name "*.csv" -type f | while read csv_file
do
csv_timestamp=$(ls --time-style='+%Y%m%d%H%M' -l "${csv_file}" | cut -d" " -f6)
sed -i "/[0-9]$(date +%Y)-/d" ${csv_file}
touch -t ${csv_timestamp} "${csv_file}"
done
# run endless loop # run endless loop
while true while true
do do

View File

@ -95,9 +95,6 @@ function get_assets {
export csv_headline export csv_headline
. /tmp/parallel . /tmp/parallel
# cleanup trashlines (possibly generated by kill further of this progress)
sed -i "/[0-9]$(date +%Y)-/d" asset-histories/*
# get MSCI World Index for analysis # get MSCI World Index for analysis
echo "wget -q -O - https://www.boerse.de/realtime-kurse/MSCI-World/XC0009692739 | egrep 'itemprop=\"price\" content=\"[0-9]+\.[0-9]+\"' | cut -d\\\" -f6" >MSCI_WORLD_CMD echo "wget -q -O - https://www.boerse.de/realtime-kurse/MSCI-World/XC0009692739 | egrep 'itemprop=\"price\" content=\"[0-9]+\.[0-9]+\"' | cut -d\\\" -f6" >MSCI_WORLD_CMD
g_runcmd g_retrycmd sh MSCI_WORLD_CMD >MSCI_WORLD_CMD_OUT.tmp g_runcmd g_retrycmd sh MSCI_WORLD_CMD >MSCI_WORLD_CMD_OUT.tmp

View File

@ -37,19 +37,19 @@ function webpage {
echo "<table> echo "<table>
<tr> <tr>
<td>Performance day (last 24 hours):</td> <td>Performance day (last 24 hours):</td>
<td> $(find trade-histories -name "*-closed.history.csv.result" -mtime -1 -exec cat {} \; | awk '{ SUM += $1} END { printf("%.2f", SUM) }')%</td> <td> $(find trade-histories -name "*-closed.history.csv.result" -mtime -1 -exec cat {} \; | awk "{ SUM += \$1} END { printf(\"%.2f\", SUM/100*${INVEST})}")%</td>
</td> </td>
<tr> <tr>
<td>Performance week (last 7 days):</td> <td>Performance week (last 7 days):</td>
<td> $(find trade-histories -name "*-closed.history.csv.result" -mtime -7 -exec cat {} \; | awk '{ SUM += $1} END { printf("%.2f", SUM) }')%</td> <td> $(find trade-histories -name "*-closed.history.csv.result" -mtime -7 -exec cat {} \; | awk "{ SUM += \$1} END { printf(\"%.2f\", SUM/100*${INVEST})}")%</td>
</tr> </tr>
<tr> <tr>
<td>Performance month (last 30 days):</td> <td>Performance month (last 30 days):</td>
<td> $(find trade-histories -name "*-closed.history.csv.result" -mtime -31 -exec cat {} \; | awk '{ SUM += $1} END { printf("%.2f", SUM) }')%</td> <td> $(find trade-histories -name "*-closed.history.csv.result" -mtime -31 -exec cat {} \; | awk "{ SUM += \$1} END { printf(\"%.2f\", SUM/100*${INVEST})}")%</td>
</tr> </tr>
<tr> <tr>
<td>Performance complete):</td> <td>Performance complete):</td>
<td> $(find trade-histories -name "*-closed.history.csv.result" -exec cat {} \; | awk '{ SUM += $1} END { printf("%.2f", SUM) }')%</td> <td> $(find trade-histories -name "*-closed.history.csv.result" -exec cat {} \; | awk "{ SUM += \$1} END { printf(\"%.2f\", SUM/100*${INVEST}) }")%</td>
</tr> </tr>
</table>" >>../index.html.tmp </table>" >>../index.html.tmp