From af539ddc2168420fe11c8bcf4aff21442588696c Mon Sep 17 00:00:00 2001 From: olli Date: Thu, 23 Nov 2023 10:17:50 +0100 Subject: [PATCH] more pure bash to speed up things --- dabo/analyze.sh | 4 ++-- dabo/functions/check_buy_conditions.sh | 2 +- dabo/functions/get_vars_from_csv.sh | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dabo/analyze.sh b/dabo/analyze.sh index 9f4a328..289e8c1 100755 --- a/dabo/analyze.sh +++ b/dabo/analyze.sh @@ -100,7 +100,7 @@ function analyze { # check_sell_conditions ${g_tmp}/${tmpfile} >>${g_tmp}/output-${tmpfile} # else #echo "SELL Checks" - time check_sell_conditions ${g_tmp}/${tmpfile} + check_sell_conditions ${g_tmp}/${tmpfile} # fi # fi # if ! [ -f "${g_tmp}/open-${tmpfile}" ] @@ -110,7 +110,7 @@ function analyze { # then # check_buy_conditions ${g_tmp}/${tmpfile} >>${g_tmp}/output-${tmpfile} # else - time check_buy_conditions ${g_tmp}/${tmpfile} + check_buy_conditions ${g_tmp}/${tmpfile} # fi fi ## Chart Part diff --git a/dabo/functions/check_buy_conditions.sh b/dabo/functions/check_buy_conditions.sh index 3a007b7..0617ecf 100644 --- a/dabo/functions/check_buy_conditions.sh +++ b/dabo/functions/check_buy_conditions.sh @@ -19,7 +19,7 @@ function check_buy_conditions { # get asset vars if [ -n "${BOT}" ] then - get_vars_from_csv "${f_ASSET_HIST_FILE}" || return 1 + time get_vars_from_csv "${f_ASSET_HIST_FILE}" || return 1 fi ### from here: check for defined state to buy diff --git a/dabo/functions/get_vars_from_csv.sh b/dabo/functions/get_vars_from_csv.sh index 12fbcee..8e08c52 100644 --- a/dabo/functions/get_vars_from_csv.sh +++ b/dabo/functions/get_vars_from_csv.sh @@ -16,6 +16,7 @@ function get_vars_from_csv { # read last 4 lines in array if not given if [ -z "${f_last_lines_array}" ] then + echo "open file ${f_ASSET_HIST_FILE}" mapfile -t f_last_lines_array < <(tail -n4 "${f_ASSET_HIST_FILE}") fi