Pine Script v6 patterns: syntax, performance, error diagnosis, backtesting, visualization. Use when working with PineScript, TradingView, indicators, strategies, or backtesting.
From compound-engineeringnpx claudepluginhub iliaal/compound-engineering-plugin --plugin compound-engineeringThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Executes pre-written implementation plans: critically reviews, follows bite-sized steps exactly, runs verifications, tracks progress with checkpoints, uses git worktrees, stops on blockers.
Verify before implementing: For Pine Script version-specific syntax or new built-in functions, search current docs via search_docs before writing code. TradingView updates Pine Script frequently and training data may be stale.
isBull = close > open
barColor = isBull ? color.green : color.red
plot(condition ? value : na)500 bars history for request.security() | 500 plot calls | 64 drawing objects | 40 request.security() calls | 100KB compiled size
request.security() returning [close, high, low] instead of 3 separate callsarray.new<type>(size) instead of push-and-resizeTradingView has no console or debugger. Use these patterns:
label.new(bar_index, high, str.tostring(myVar)) to inspect valuestable.new() with barstate.islast for real-time variable dashboardif input.bool("Debug", false) -- remove before publishingpreviousValue = value[1], flag when historical values changestrategy.* functions: strategy.wintrades, strategy.losstrades, strategy.grossprofitmaxEquity = math.max(strategy.equity, nz(maxEquity[1])), then dd = (maxEquity - strategy.equity) / maxEquity * 100dailyReturn * 252 / (stdDev * math.sqrt(252))close[lookforward] to measure prediction accuracy, track true/false positive ratescolor.from_gradient() for trend strength coloringsize.small for intraday, size.normal for daily+indicator()/strategy()@version, @description, @param tagstooltip="Line 1" + "\n" + "Line 2"input() with sensible defaults.barstate.isconfirmed guard -- calculations on unconfirmed bars cause repainting. Always guard entry signals.input() -- makes the script untestable across instruments.barstate.isconfirmed guard present where needed