tv_get_bars
Read OHLCV bars from the active TradingView chart, returning up to 500 most-recent bars with availability info and symbol resolution status.
Instructions
Read OHLCV bars of the active chart straight from the loaded series (newest last). Read-only. Returns at most 500 bars; TradingView only holds what has been scrolled into memory, so available tells you how many bars the chart currently has. Also reports whether the symbol failed to resolve.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "tv_get_bars"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | how many most-recent bars to return; default 100, max 500 | |
| layout | No | chart layout id or index; default active | |
| expect_layout | No | layout id the tab is expected to show right now; the call refuses if it differs (a tab keeps its target id when the user opens another layout in it) |