skills/pinescript/SKILL.md
Pine Script v6: syntax, performance, error diagnosis, backtesting, visualization. Use when writing or debugging `.pine` files or TradingView Pine indicators/strategies.
npx skillsauth add iliaal/ai-skills pinescriptInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Verify 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 neededtools
Tailwind CSS v4 patterns: CSS-first config, utility classes, component variants, v3 migration. Use when styling with Tailwind, configuring @theme tokens, using tailwind-variants/CVA, migrating v3 to v4, or fixing Tailwind styles and dark mode.
development
Simplifies, polishes, and declutters code without changing behavior. Use when asked to simplify, clean up, refactor, declutter, remove dead code or AI slop, or improve readability. For analysis-only reports without code changes, use code-simplicity-reviewer agent.
development
React architecture patterns, TypeScript, Next.js, hooks, and testing. Use when working with React component structure, state management, Next.js routing, Vitest, React Testing Library, or reviewing React code. For visual design and aesthetic direction, use frontend-design instead.
development
Node.js backend patterns: layered architecture, TypeScript, validation, error handling, security, deployment. Use when building REST APIs, REST endpoints, middleware, Express/Fastify/Hono/NestJS/Koa servers, tRPC procedures, Bun servers, or server-side TypeScript.