Ia pinescript

From iliaal/whetstone · View interactive version

Ia pinescript is an AI agent skill from the GitHub repository iliaal/whetstone. Pine Script v6: syntax, performance, error diagnosis, backtesting, visualization. Use when writing or debugging `.pine` files or TradingView Pine indicators/strategies.

How to use this skill

Skill file

Pine Script Development

Verify before implementing: For Pine Script version-specific syntax or new built-in functions, look up current official docs before writing code. Prefer Context7 (query-docs) when available. Otherwise use available web tools to read the TradingView Pine Script docs for the script's version. TradingView updates Pine Script frequently and training data may be stale.

Critical Syntax Rules

```

isBull = close > open

barColor = isBull ? color.green : color.red

```

Platform Limits

Check the current platform limits before sizing a script: 64 plot counts (one call can consume several); up to 500 line, box, or label IDs each and 100 polyline IDs; 40 unique request.*() calls, or 64 on Ultimate; 100,000 compiled tokens. History buffers, requested intrabars, and chart history have distinct limits; there is no general 500-bar request.security() history limit.

Performance

Debugging

Use Pine Logs through log.info(), log.warning(), and log.error(), plus these visual checks:

Strategy & Backtesting

```pine

var float maxEquity = strategy.equity

maxEquity := math.max(maxEquity, strategy.equity)

dd = maxEquity > 0 ? (maxEquity - strategy.equity) / maxEquity * 100 : na

```

Visualization

Publishing

Common Coding Mistakes

Workflow

  1. Write indicator/strategy in Pine Editor
  2. Test with bar replay and strategy tester on multiple timeframes
  3. Walk-forward validate before trusting backtest results (see Strategy & Backtesting above)
  4. Verify: run on 3+ symbols and 2+ timeframes

Verify

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.