This commit is contained in:
olli 2024-08-31 20:08:49 +02:00
parent 173f7c1b97
commit b0dfda6c9b

View File

@ -41,7 +41,12 @@ function get_levels_all {
printf '%(%Y-%m-%d %H:%M:%S)T' >"${f_levelsfile}.levels-calculating" printf '%(%Y-%m-%d %H:%M:%S)T' >"${f_levelsfile}.levels-calculating"
g_echo_note "Estimating relevant levels of $f_levelsfile" g_echo_note "Estimating relevant levels of $f_levelsfile"
get_levels "$f_levelsfile" && printf '%(%Y-%m-%d %H:%M:%S)T' >"${f_levelsfile}.levels-calculated" if get_levels "$f_levelsfile"
then
printf '%(%Y-%m-%d %H:%M:%S)T' >"${f_levelsfile}.levels-calculated"
else
continue
fi
echo "${f_levels[@]}" >"${f_levelsfile}.levels.new" echo "${f_levels[@]}" >"${f_levelsfile}.levels.new"
mv "${f_levelsfile}.levels.new" "${f_levelsfile}.levels" mv "${f_levelsfile}.levels.new" "${f_levelsfile}.levels"
@ -63,6 +68,9 @@ function get_levels {
g_echo_note "RUNNING FUNCTION ${FUNCNAME} $@" g_echo_note "RUNNING FUNCTION ${FUNCNAME} $@"
# reset old levels var
unset f_levels
local f_levelsfile=$1 local f_levelsfile=$1
if ! [ -s "$f_levelsfile" ] if ! [ -s "$f_levelsfile" ]
then then
@ -85,9 +93,6 @@ function get_levels {
return 1 return 1
fi fi
# reset old levels var
unset f_levels
local f_min_occurrences i j f_level f_level_count f_level_prices f_level_first_price f_baseprice f_threshold_test local f_min_occurrences i j f_level f_level_count f_level_prices f_level_first_price f_baseprice f_threshold_test
# # some key points # # some key points