diff --git a/dabo/functions/webpage.sh b/dabo/functions/webpage.sh
index 26e84b9..1249bc6 100644
--- a/dabo/functions/webpage.sh
+++ b/dabo/functions/webpage.sh
@@ -1,5 +1,25 @@
+
+function genchart {
+ local lastmark=0
+ local mark=""
+ local file="$1"
+ local highest=$(sort -n "${file}" | tail -n1 | sed s/^-//)
+ local lowest=$(sort -n "${file}" | head -n1 | sed s/^-//)
+ local divideby=$(echo "$highest+$lowest" | bc -l)
+ local color="green"
+ tail -n1 "${file}" | grep -q "^-" && color="red"
+
+ echo "
+
$file
"
+ for mark in $(cat "${file}")
+ do
+ echo "
${mark} %
"
+ lastmark=${mark}
+ done
+ echo "
"
+}
+
function webpage {
-
g_echo_note "RUNNING FUNCTION ${FUNCNAME} $@"
# create status webpage
@@ -7,7 +27,8 @@ function webpage {
-' >../index.html.tmp
+
+' >../index.html.tmp
echo "Dabo! on ${STOCK_EXCHANGE} - ${URL}
" >>../index.html.tmp
echo "
State of Dabo-Bot! on ${STOCK_EXCHANGE} - ${URL} (ReadOnly)
@@ -143,13 +164,15 @@ function webpage {
${CURRENCY} Quantity
${CURRENCY} Price
Commission
-
Comment
" >>../index.html.tmp
+
Comment
+
Chart
" >>../index.html.tmp
local f_trade_file
for f_trade_file in $(ls -t trade-histories/trade-*-open.history.csv 2>/dev/null)
do
local tradeline=$(tail -n1 ${f_trade_file})
local asset=$(echo ${f_trade_file} | cut -d. -f3 | cut -d- -f1)
+ local interimfile=$(echo ${f_trade_file} | sed 's/open\.history\.csv/interim\.history\.csv/')
echo "
" >>../index.html.tmp
for f_trade_file in $(ls -t trade-histories/trade-*-closed.history.csv 2>/dev/null | head -n 50)
do
@@ -198,6 +225,7 @@ function webpage {
fi
fi
local asset=$(echo ${f_trade_file} | cut -d. -f3 | cut -d- -f1)
+ interimfile=$(echo ${f_trade_file} | sed 's/closed\.history\.csv/interim\.history\.csv/')
echo "