From edfa828c2a77c2d3166f025cb29c73ad584b395c Mon Sep 17 00:00:00 2001 From: olli Date: Mon, 21 Oct 2024 21:08:36 +0200 Subject: [PATCH] day fetches 1 minute later --- dabo/fetch-ohlcv-candles-indicators.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dabo/fetch-ohlcv-candles-indicators.sh b/dabo/fetch-ohlcv-candles-indicators.sh index 9136356..e65eb02 100755 --- a/dabo/fetch-ohlcv-candles-indicators.sh +++ b/dabo/fetch-ohlcv-candles-indicators.sh @@ -31,16 +31,20 @@ do # Reload Config . ../../dabo-bot.conf . ../../dabo-bot.override.conf - # notify failed yahoo downloads - [ "$interval" = "1d" ] && cat FAILED_YAHOO/*USD_* FAILED_YAHOO/*ECONOMY* 2>/dev/null | notify.sh -s "Failed Yahoo downloads" + # notify failed downloads + [ "$interval" = "1d" ] && cat FAILED_*/* 2>/dev/null | notify.sh -s "Failed downloads" # Timestamp export f_timestamp=$(g_date_print) # get candles and indicators get_ohlcv-candles $interval [ -n "$seconds" ] && sleeptime=$(( ( ($seconds - $(TZ=UTC printf "%(%s)T") % $seconds) % $seconds + 2 ))) #[[ $interval = 4h ]] && sleeptime=?? - [ "$interval" = "1d" ] && sleeptime=$(($(TZ=UTC date +%s -d "tomorrow 0:00") - $(date +%s) +2 )) - [ "$interval" = "1w" ] && sleeptime=$(($(TZ=UTC date +%s -d "next monday 0:00") - $(date +%s) +2 )) + if [ "$interval" = "1d" ] + then + get_marketdata_fear_and_greed_alternativeme + sleeptime=$(($(TZ=UTC date +%s -d "tomorrow 0:01") - $(date +%s) +2 )) + fi + [ "$interval" = "1w" ] && sleeptime=$(($(TZ=UTC date +%s -d "next monday 0:01") - $(date +%s) +2 )) g_echo_note "Waiting $sleeptime seconds until next run" sleep $sleeptime done