data_get_ohlcv
Get OHLCV bar data from a TradingView chart for trade review. Specify a date range to analyze past trades, or omit timestamps for the most recent bars.
Instructions
Get OHLCV bar data from the chart. TWO MODES: pass from+to (unix seconds) to get bars from THAT window — required when reviewing a past trade, because without it you get the newest bars regardless of where the chart is navigated. Omit both for the newest count bars. A window with no loaded bars is refused rather than answered with the latest data; call chart_set_visible_range for that window first. Defaults to summary=true (compact stats + last 5 bars).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Window end (unix seconds, greater than `from`). Must be given together with `from`. OMIT it for the latest-bars mode — do not send null. | |
| from | No | Window start (unix seconds). Must be given together with `to`. OMIT it for the latest-bars mode — do not send null. | |
| count | No | Number of bars to consider (max 500, default 100) | |
| summary | No | Summary stats instead of all bars (default true) |