diff --git a/dabo/functions/get_ema.sh b/dabo/functions/get_ema.sh index 5b8fd6b..9e316d6 100644 --- a/dabo/functions/get_ema.sh +++ b/dabo/functions/get_ema.sh @@ -8,12 +8,6 @@ function get_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 if [ -n "$f_last_ema" ] then diff --git a/dabo/functions/get_macd_indicator.sh b/dabo/functions/get_macd_indicator.sh index 1d02963..a9f029a 100644 --- a/dabo/functions/get_macd_indicator.sh +++ b/dabo/functions/get_macd_indicator.sh @@ -21,8 +21,7 @@ function get_macd_indicator { local f_lastline=$(tail -n1 "$f_hist_file" | grep ^2) # force min 15min 2 last lines - local f_last_macd_period=$(echo "2*(900/${INTERVAL})" | bc -l | sed 's/\..*//') - local f_second_lastline=$(tail -n${f_last_macd_period} "$f_hist_file" | head -n1 | grep ^2) + local f_second_lastline=$(tail -n2"$f_hist_file" | head -n1 | grep ^2) # Try to get current MACD values local f_macd_lastprice=$(echo "$f_lastline" | cut -d, -f2) @@ -109,8 +108,7 @@ function get_macd_indicator { # calculate MACD Histogram relation if [ $(tail -n36 "${f_hist_file}" | wc -l) -ge 35 ] then - local f_last_macd_relation_period=$(echo "35*(900/${INTERVAL})" | bc -l | sed 's/\..*//') - 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_max=$(tail -n350 "${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) fi