ifs fix
This commit is contained in:
parent
723c95d8b1
commit
d17a448e66
@ -215,39 +215,6 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
## Chart Part
|
|
||||||
#for file in $@
|
|
||||||
#do
|
|
||||||
# tmpfile=$(basename "${file}")
|
|
||||||
# if [ -s "analyze-${analyzedate}/chart-${tmpfile}" ]
|
|
||||||
# then
|
|
||||||
# g_echo "generating chart for $file from analyze-${analyzedate}/chart-${tmpfile}"
|
|
||||||
# echo "<html><head>
|
|
||||||
#<meta charset='UTF-8'>
|
|
||||||
#<meta name='viewport' content='width=device-width, initial-scale=1'>
|
|
||||||
#<link rel='stylesheet' type='text/css' href='../data/browser.css'>
|
|
||||||
#<link rel='stylesheet' type='text/css' href='../data/charts.min.css'>
|
|
||||||
#<title>analyze.sh ${ANALYZE_TIME}</title>
|
|
||||||
#</head>
|
|
||||||
#<body>
|
|
||||||
#<h1>analyze.sh ${ANALYZE_TIME}</h1>
|
|
||||||
#" >analyze-${analyzedate}/chart-${tmpfile}.html
|
|
||||||
# echo "Price, EMA, Levels" >>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 "Score" >>analyze-${analyzedate}/chart-${tmpfile}.html
|
|
||||||
# genchart analyze-${analyzedate}/chart-${tmpfile} 500 42,46,45,41 Green,Red,Orange >>analyze-${analyzedate}/chart-${tmpfile}.html
|
|
||||||
# #echo "Sell Score" >>analyze-${analyzedate}/chart-${tmpfile}.html
|
|
||||||
# #genchart analyze-${analyzedate}/chart-${tmpfile} 500 42 green,blue >>analyze-${analyzedate}/chart-${tmpfile}.html
|
|
||||||
# echo "MACD" >>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
|
|
||||||
# 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
|
|
||||||
# fi
|
|
||||||
#done
|
|
||||||
# Chart Part End
|
|
||||||
|
|
||||||
|
|
||||||
analyzecounter=$(cat /tmp/overall-result-* | egrep -v "^0$" | wc -l)
|
analyzecounter=$(cat /tmp/overall-result-* | egrep -v "^0$" | wc -l)
|
||||||
echo "OVERALL RESULT (average): $(cat /tmp/overall-result-* | awk "{ SUM += \$1 / ${analyzecounter} } END { printf(\"%2.2f\", SUM) }")%" | tee analyze-${analyzedate}/overall-result.log
|
echo "OVERALL RESULT (average): $(cat /tmp/overall-result-* | awk "{ SUM += \$1 / ${analyzecounter} } END { printf(\"%2.2f\", SUM) }")%" | tee analyze-${analyzedate}/overall-result.log
|
||||||
echo "OVERALL RESULT: $(cat /tmp/overall-result-* | awk '{ SUM += $1 } END { print SUM }')%" | tee analyze-${analyzedate}/overall-result.log
|
echo "OVERALL RESULT: $(cat /tmp/overall-result-* | awk '{ SUM += $1 } END { print SUM }')%" | tee analyze-${analyzedate}/overall-result.log
|
||||||
|
@ -28,12 +28,10 @@ function get_vars_from_csv {
|
|||||||
f_last_4_price=$(echo ${f_last_4_prices} | head -n1)
|
f_last_4_price=$(echo ${f_last_4_prices} | head -n1)
|
||||||
f_last_4_prices_change=$(g_percentage-diff ${f_last_4_price} ${f_price})
|
f_last_4_prices_change=$(g_percentage-diff ${f_last_4_price} ${f_price})
|
||||||
|
|
||||||
local f_orig_ifs=${IFS}
|
if printf '%s\n' ${f_last_4_prices} | sort -n -C
|
||||||
IFS=\n
|
|
||||||
if echo ${f_last_4_prices} | sort -n -C
|
|
||||||
then
|
then
|
||||||
f_price_trend="constantly growing,${f_last_4_prices_change}"
|
f_price_trend="constantly growing,${f_last_4_prices_change}"
|
||||||
elif echo ${f_last_4_prices} | sort -n -r -C
|
elif printf '%s\n' ${f_last_4_prices} | sort -n -r -C
|
||||||
then
|
then
|
||||||
f_price_trend="constantly falling,${f_last_4_prices_change}"
|
f_price_trend="constantly falling,${f_last_4_prices_change}"
|
||||||
elif g_num_is_higher ${f_last_4_prices_change} 0
|
elif g_num_is_higher ${f_last_4_prices_change} 0
|
||||||
@ -47,7 +45,6 @@ function get_vars_from_csv {
|
|||||||
fi
|
fi
|
||||||
f_all_vars="$f_all_vars
|
f_all_vars="$f_all_vars
|
||||||
f_price_trend=${f_price_trend}"
|
f_price_trend=${f_price_trend}"
|
||||||
IFS=${f_orig_ifs}
|
|
||||||
|
|
||||||
# MACD EMA
|
# MACD EMA
|
||||||
get_var_from_line ema12 4
|
get_var_from_line ema12 4
|
||||||
|
Loading…
Reference in New Issue
Block a user