diff --git a/dabo/functions/get_vars_from_csv.sh b/dabo/functions/get_vars_from_csv.sh index d060be4..98b29b4 100644 --- a/dabo/functions/get_vars_from_csv.sh +++ b/dabo/functions/get_vars_from_csv.sh @@ -7,7 +7,20 @@ function get_vars_from_csv { return 1 fi - f_last_line="$(tail -n1 "${f_ASSET_HIST_FILE}")" + 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 + + + f_last_line="$(tail -n1 "${f_ASSET_HIST_FILE}"),${f_market_performance}" readarray -d "," -t f_last_line_array < <(echo "0,${f_last_line}") @@ -35,19 +48,6 @@ 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 {