Skip to content

fix(loaders): honor interval in local loader by resampling#467

Merged
warren618 merged 2 commits into
HKUDS:mainfrom
Shizoqua:fix/local-loader-interval
Jul 12, 2026
Merged

fix(loaders): honor interval in local loader by resampling#467
warren618 merged 2 commits into
HKUDS:mainfrom
Shizoqua:fix/local-loader-interval

Conversation

@Shizoqua

Copy link
Copy Markdown
Contributor

The local loader accepted an interval argument but passed it only to the cache key, so requesting e.g. 4H against hourly data silently returned the file's native bars.

Changes

  • Resample to the requested interval using standard OHLCV aggregation (open=first, high=max, low=min, close=last, volume=sum)
  • Warn when a finer-than-source interval is requested (cannot fabricate bars)
  • Warn on unsupported interval strings
  • Make end-date filter inclusive of the whole end day so intraday bars on the final date survive for sub-daily intervals
  • Bump loader cache version (2→3) so the end-date and resampling fixes cannot be masked by stale cache entries

Testing

  • Test verifies 4H request against hourly bars produces correct aggregated buckets
  • Test verifies upsampling returns source bars with a warning

Shizoqua added 2 commits June 19, 2026 20:20
The local loader accepted an ``interval`` argument but passed it only to the
cache key, so requesting e.g. 4H against hourly data silently returned the
file's native bars.

Resample to the requested interval using the same OHLCV aggregation as the
yfinance loader (open=first, high=max, low=min, close=last, volume=sum). A
finer-than-source interval cannot be fabricated from a file, so the source
bars are returned unchanged with a warning; requests already matching the
source granularity are passed through. The end-date filter is now inclusive
of the whole end day so intraday bars on that day survive for sub-daily
intervals.

Signed-off-by: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com>
@warren618 warren618 merged commit f8c83f1 into HKUDS:main Jul 12, 2026
1 check passed
@warren618

Copy link
Copy Markdown
Collaborator

Merged — thanks. The cache-version bump so stale entries can't mask the fix is exactly right, and the inclusive end-day filter closes the sub-daily edge case. Verified locally: local-loader + cache helper tests green.

warren618 added a commit that referenced this pull request Jul 12, 2026
#457 SDM, #474 Requesty provider, #470 Binance USD-M slice 1,
#472 correlation bare tickers, #467 local loader interval, #469 FastMCP compat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants