diff --git a/README.md b/README.md index 5c5b2b5..590867e 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ strategies/sell.command-kirk-3.conf ## Set Rights Set Rights (UID 10000 for non-root-User in running container): ``` -chown -R 10000:10000 dabo data home strategy +chown -R 10000:10000 dabo data home strategies dabo-bot.conf ``` diff --git a/dabo/functions/check_buy_conditions.sh b/dabo/functions/check_buy_conditions.sh index d6fa18a..d82e007 100644 --- a/dabo/functions/check_buy_conditions.sh +++ b/dabo/functions/check_buy_conditions.sh @@ -48,17 +48,20 @@ function check_buy_conditions { return 0 fi - # MACD # no negative or empty values - echo "${f_macd_histogram_relation}" | grep -q "^[0-9]" || return 0 - # check for conditions - if [ ${f_macd_histogram_relation} -le ${BUY_MACD_RELATION_FROM} ] || [ ${f_macd_histogram_relation} -ge ${BUY_MACD_RELATION_TO} ] + if echo "${f_macd_histogram_relation}" | grep -q "^[0-9]" then - g_echo_note "${f_echo_prefix}MACD conditions NOT met" + # check for conditions + if [ ${f_macd_histogram_relation} -le ${BUY_MACD_RELATION_FROM} ] || [ ${f_macd_histogram_relation} -ge ${BUY_MACD_RELATION_TO} ] + then + g_echo_note "${f_echo_prefix}MACD conditions NOT met" + return 0 + fi + else + g_echo_note "${f_echo_prefix}f_macd_histogram_relation empty or negative" return 0 fi - # RSI if \ [ ${f_rsi5} -le ${BUY_RSI5_SIGNAL_UNTIL} ] && \ @@ -84,7 +87,6 @@ function check_buy_conditions { return 0 fi - # Price change if \ [ $(echo "${f_price_change_1_day} > ${BUY_MIN_PRICE_CHANGE_LAST_1_DAY}" | bc -l) -ne 0 ] && \ @@ -98,7 +100,6 @@ function check_buy_conditions { return 0 fi - if [ -n "$f_BUY" ] then # Check for beginning MACD Trend @@ -124,7 +125,6 @@ function check_buy_conditions { g_echo_note "BUY ${f_ASSET}@${CURRENCY}:${f_price} MACD Histogram not rising (now ${f_macd_histogram} < 1 before ${f_macd_histogram_before} < 2 before ${f_macd_histogram_2before} < 3 before ${f_macd_histogram_3before} < 4 before ${f_macd_histogram_4before} < 5 before ${f_macd_histogram_5before}) - trend loses strength / not growing - don't buy" return 0 fi - fi