tv_study_template
Manage TradingView study templates: list saved templates, snapshot current chart studies, save a new template, apply one to the chart, or delete custom templates.
Instructions
Indicator (study) templates of the TradingView account, one tool switched on action. list (read-only): saved templates - custom first, then the built-in standard/fundamental ones. snapshot (read-only): the study set of the chart on screen as a template object (optionally written to file) - take one before apply so it can be undone. save: store the chart's studies under name (POST /api/v1/study-templates; replace=true to overwrite an existing custom template). apply: MUTATES THE CHART - REPLACES EVERY STUDY on the layout with the template from name (saved), template (inline) or file (JSON); returns studies before/after. delete: remove a custom template by name; confirm=true required; built-ins refuse. Verified live: full round trip - snapshot, save (listed in ~2 s), apply back (studies_before == studies_after), delete with confirm (gone in ~1 s).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | snapshot: write the JSON here; apply: read the template JSON from here | |
| name | No | template name (save / apply-by-name / delete) | |
| action | Yes | list | snapshot | save | apply | delete | |
| layout | No | chart layout id, target id, or 0-based index; default = the chart tab that is actually painting | |
| confirm | No | delete: must be true | |
| replace | No | save: overwrite an existing custom template of that name (default false) | |
| template | No | apply: inline template object, e.g. from a previous snapshot | |
| save_symbol | No | snapshot/save: include the symbol (default false) | |
| 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) | |
| save_interval | No | snapshot/save: include the interval (default false) |