From 95d9ce2a6ccb59e532bdf9201c92bd345cd2616b Mon Sep 17 00:00:00 2001 From: olli Date: Fri, 19 May 2023 08:23:14 +0200 Subject: [PATCH] fixes --- dabo/analyze.sh | 9 ++------- dabo/functions/get_vars_from_csv.sh | 13 +++++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dabo/analyze.sh b/dabo/analyze.sh index 341b6d7..6256fec 100755 --- a/dabo/analyze.sh +++ b/dabo/analyze.sh @@ -59,7 +59,7 @@ function analyze { do if [ "${ANALYZE_VERBOSE}" -eq "0" ] then - check_sell_conditions ${g_tmp}/${tmpfile} "${f_strategy}" >>${g_tmp}/output-${tmpfile} 2>&1 + check_sell_conditions ${g_tmp}/${tmpfile} "${f_strategy}" >>${g_tmp}/output-${tmpfile} #2>&1 else check_sell_conditions ${g_tmp}/${tmpfile} "${f_strategy}" 2>&1 | tee -a ${g_tmp}/output-${tmpfile} fi @@ -68,16 +68,11 @@ function analyze { if ! [ -f "${g_tmp}/open-${tmpfile}" ] then f_market_performance=$(grep "^$time" data/botdata/MARKET_PERFORMANCE | tail -n1 | cut -d: -f4 | cut -d"%" -f1 | sed 's/ *//') - if [ -z "${f_market_performance}" ] - then - g_echo_note "No market performanvce data found - forcing good market (100)" - f_market_performance=100 - fi for f_strategy in $(find strategies -name "buy.*.conf" -type f) do if [ "${ANALYZE_VERBOSE}" -eq "0" ] then - check_buy_conditions ${g_tmp}/${tmpfile} "${f_strategy}" >>${g_tmp}/output-${tmpfile} 2>&1 || break + check_buy_conditions ${g_tmp}/${tmpfile} "${f_strategy}" >>${g_tmp}/output-${tmpfile} #2>&1 || break else check_buy_conditions ${g_tmp}/${tmpfile} "${f_strategy}" 2>&1 | tee -a ${g_tmp}/output-${tmpfile} fi diff --git a/dabo/functions/get_vars_from_csv.sh b/dabo/functions/get_vars_from_csv.sh index 61754e1..d060be4 100644 --- a/dabo/functions/get_vars_from_csv.sh +++ b/dabo/functions/get_vars_from_csv.sh @@ -35,6 +35,19 @@ function get_vars_from_csv { get_var_from_line price_change_14_day 20 get_var_from_line price_change_30_day 21 + if [ -z "${f_market_performance}" ] + then + if [ -z "${BOT}" ] + then + g_echo_note "Analyze: No market performanvce data found - forcing good market (100)" + f_market_performance=100 + else + g_echo_note "Bot: No market performanvce data found - forcing bad market (-100)" + f_market_performance=-100 + fi + fi + + } function get_var_from_line {