force minimum 15 minutes (900 seconds) timeframe fpor EMA/MACD calculations

This commit is contained in:
olli 2023-05-15 15:37:49 +02:00
parent fdadf53051
commit 436dfe602e
3 changed files with 13 additions and 2 deletions

View File

@ -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
```

View File

@ -8,6 +8,13 @@ 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/\..*//')
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