strategy buy signal

This commit is contained in:
olli 2023-10-27 11:18:25 +02:00
parent ea6962a10f
commit 70ed81ce91

View File

@ -109,6 +109,7 @@ function check_buy_conditions_strategy {
# load strategy
local f_echo_prefix="BUY ${f_ASSET}@${CURRENCY}:${f_price}:${f_strategy} - "
f_do_buy=""
if [ -s "${f_strategy}" ]
then
. "${f_strategy}" || return 1
@ -118,6 +119,12 @@ function check_buy_conditions_strategy {
fi
[ -n "${BOT}" ] && g_echo_note "${f_echo_prefix}Running BUY checks"
# Check buy signal from strategy
if [ -n "${f_do_buy}" ]
then
echo " ${f_echo_prefix} Strategy buy signal: ${f_do_buy}"
return 0
fi
# Check market-performance
if [ $(echo "${f_market_performance} > ${GOOD_MARKET_PERFORMANCE_INDEX}" | bc -l) -eq 0 ]