From 6c0c786c704cd26eb10d77d3e37e112f6b6a9473 Mon Sep 17 00:00:00 2001 From: olli Date: Tue, 17 Dec 2024 13:03:59 +0100 Subject: [PATCH] fixes if no EMA200 data available --- docker-compose.yml | 2 +- strategies/example.strategy.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d19993a..9c8ed6f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -166,7 +166,7 @@ services: resources: limits: cpus: '1' - memory: 2048M + memory: 512M dabo-calc-levels: build: diff --git a/strategies/example.strategy.sh b/strategies/example.strategy.sh index 046db1f..e3365f4 100644 --- a/strategies/example.strategy.sh +++ b/strategies/example.strategy.sh @@ -25,7 +25,7 @@ do g_echo "scoring ECONOMY_${asset}" # bullish? bull market? - if g_num_is_higher ${v[ECONOMY_${asset}_15m_close_0]} ${v[ECONOMY_${asset}_1d_ema200_0]} + [ -n "${v[ECONOMY_${asset}_1d_ema200_0]}" ] && if g_num_is_higher ${v[ECONOMY_${asset}_15m_close_0]} ${v[ECONOMY_${asset}_1d_ema200_0]} then score 2 "${asset} EMA200 over last 15m close" else @@ -55,7 +55,7 @@ do g_echo "scoring ECONOMY_${asset}" # bullish? bull market? - if g_num_is_higher ${v[ECONOMY_${asset}_15m_close_0]} ${v[ECONOMY_${asset}_1d_ema200_0]} + [ -n "${v[ECONOMY_${asset}_1d_ema200_0]}" ] && if g_num_is_higher ${v[ECONOMY_${asset}_15m_close_0]} ${v[ECONOMY_${asset}_1d_ema200_0]} then score -2 "${asset} EMA200 over last 15m close" else @@ -85,7 +85,7 @@ do g_echo "scoring ${asset}" # bullish? bull market? - if g_num_is_higher ${v[${asset}_15m_close_0]} ${v[${asset}_1d_ema200_0]} + [ -n "${v[${asset}_1d_ema200_0]}" ] && if g_num_is_higher ${v[${asset}_15m_close_0]} ${v[${asset}_1d_ema200_0]} then score 2 "${asset} EMA200 over last 15m close" else @@ -129,7 +129,7 @@ do g_echo "scoring ${asset}" # bullish? bull market? - if g_num_is_higher ${v[${asset}_15m_close_0]} ${v[${asset}_1d_ema200_0]} + [ -n "${v[${asset}_1d_ema200_0]}" ] && if g_num_is_higher ${v[${asset}_15m_close_0]} ${v[${asset}_1d_ema200_0]} then score 2 "${asset} EMA200 over last 15m close" else