force minimum 15 minutes (900 seconds) timeframe fpor EMA/MACD calculations
This commit is contained in:
parent
fdadf53051
commit
436dfe602e
@ -188,6 +188,10 @@ docker compose logs -f
|
||||
|
||||
Update:
|
||||
```
|
||||
# Optinal: Remove local data
|
||||
git reset --hard HEAD^ # Remove local commits
|
||||
git clean -fd # Remove local uncommited files
|
||||
|
||||
git pull -f --all
|
||||
```
|
||||
|
||||
|
@ -7,7 +7,14 @@ function get_ema {
|
||||
local f_lastvalue="$5"
|
||||
|
||||
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/\..*//')
|
||||
g_echo "ATTENTION!!!! Period lower then 15 minutes - correcting to $f_period"
|
||||
fi
|
||||
|
||||
# calculate EMA if last EMA is given
|
||||
if [ -n "$f_last_ema" ]
|
||||
then
|
||||
|
@ -42,7 +42,7 @@ function get_macd_indicator {
|
||||
f_macd_last_ema9_signal=$(echo "$f_second_lastline" | cut -d, -f7)
|
||||
f_macd_last_histogram=$(echo "$f_second_lastline" | cut -d, -f8)
|
||||
|
||||
# calc EMA12
|
||||
# calc EMA12
|
||||
get_ema "${f_hist_file}" 2 12 "${f_macd_last_ema12}" "${f_macd_lastprice}"
|
||||
if [ -z "${f_ema}" ]
|
||||
then
|
||||
|
Loading…
Reference in New Issue
Block a user