From 04a36806f5f8c41d6887406d9e9bcdadde9b2d0d Mon Sep 17 00:00:00 2001 From: olli Date: Sat, 13 May 2023 22:03:37 +0200 Subject: [PATCH] test remove macd growing trend check --- dabo/functions/check_buy_conditions.sh | 52 +++++++++++++------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/dabo/functions/check_buy_conditions.sh b/dabo/functions/check_buy_conditions.sh index c6275f0..4ae7b9d 100644 --- a/dabo/functions/check_buy_conditions.sh +++ b/dabo/functions/check_buy_conditions.sh @@ -100,32 +100,32 @@ function check_buy_conditions { return 0 fi - if [ -n "$f_BUY" ] - then - # Check for beginning MACD Trend - if ! tail -n3 ${f_ASSET_HIST_FILE} | grep -q '|buy,' - then - g_echo_note "${f_echo_prefix}MACD Trend not near (3 timeframes) the beginning buy signal" - return 0 - fi - - # Check for growing MACD trend - local f_macd_histogram_before=$(tail -n2 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f8) - local f_macd_histogram_2before=$(tail -n3 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f8) - local f_macd_histogram_3before=$(tail -n4 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f8) - local f_macd_histogram_4before=$(tail -n5 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f8) - local f_macd_histogram_5before=$(tail -n6 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f8) - if \ - [ $(echo "${f_macd_histogram} < ${f_macd_histogram_before}" | bc -l) -ne 0 ] && \ - [ $(echo "${f_macd_histogram_before} < ${f_macd_histogram_2before}" | bc -l) -ne 0 ] && \ - [ $(echo "${f_macd_histogram_2before} < ${f_macd_histogram_3before}" | bc -l) -ne 0 ] && \ - [ $(echo "${f_macd_histogram_3before} < ${f_macd_histogram_4before}" | bc -l) -ne 0 ] && \ - [ $(echo "${f_macd_histogram_4before} < ${f_macd_histogram_5before}" | bc -l) -ne 0 ] - then - 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 +# if [ -n "$f_BUY" ] +# then +# # Check for beginning MACD Trend +# if ! tail -n3 ${f_ASSET_HIST_FILE} | grep -q '|buy,' +# then +# g_echo_note "${f_echo_prefix}MACD Trend not near (3 timeframes) the beginning buy signal" +# return 0 +# fi +# +# # Check for growing MACD trend +# local f_macd_histogram_before=$(tail -n2 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f8) +# local f_macd_histogram_2before=$(tail -n3 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f8) +# local f_macd_histogram_3before=$(tail -n4 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f8) +# local f_macd_histogram_4before=$(tail -n5 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f8) +# local f_macd_histogram_5before=$(tail -n6 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f8) +# if \ +# [ $(echo "${f_macd_histogram} < ${f_macd_histogram_before}" | bc -l) -ne 0 ] && \ +# [ $(echo "${f_macd_histogram_before} < ${f_macd_histogram_2before}" | bc -l) -ne 0 ] && \ +# [ $(echo "${f_macd_histogram_2before} < ${f_macd_histogram_3before}" | bc -l) -ne 0 ] && \ +# [ $(echo "${f_macd_histogram_3before} < ${f_macd_histogram_4before}" | bc -l) -ne 0 ] && \ +# [ $(echo "${f_macd_histogram_4before} < ${f_macd_histogram_5before}" | bc -l) -ne 0 ] +# then +# 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 ### Buy or not buy? # BOT