force minimum 15 minutes (900 seconds) timeframe foor EMA/MACD calculations
This commit is contained in:
parent
fe591c169f
commit
3f07618e1f
@ -109,7 +109,8 @@ 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_macd_histogram_max=$(tail -n60 "${f_hist_file}" | cut -d"," -f8 | egrep "^[0-9]|^-[0-9]" | sed 's/^-//' | sort -n | tail -n1)
|
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_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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user