added chart

This commit is contained in:
olli 2023-10-28 14:47:01 +02:00
parent b5b15a0896
commit 2502ac780d

View File

@ -48,7 +48,7 @@ function analyze {
IFS=$'\n' IFS=$'\n'
# Chart Part # Chart Part
head -n1 ${file} >analyze-${analyzedate}/chart-${tmpfile}.csv head -n1 ${file} >analyze-${analyzedate}/chart-${tmpfile}
# Chart Part End # Chart Part End
for line in $(egrep "^${ANALYZE_TIME}" "$file" | grep -v ',,') for line in $(egrep "^${ANALYZE_TIME}" "$file" | grep -v ',,')
@ -59,7 +59,7 @@ function analyze {
f_market_performance=$(grep "^$time" data/botdata/MARKET_PERFORMANCE | tail -n1 | cut -d: -f4 | cut -d"%" -f1 | sed 's/ *//') f_market_performance=$(grep "^$time" data/botdata/MARKET_PERFORMANCE | tail -n1 | cut -d: -f4 | cut -d"%" -f1 | sed 's/ *//')
echo "$line" >>${g_tmp}/${tmpfile} echo "$line" >>${g_tmp}/${tmpfile}
# Chart Part # Chart Part
echo "$line,${f_market_performance},${f_score}" >>analyze-${analyzedate}/chart-${tmpfile}.csv echo "$line,${f_market_performance},${f_score}" >>analyze-${analyzedate}/chart-${tmpfile}
# Chart Part End # Chart Part End
echo " ${line},${f_market_performance}" | perl -pe 's/([0-9].[0-9][0-9][0-9][0-9][0-9][0-9])[0-9]+/$1/g' | column -t -s, >>${g_tmp}/output-${tmpfile} echo " ${line},${f_market_performance}" | perl -pe 's/([0-9].[0-9][0-9][0-9][0-9][0-9][0-9])[0-9]+/$1/g' | column -t -s, >>${g_tmp}/output-${tmpfile}
if [ -f "${g_tmp}/open-${tmpfile}" ] if [ -f "${g_tmp}/open-${tmpfile}" ]
@ -167,9 +167,10 @@ fi
for file in $@ for file in $@
do do
tmpfile=$(basename "${file}") tmpfile=$(basename "${file}")
g_echo "generating chart for $file" if [ -s "analyze-${analyzedate}/chart-${tmpfile}" ]
echo "<html> then
<head> g_echo "generating chart for $file from analyze-${analyzedate}/chart-${tmpfile}"
echo "<html><head>
<meta charset='UTF-8'> <meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'> <meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' type='text/css' href='../dabo/data/browser.css'> <link rel='stylesheet' type='text/css' href='../dabo/data/browser.css'>
@ -180,12 +181,13 @@ do
<h1>analyze.sh ${ANALYZE_TIME}</h1> <h1>analyze.sh ${ANALYZE_TIME}</h1>
" >analyze-${analyzedate}/chart-${tmpfile}.html " >analyze-${analyzedate}/chart-${tmpfile}.html
echo "Price, EMA, Levels" >>analyze-${analyzedate}/chart-${tmpfile}.html echo "Price, EMA, Levels" >>analyze-${analyzedate}/chart-${tmpfile}.html
genchart analyze-${analyzedate}/chart-${tmpfile}.csv 500 2,25,26,27,28,29,30,31,32,33,34,35,4,36,37,38,39 green,DarkSlateGrey,DarkSlateGrey,Gold,DarkOrange,DarkOrange,GoldenRod,GoldenRod,GoldenRod,GoldenRod,DarkOrange,DarkOrange,MidnightBlue,Indigo,DarkSlateBlue,DodgerBlue,DeepSkyBlue >>analyze-${analyzedate}/chart-${tmpfile}.html genchart analyze-${analyzedate}/chart-${tmpfile} 500 2,25,26,27,28,29,30,31,32,33,34,35,4,36,37,38,39 green,DarkSlateGrey,DarkSlateGrey,Gold,DarkOrange,DarkOrange,GoldenRod,GoldenRod,GoldenRod,GoldenRod,DarkOrange,DarkOrange,MidnightBlue,Indigo,DarkSlateBlue,DodgerBlue,DeepSkyBlue >>analyze-${analyzedate}/chart-${tmpfile}.html
echo "MACD" >>analyze-${analyzedate}/chart-${tmpfile}.html echo "MACD" >>analyze-${analyzedate}/chart-${tmpfile}.html
genchart analyze-${analyzedate}/chart-${tmpfile}.csv 500 8,6,7 >>analyze-${analyzedate}/chart-${tmpfile}.html genchart analyze-${analyzedate}/chart-${tmpfile} 500 8,6,7 >>analyze-${analyzedate}/chart-${tmpfile}.html
echo "RSIs" >>analyze-${analyzedate}/chart-${tmpfile}.html echo "RSIs" >>analyze-${analyzedate}/chart-${tmpfile}.html
genchart analyze-${analyzedate}/chart-${tmpfile}.csv 500 10,11,12,14,15,16,17,13 >>analyze-${analyzedate}/chart-${tmpfile}.html genchart analyze-${analyzedate}/chart-${tmpfile} 500 10,11,12,14,15,16,17,13 >>analyze-${analyzedate}/chart-${tmpfile}.html
echo "</body></html>">>analyze-${analyzedate}/chart-${tmpfile}.html echo "</body></html>">>analyze-${analyzedate}/chart-${tmpfile}.html
fi
done done
# Chart Part End # Chart Part End