-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Agent Workflows
This is the "which tool when" decision tree — the fastest way for an agent (or a human) to pick the right tool for an intent. It mirrors the guidance baked into the project's CLAUDE.md so agents behave consistently. For the full alphabetical list, see Tool Reference.
The core loop is always the same: read state → act → verify.
-
chart_get_state→ symbol, timeframe, chart type, and every indicator with its entity ID. -
data_get_study_values→ current numeric values from all visible indicators (RSI, MACD, Bollinger Bands, EMAs, customplot()s). -
quote_get→ real-time price, OHLC, volume for the current symbol.
Custom Pine indicators draw with line.new(), label.new(), table.new(), box.new(). These are invisible to normal data tools. Use the Pine graphics family (full guide: Reading Custom Pine Output):
-
data_get_pine_lines→ horizontal price levels (deduplicated, sorted high→low). -
data_get_pine_labels→ text annotations with prices (e.g., "PDH 24550", "Bias Long ✓"). -
data_get_pine_tables→ table data as formatted rows (session stats, dashboards). -
data_get_pine_boxes→ price zones as{high, low}pairs.
Pass study_filter to target a specific indicator by name substring (e.g., study_filter: "Profiler").
-
data_get_ohlcvwithsummary: true→ compact stats (high, low, range, change%, avg volume, last 5 bars). -
data_get_ohlcvwithout summary → individual bars (countto limit, default 100). -
quote_get→ single latest price snapshot.
-
quote_get→ current price. -
data_get_study_values→ all indicator readings. -
data_get_pine_lines→ key price levels from custom indicators. -
data_get_pine_labels→ labeled levels with context. -
data_get_pine_tables→ session stats / analytics tables. -
data_get_ohlcvwithsummary: true→ price-action summary. -
capture_screenshot→ visual confirmation.
-
chart_set_symbol→ switch ticker (AAPL,ES1!,NYMEX:CL1!). -
chart_set_timeframe→ switch resolution (1,5,15,60,D,W). -
chart_set_type→ switch style (Candles, Heikin Ashi, Line, Area, Renko). -
chart_manage_indicator→ add/remove studies (full name: "Relative Strength Index", not "RSI"). -
chart_scroll_to_date→ jump to a date (ISO:2025-01-15). -
chart_set_visible_range→ zoom to an exact date range (unix timestamps).
-
pine_set_source→ inject code into the editor. -
pine_smart_compile→ compile with auto-detection + error check. -
pine_get_errors→ read compilation errors. -
pine_get_console→ readlog.info()output. -
data_get_strategy_results→ review performance. -
capture_screenshot→ capture the result.
Validate before injecting:
-
pine_analyze→ static analysis offline (out-of-bounds, bad loop bounds, implicit casts) — no TradingView needed. -
pine_check→ server-side compile without opening the chart.
pine_get_source on complex scripts (200KB+). Only read it back if you need to edit.
-
replay_startwithdate: "2025-03-01"→ enter replay mode. -
replay_step→ advance one bar (orreplay_autoplaywith aspeedin ms). -
replay_tradewithaction: "buy"/"sell"/"close"→ execute trades. -
replay_status→ check position, P&L, current date. -
replay_stop→ return to realtime.
-
batch_runwithsymbols: ["ES1!", "NQ1!", "YM1!"]andaction: "screenshot","get_ohlcv", or"get_strategy_results". Compare metrics across the set in one call.
-
draw_shape→horizontal_line,trend_line,rectangle,text(pass a point + optionalpoint2). -
draw_list→ see what's drawn. -
draw_remove_one→ remove by ID ·draw_clear→ remove all.
-
alert_create→ set a price alert (condition: crossing / greater_than / less_than). -
alert_list→ view active alerts ·alert_delete→ remove.
-
pane_set_layout→ set a grid (e.g., 2x2) ·pane_set_symbol→ put a symbol in each pane ·pane_list/pane_focusto inspect and target. - Or
tab_new/tab_switchto keep separate chart tabs.
-
ui_open_panel→ open/close pine-editor, strategy-tester, watchlist, alerts, trading. -
ui_click→ click buttons by aria-label, text, or data-name. -
layout_switch→ load a saved layout ·ui_fullscreen→ toggle fullscreen. - Escape hatches when nothing else fits:
ui_find_element,ui_mouse_click,ui_keyboard,ui_type_text,ui_evaluate.
-
tv_launch→ auto-detect and launch with CDP on Mac/Win/Linux. -
tv_health_check→ verify the connection.
-
chart_get_stateonce, then reference the entity IDs it returns — don't re-poll. - Entity IDs are session-specific — don't cache them across sessions.
-
Pine indicators must be visible for the
data_get_pine_*tools to read them. - Prefer a screenshot over a giant data dump for visual context — it's ~300 bytes (a file path) and gives the whole picture. See Context Management.
TradingView MCP Bridge · 84 tools · CDP bridge to TradingView Desktop · Community project, not affiliated with TradingView
Guides
Reference
Contribute
Repo