Retrieves historical OHLCV (Open, High, Low, Close, Volume) price bars for a specified symbol across various timeframes. Returns time-series candlestick data essential for technical analysis, backtesting, and chart visualization.
Use Case: Build price charts, analyze historical trends, and perform technical analysis on stocks and securities with customizable time intervals.
OAuth2 Bearer token: obtain an access token from the token endpoint and send it in the Authorization header.
Stock symbol to fetch historical data for
Bar resolution: 1, 3, 5, 15, 30, 45, 60, 120, 180, 240 (minutes), D/1D/1d (daily), W/1W/1w (weekly), M/1M/1m, 3M/3m, 6M/6m, 12M/12m (monthly)
1, 3, 5, 15, 30, 45, 60, 120, 180, 240, D, W, M, 1D, 1W, 1M, 3M, 6M, 12M, 1d, 1w, 1m, 3m, 6m, 12m Start time as Unix timestamp in seconds (or milliseconds, will be auto-converted)
x >= 1End time as Unix timestamp in seconds (or milliseconds; auto-converted to seconds). Must be greater than 'from'.
x >= 1Set to '0' for subsequent requests; omit or non-zero for first request (TradingView UDF).
Include extended-hours data.
Historical bars in TradingView UDF format. Always returns 200; check s (status): ok = data in t, o, h, l, c, v; no_data = no bars; error = errmsg contains reason (e.g. invalid resolution or time range).
Status of the response
ok, no_data, error Array of close prices
Error message (only present if s='error' or s='no_data')
Array of high prices
Array of low prices
Next expected bar time (optional)
Array of open prices
Array of bar timestamps (Unix time in seconds)
Array of volumes