tv_export_data
Export the active chart as a CSV/JSON table: OHLCV bars plus study values joined by bar time, with inline option. Works around TradingView Desktop's disabled export chart data.
Instructions
Read-only: export the active chart as one table - OHLCV bars plus the plotted values of every study (or the studies you name) joined on bar time - to a CSV (default) or JSON file under the export directory, or inline with write=false. TradingView Desktop refuses its own "Export chart data", so this composes the export from the loaded series: at most 500 bars and only what the chart has scrolled into memory. Studies without a data series (built-in Volume etc.) are listed under skipped. Column names are " | ". Returns symbol, resolution, bar count, first/last bar, the columns and the file path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | file name override (extension added if missing); default <symbol>_<res>_<yyyymmdd-hhmm>.<ext> | |
| count | No | most-recent bars to export; default 500, max 500 | |
| write | No | default true; false = no file, rows returned inline (max 500) | |
| format | No | file format; default csv | |
| layout | No | which chart tab: layout id, target id or 0-based index (default: the painting tab) | |
| out_dir | No | directory for the file; default <repo>/exports or TV_EXPORT_DIR (created if missing) | |
| studies | No | study ids or case-insensitive name parts to include; omit = every study on the chart; [] = bars only | |
| 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) | |
| include_decoration | No | also export colorer / fill plots (packed colour ints); default false |