get price from raw file if non-full-loop

This commit is contained in:
olli 2024-01-03 16:01:02 +01:00
parent 17dd8a0f1d
commit 2a7ec12fff

View File

@ -39,6 +39,15 @@ function get_vars_from_csv {
# basics
get_var_from_line date 1
get_var_from_line price 2
# get newest price from raw file if this is a non-full loop
# TODO: Nicer pure-bash code
if [ ${FULL_LOOP} == 0 ]
then
f_ASSET_HIST_FILE_RAW=$(echo ${f_ASSET_HIST_FILE} | sed 's/.csv$/-raw.csv/')
f_price=$(tail -n1 "${f_ASSET_HIST_FILE_RAW}" | cut -d, -f2)
fi
get_var_from_line price_change 3
# Check for price trend last 4 iterations