Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Pinescript

ASecurity

Pine Script v6 patterns: syntax rules, performance, debugging, backtesting, visualization. Use when asked to "write a Pine Script", "create an indicator", "build a strategy", "fix Pine code", or mentions PineScript, TradingView, indicator, strategy, or backtest.

36 stars
0 votes
0 copies
1 views
Added 5/28/2026
ai-agentsgotestingdebuggingsecurityperformancedocumentation

Security Analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned 5/28/2026

$npx -y skills add iliaal/whetstone --skill pinescript --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pinescript?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Pinescript
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/iliaal-pinescript/badge)](https://www.skillsdirectory.com/skills/iliaal-pinescript)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: pinescript
description: >-
  Pine Script v6 patterns: syntax rules, performance, debugging, backtesting,
  visualization. Use when asked to "write a Pine Script", "create an
  indicator", "build a strategy", "fix Pine code", or mentions PineScript,
  TradingView, indicator, strategy, or backtest.
---

# Pine Script Development

## Critical Syntax Rules

- **Ternary operators MUST stay on one line** — splitting across lines causes "end of line without line continuation" error. For complex ternaries, use intermediate variables:
  ```
  isBull = close > open
  barColor = isBull ? color.green : color.red
  ```
- **Continuation lines MUST be indented MORE than the starting line** — same indentation = error
- **NEVER use plot() inside local scopes** (if/for/functions) — use conditional value instead: `plot(condition ? value : na)`
- **barstate.isconfirmed** — use to prevent repainting on real-time bars

## Platform Limits

500 bars history for `request.security()` | 500 plot calls | 64 drawing objects | 40 `request.security()` calls | 100KB compiled size

## Performance

- **Tuple security calls** — one `request.security()` returning `[close, high, low]` instead of 3 separate calls
- Pre-allocate arrays with `array.new<type>(size)` instead of push-and-resize
- Short-circuit signals: build conditions incrementally, exit early when first condition fails
- Cache repeated calculations in variables — Pine recalculates every bar

## Debugging

TradingView has no console or debugger. Use these patterns:

- **Label debugging**: `label.new(bar_index, high, str.tostring(myVar))` to inspect values
- **Table monitor**: `table.new()` with `barstate.islast` for real-time variable dashboard
- **Debug mode toggle**: wrap all debug code in `if input.bool("Debug", false)` — remove before publishing
- **Repainting detector**: track `previousValue = value[1]`, flag when historical values change

## Strategy & Backtesting

- Use `strategy.*` functions: `strategy.wintrades`, `strategy.losstrades`, `strategy.grossprofit`
- Drawdown tracking: `maxEquity = math.max(strategy.equity, nz(maxEquity[1]))`, then `dd = (maxEquity - strategy.equity) / maxEquity * 100`
- Sharpe: `dailyReturn * 252 / (stdDev * math.sqrt(252))`
- **Walk-forward validation** — optimize on period 1, test on period 2, re-optimize on period 2, test on period 3. If metrics degrade > 30%, parameters are overfit.
- **Indicator accuracy testing** — use forward-looking `close[lookforward]` to measure prediction accuracy, track true/false positive rates

## Visualization

- `color.from_gradient()` for trend strength coloring
- Adaptive text sizing: `size.small` for intraday, `size.normal` for daily+
- Dynamic table rows — resize based on enabled features via input toggles
- Professional color constants: define BULL_COLOR, BEAR_COLOR, NEUTRAL_COLOR once with transparency

## Publishing

- Documentation goes at TOP of .pine file as comments before `indicator()`/`strategy()`
- Use `@version`, `@description`, `@param` tags
- Multi-line tooltips: `tooltip="Line 1" + "\n" + "Line 2"`
- **TradingView House Rules**: no financial advice, no performance guarantees, no external links, no obfuscated code, no donation requests

## Anti-Patterns

- Indicator stacking (RSI + Stochastics + CCI) — all measure the same thing (momentum). Use indicators from different categories instead.
- Trading divergence without structure confirmation — wait for break above prior swing high before entry, divergence alone can persist far longer than expected
- Overfitting signals: if optimal parameters are oddly specific (RSI 23 instead of 20), the backtest is curve-fitted. Use round numbers.
- Treating support/resistance as exact prices — they are zones (crypto 1-3%, forex 20-50 pips)

Attribution

iliaaliliaal
View sourceSee grades on GitHubMore from iliaal →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →