remove force minimum 15 minutes for macd because of timing problems.

This commit is contained in:
olli 2023-05-16 11:45:38 +02:00
parent 3f07618e1f
commit b9bce6ed7e
2 changed files with 2 additions and 10 deletions

View File

@ -8,12 +8,6 @@ function get_ema {
f_ema="" f_ema=""
# force minimum 15min timeframe
if [ $(echo "${INTERVAL} < 900" | bc -l) -ne 0 ]
then
f_period=$(echo "${f_period}*(900/${INTERVAL})" | bc -l | sed 's/\..*//')
fi
# calculate EMA if last EMA is given # calculate EMA if last EMA is given
if [ -n "$f_last_ema" ] if [ -n "$f_last_ema" ]
then then

View File

@ -21,8 +21,7 @@ function get_macd_indicator {
local f_lastline=$(tail -n1 "$f_hist_file" | grep ^2) local f_lastline=$(tail -n1 "$f_hist_file" | grep ^2)
# force min 15min 2 last lines # force min 15min 2 last lines
local f_last_macd_period=$(echo "2*(900/${INTERVAL})" | bc -l | sed 's/\..*//') local f_second_lastline=$(tail -n2"$f_hist_file" | head -n1 | grep ^2)
local f_second_lastline=$(tail -n${f_last_macd_period} "$f_hist_file" | head -n1 | grep ^2)
# Try to get current MACD values # Try to get current MACD values
local f_macd_lastprice=$(echo "$f_lastline" | cut -d, -f2) local f_macd_lastprice=$(echo "$f_lastline" | cut -d, -f2)
@ -109,8 +108,7 @@ function get_macd_indicator {
# calculate MACD Histogram relation # calculate MACD Histogram relation
if [ $(tail -n36 "${f_hist_file}" | wc -l) -ge 35 ] if [ $(tail -n36 "${f_hist_file}" | wc -l) -ge 35 ]
then then
local f_last_macd_relation_period=$(echo "35*(900/${INTERVAL})" | bc -l | sed 's/\..*//') local f_macd_histogram_max=$(tail -n350 "${f_hist_file}" | cut -d"," -f8 | egrep "^[0-9]|^-[0-9]" | sed 's/^-//' | sort -n | tail -n1)
local f_macd_histogram_max=$(tail -n${f_last_macd_relation_period} "${f_hist_file}" | cut -d"," -f8 | egrep "^[0-9]|^-[0-9]" | sed 's/^-//' | sort -n | tail -n1)
local f_macd_histogram_relation=$(echo "100+$(g_percentage-diff ${f_macd_histogram_max} ${f_macd_histogram})" | bc | sed 's/^\./0./; s/^-\./-0./' | cut -d\. -f1) local f_macd_histogram_relation=$(echo "100+$(g_percentage-diff ${f_macd_histogram_max} ${f_macd_histogram})" | bc | sed 's/^\./0./; s/^-\./-0./' | cut -d\. -f1)
fi fi