diff --git a/dabo/functions/get_asset.sh b/dabo/functions/get_asset.sh index f5930b9..af1f81b 100644 --- a/dabo/functions/get_asset.sh +++ b/dabo/functions/get_asset.sh @@ -3,7 +3,7 @@ function get_asset { g_echo_note "RUNNING FUNCTION ${FUNCNAME} $@" local f_ASSET="$1" - # write asset hist file with macd and rsi + # write asset hist file local f_ASSET_HIST_FILE="asset-histories/${f_ASSET}.history-raw.csv" if find "${f_ASSET_HIST_FILE}" -mmin -${INTERVAL_MIN} | grep -q "${f_ASSET_HIST_FILE}" @@ -43,14 +43,11 @@ function get_asset { [ ${FULL_LOOP} == 0 ] && return 0 f_ASSET_HIST_FILE="asset-histories/${f_ASSET}.history.csv" - #if [ ${f_linecount} -lt 30 ] && [ ${f_lines} -ge 50 ] && [ ${INTERVAL} -lt 300 ] - #then - # g_echo_note "${f_ASSET_HIST_FILE}: set price to 5 minute period" - # if ! echo "${f_timestamp}" | egrep -q ":[0-5]0:|:[0-5]5:" - # then - # return 0 - # fi - #fi + if find "${f_ASSET_HIST_FILE}" -mmin -${INTERVAL_MIN} | grep -q "${f_ASSET_HIST_FILE}" + then + g_echo_note "${f_ASSET_HIST_FILE} already downloaded in the last ${INTERVAL_MIN} minutes" + return 0 + fi # headline #[ -s "${f_ASSET_HIST_FILE}" ] || echo "${csv_headline}" >"${f_ASSET_HIST_FILE}"