Install
openclaw skills install compound-eng-pinescriptPine Script v6: syntax, performance, error diagnosis, backtesting, visualization. Use when writing or debugging `.pine` files or TradingView Pine indicators/strategies.
openclaw skills install compound-eng-pinescriptVerify before implementing: For Pine Script version-specific syntax or new built-in functions, look up current docs via Context7 (query-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