-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Reading Custom Pine Output
This is the bridge's signature capability, and the reason it beats screenshot-scraping. Custom Pine Script indicators draw their own graphics — horizontal levels, text labels, tables, and boxes — using line.new(), label.new(), table.new(), and box.new(). None of that shows up in normal price or study-value APIs. This family of tools reaches into TradingView's internal graphics collection and reads it back as structured data.
So when a user asks "what levels is my Profiler indicator showing?" the agent gets real numbers, not a guess from pixels.
| Tool | Reads | Returns |
|---|---|---|
data_get_pine_lines |
line.new() |
Horizontal price levels, deduplicated, sorted high→low |
data_get_pine_labels |
label.new() |
Text + price pairs (e.g., "PDH 24550") — capped at 50/study by default |
data_get_pine_tables |
table.new() |
Table cells as formatted rows (session stats, analytics dashboards) |
data_get_pine_boxes |
box.new() |
Deduplicated {high, low} price zones |
The indicator must be VISIBLE on the chart. If it's hidden, TradingView doesn't compute its graphics, and these tools return nothing. Toggle it on with
indicator_toggle_visibilityif needed.
When you know which indicator you want, pass study_filter with a name substring. This targets one study instead of scanning every study on the chart — faster, and far smaller output.
data_get_pine_lines study_filter: "Profiler"
data_get_pine_labels study_filter: "Profiler"
data_get_pine_tables study_filter: "Profiler"
1. chart_get_state # find the study name / entity ID
2. data_get_pine_lines study_filter: "Profiler" # price levels
3. data_get_pine_labels study_filter: "Profiler" # labeled context ("Settlement", "ASN O/U")
4. data_get_pine_tables study_filter: "Profiler" # the analytics table
5. capture_screenshot # visual cross-check
-
Lines → clean, deduplicated price levels (multiple
line.new()calls at the same price collapse to one), sorted high→low, so an agent can reason about support/resistance directly. - Labels → the human-readable annotations the indicator authors intended — text and the price they're anchored to. This is where semantic context lives ("PDH", "Bias Long ✓", "Settlement").
- Tables → dashboards flattened into rows you can read or re-tabulate.
-
Boxes →
{high, low}zones for supply/demand, value areas, ranges.
By default these tools return compact, deduplicated data. Pass verbose: true only if you specifically need raw drawing data with IDs, colors, and coordinates. Don't do this casually — it's much larger. See Context Management.
The graphics live deep in TradingView's model. The bridge walks:
study._graphics._primitivesCollection.dwglines.get('lines').get(false)._primitivesDataById
...and the equivalent collections for labels, tables, and boxes, then normalizes and deduplicates them. More on the internals in Architecture Internals.
See also: Agent Workflows ("What levels/lines/labels are showing?") · Tool Reference (Pine Graphics Extraction).
TradingView MCP Bridge · 84 tools · CDP bridge to TradingView Desktop · Community project, not affiliated with TradingView
Guides
Reference
Contribute
Repo