fetch_quantmod_OHLC: Fetch Market OHLCV Through quantmod

View source: R/quantmod_data.R

fetch_quantmod_OHLCR Documentation

Fetch Market OHLCV Through quantmod

Description

Returns a standardized OHLCV data.table with common market-schema columns: source, symbol, interval, datetime, date, open, high, low, close, and volume.

Usage

fetch_quantmod_OHLC(
  ticker,
  label = ticker,
  from,
  to,
  src = "yahoo",
  raw_data = FALSE,
  max_attempts = 3L,
  retry_delay_seconds = 1,
  fallback_source = NULL,
  fallback_ticker = ticker,
  require_start_coverage = FALSE
)

Arguments

ticker

Market symbol passed to quantmod::getSymbols().

label

Optional label to store in the standardized symbol column.

from

Start date.

to

End date.

src

quantmod source, default "yahoo".

raw_data

Logical. If TRUE, return the raw xts object.

max_attempts

Maximum bounded attempts for a transient source failure.

retry_delay_seconds

Initial retry delay in seconds; delays use exponential backoff.

fallback_source

Optional explicitly configured fallback provider. Currently supports "eastmoney" for daily OHLC data. For Yahoo sources, a failed dated quantmod request first retries Yahoo's chart endpoint with a bounded range before this external fallback is considered.

fallback_ticker

Optional provider-specific fallback identifier.

require_start_coverage

Logical. Require material coverage from from. sync_local_quantmod_OHLC() enables this only when valid local bars already establish the instrument's history.

Details

A row is usable only if open, high, low, and close are finite. Isolated invalid rows are discarded. A window is materially incomplete when its end is more than seven calendar days behind the requested end, or, for an instrument with valid local history, when its start is more than seven calendar days late or fewer than half of the requested weekdays are present. The start rule is not applied to a newly listed instrument, and the calendar-day grace prevents weekend and market-holiday false positives.

Value

data.table or raw xts object when raw_data = TRUE.


investdatar documentation built on Aug. 21, 2026, 5:17 p.m.