← 返回 Skills 市场
iliaal

ia-pinescript

作者 Ilia Alshanetsky · GitHub ↗ · v3.0.4 · MIT-0
cross-platform ✓ 安全检测通过
290
总下载
0
收藏
0
当前安装
11
版本数
在 OpenClaw 中安装
/install compound-eng-pinescript
功能描述
Pine Script v6: syntax, performance, error diagnosis, backtesting, visualization. Use when writing or debugging `.pine` files or TradingView Pine indicators/...
使用说明 (SKILL.md)

Pine Script Development

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.

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\x3Ctype>(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" + "\ " + "Line 2"
  • TradingView House Rules: no financial advice, no performance guarantees, no external links, no obfuscated code, no donation requests

Common Coding Mistakes

  • Indicator stacking (RSI + Stochastics + CCI) -- all measure the same thing (momentum). Use indicators from different categories instead.
  • Overfitting parameters: if optimal values are oddly specific (RSI 23 instead of 20), the backtest is curve-fitted. Use round numbers and input() with sensible defaults.
  • Missing barstate.isconfirmed guard -- calculations on unconfirmed bars cause repainting. Always guard entry signals.
  • Hardcoded thresholds without input() -- makes the script untestable across instruments.

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

  • Indicator compiles without errors on TradingView
  • No repainting: barstate.isconfirmed guard present where needed
  • Walk-forward tested on 3+ symbols across different timeframes
安全使用建议
This skill is an instruction-only Pine Script style/diagnostic guide and appears coherent with its stated purpose. Because it is documentation only, it does not request credentials or install code. Consider: (1) verify the agent's `search_docs` implementation uses an authoritative TradingView/Pine source if you rely on it for up-to-date syntax; (2) review any code the agent generates before publishing to TradingView (remove debug artifacts and ensure no forward-looking test hooks remain); (3) if you integrate this into an automated pipeline, test trigger rules to avoid misfiring in non-Pine contexts (the included findings-log shows this was previously tightened).
功能分析
Type: OpenClaw Skill Name: compound-eng-pinescript Version: 3.0.4 The skill bundle provides legitimate technical guidance and best practices for Pine Script v6 development, debugging, and backtesting within TradingView. The instructions in SKILL.md are focused on syntax rules, performance optimization, and compliance with TradingView's house rules, with no evidence of malicious intent, data exfiltration, or harmful prompt injection.
能力评估
Purpose & Capability
Name/description (Pine Script v6: syntax, performance, debugging, backtesting, visualization) matches the SKILL.md content. The skill is instruction-only and requests no binaries, installs, or credentials — appropriate for a language-pattern helper.
Instruction Scope
SKILL.md contains Pine-specific guidance (syntax rules, debugging patterns, performance tips, backtesting workflow) and does not instruct the agent to read arbitrary local files, exfiltrate data, or call unexpected external endpoints. The sole runtime directive to 'search current docs via `search_docs`' is a reasonable step to verify up-to-date Pine features and is scoped to documentation lookup.
Install Mechanism
No install spec and no code files — the skill is purely documentation/instructional, which is the lowest-risk install model.
Credentials
The skill declares no required environment variables, credentials, or config paths. The instructions do not reference hidden env vars or secrets, so there is no disproportionate access requested.
Persistence & Privilege
Skill is not always-enabled and does not request special privileges. Autonomous invocation is allowed (platform default) but there are no additional persistent privileges or system modifications requested.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install compound-eng-pinescript
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /compound-eng-pinescript 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v3.0.4
v3.0.4
v3.0.3
v3.0.3
v3.0.2
v3.0.2
v3.0.1
v3.0.1
v3.0.0
v3.0.0
v2.56.1
v2.56.1
v2.56.0
v2.56.0
v2.55.1
v2.55.1
v2.55.0
v2.55.0
v2.53.2
v2.53.2
v2.53.0
v2.53.0
元数据
Slug compound-eng-pinescript
版本 3.0.4
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 11
常见问题

ia-pinescript 是什么?

Pine Script v6: syntax, performance, error diagnosis, backtesting, visualization. Use when writing or debugging `.pine` files or TradingView Pine indicators/... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 290 次。

如何安装 ia-pinescript?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install compound-eng-pinescript」即可一键安装,无需额外配置。

ia-pinescript 是免费的吗?

是的,ia-pinescript 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

ia-pinescript 支持哪些平台?

ia-pinescript 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 ia-pinescript?

由 Ilia Alshanetsky(@iliaal)开发并维护,当前版本 v3.0.4。

💬 留言讨论