/tradingview-mcp:pine-authoringfrom TradingView MCP
Author, compile and deploy Pine Script: server-side syntax checks with tv_pine_compile, then the one-call build pipeline tv_desktop_pine_build_and_backtest on the user's chart. Use when writing or fixing Pine, turning an idea into a strategy, deploying or backtesting one, or debugging a compile error. Triggers: write Pine, compile Pine, fix Pine error, build a strategy, backtest this strategy, deploy to TradingView.
Ships in TradingView MCP. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write Pine v5 and verify it against TradingView's real compiler in a loop: author → compile → fix errors → recompile. Nothing is published or saved to any TradingView account — this is a read-only compile/typecheck workflow.
tv_pine_compile(source) — the whole loop. POST the full source (including the
//@version=5 line); returns {success, errors[], warnings[]}.//@version=5 header.tv_pine_compile(source).success is false, read each error (message, line, column), fix, and
recompile. warnings are non-fatal but worth reading.success: true (no errors), then paste into TradingView.//@version=5 must be the first line.indicator("...", overlay=true) vs strategy("...", ...);
strategy.* functions (entry, exit, close) only work in a strategy.close, high, low, open, volume, time, bar_index.ta.* (e.g. ta.sma, ta.crossover) replaces the old sma()/crossover() forms.static position (e.g. line.new
coordinates need to be passed correctly).input.* for user parameters; plot() for output.request.security() syntax (symbol, timeframe, expression, gaps) for
higher-timeframe context.Strategy Tester numbers are only comparable when the script pins its own
assumptions. Before backtesting (in TradingView or by porting the rules to
tv_backtest_run), make sure the strategy() call and inputs carry:
input.time(...) start/end and a inDateRange
guard on every entry — never "full history", and never scroll the chart to
window a test.commission_type=strategy.commission.cash_per_order (or percent)
with the user's real value, slippage in ticks; run once with zero costs and
once with real costs (see strategy-backtesting).default_qty_type=strategy.fixed, default_qty_value=1 (or the
user's contracts), initial_capital explicit. For futures/CFD add
margin_long=0, margin_short=0 — TradingView otherwise rejects orders as
under-margined and the trade list silently shrinks.shorttitle ≤ 10 chars (compile error otherwise).table with counters (signals seen, entries
blocked by date range, by margin, by pyramiding) before guessing.Compile-check the normalized script with tv_pine_compile first; then, if the
user wants it on THEIR chart, push it through the desktop loop below.
One call does the whole deploy:
tv_desktop_pine_build_and_backtest(source, name, symbol?, timeframe?, clear_studies="strategies")
It prepares the workspace, protects the user's own scripts, injects the source,
compiles, and reads the Strategy Tester report. It does not raise once connected —
read ok and stage (prepare | own_copy | set_source | compile | markers | results) and act:
stage: "markers" — compile_errors carry line/column, hints carry up to
three landmine-derived fixes. Fix the source and call again with the same
name; the rerun is safe. compile_warnings never stop a build — never loop
on a warning.results: null with a note — the source declares indicator(), so there is no
backtest to read. An ok: true with empty results and a fragile note means
the strategy did not attach; say so instead of inventing numbers.buy_hold_return next to net_profit from results.Rules that the tools enforce, and you should not fight:
set_source means exactly that — do not pass overwrite_saved=true to get
past it without the user's explicit yes.tv_desktop_set_study_inputs
(read back after writing), rebuild only for logic changes.tv_desktop_pine_find_exact(needle) → check occurrences →
tv_desktop_pine_replace_exact(needle, replacement, expected_occurrences, expect_source_sha256) → compile. The tools normalize line endings to the
buffer's own and verify byte-exactly; a mismatch changes nothing.tv_pine_compile (server-side, no chart) is the cheap syntax check — do not
burn the user's editor on typos. tv_desktop_pine_get_errors re-reads the
markers without clicking anything; never click the editor's error widget.clear_studies defaults to strategies — the user's indicators stay. Pass
all only when they asked for a clean chart.The endpoint's success field can be true even with errors — the tool derives
true success = processed AND zero errors. Errors carry start.line/column when the
compiler provides them; the tool normalizes both inline (line N col M ...) and
structured positions.
references/pine-notes.md — more idioms and traps.What SKILL.md sets; muted values are Claude Code's defaults
11 skills in this plugin
/chart-markupRender candlestick charts with SMC/ICT markup overlays to PNG files. Use when you have a scan result or a set of levels/timestamps and want a visual for review or for attaching to a note. Triggers: render the chart, draw the FVG, make a PNG of this setup, visualize the scan, markup chart./journal-syncLoad a trade journal of any shape (FX Replay export, your own session CSV, a broker export) into one normalized record schema, and import FX Replay exports into a Notion trade journal using the documented mapping. Use when reading a journal, computing journal stats, ingesting a backtest/analytics export, de-duplicating re-imports, or syncing trades. Triggers: load my journal, read my trades, journal stats, import FX Replay, sync journal, push trades to Notion, map the CSV./Other plugins' skills for the same job
npx claudepluginhub miha21222/tradingview-mcp --plugin tradingview-mcp