This commit is contained in:
2023-05-19 08:02:34 +02:00
parent 7d27642d9a
commit 212b1d088c
4 changed files with 32 additions and 18 deletions

View File

@@ -16,9 +16,9 @@ function check_buy_conditions {
# get asset vars
get_vars_from_csv "${f_ASSET_HIST_FILE}" || return 1
### from here: check for defined state to buy
f_BUY="${f_last_line}"
f_BUY="${f_last_line},${f_market_performance}"
# load strategy
local f_echo_prefix="BUY ${f_ASSET}@${CURRENCY}:${f_price}:${f_strategy} - "
@@ -112,15 +112,29 @@ function check_buy_conditions {
return 0
fi
# if [ -n "$f_BUY" ]
# then
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 continious growing price
# local f_price_before=$(tail -n2 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f2)
# local f_price_2before=$(tail -n3 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f2)
# local f_price_3before=$(tail -n4 ${f_ASSET_HIST_FILE} | head -n1 | cut -d, -f2)
# if [ $(echo "${f_price} < ${f_price_before}" | bc -l) -ne 0 ] || \
# [ $(echo "${f_price_before} < ${f_price_2before}" | bc -l) -ne 0 ] || \
# [ $(echo "${f_price_2before} < ${f_price_3before}" | bc -l) -ne 0 ]
# then
# g_echo_note "${f_echo_prefix}Last 3 prices not continiously growing"
# 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)
@@ -137,7 +151,7 @@ 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
fi
### Buy or not buy?
# BOT