tv_get_historical_data
Get historical OHLCV market data for stocks, crypto, forex, and futures. Specify symbol, exchange, interval, and number of bars to analyze price trends or backtest strategies.
Instructions
Fetch historical OHLCV (Open, High, Low, Close, Volume) bars for any symbol from TradingView. Supports stocks, crypto, forex, futures.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"symbol": "<symbol>"
},
"name": "tv_get_historical_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n_bars | No | Number of bars to return | |
| symbol | Yes | Ticker symbol, e.g. 'BTCUSDT', 'AAPL', 'EURUSD' | |
| exchange | No | Exchange name, e.g. 'EURONEXT' (PEA / Paris), 'NASDAQ', 'NYSE', 'BINANCE', 'FX' | EURONEXT |
| interval | No | Chart interval: 1, 3, 5, 15, 30, 45 (min) | 1H, 2H, 3H, 4H | 1D, 1W, 1M | 1D |