more pure bash to speed up things

This commit is contained in:
olli 2023-11-11 18:01:44 +01:00
parent 9b062255e0
commit e7bfb84790

View File

@ -13,8 +13,7 @@ function get_vars_from_csv {
fi
f_all_vars="f_market_performance=${f_market_performance}"
# read last 4 lines in array if not given
G # read last 4 lines in array if not given
if [ -z "${f_last_lines_array}" ]
then
mapfile -t f_last_lines_array <<< $(tail -n4 "${f_ASSET_HIST_FILE}")
@ -82,6 +81,8 @@ f_price_trend=${f_price_trend}"
get_var_from_line ema12 4
get_var_from_line ema26 5
set -x
# MACD
get_var_from_line macd_histogram 8
get_var_from_line macd_signal_relation 9
@ -91,6 +92,7 @@ f_price_trend=${f_price_trend}"
f_all_vars="${f_all_vars}
f_macd_histogram_relation=${f_macd_histogram_relation}
f_macd_histogram_signal=${f_macd_histogram_signal}"
set +x
# rsi
get_var_from_line rsi5 10
@ -134,12 +136,11 @@ f_macd_histogram_signal=${f_macd_histogram_signal}"
# Coingecko price
get_var_from_line coingecko_price 40a
set | grep f_
set | grep f_ 1>&2
}
set | grep f_
function get_var_from_line {
if [ -z "${f_last_line_array[$2]}" ]
then