pine-develop

GitHub

自动化Pine Script开发流程,涵盖从需求确认、代码编写、编译调试到图表验证的完整闭环。支持指标和策略开发,通过脚本自动推送至TradingView编辑器并处理错误,确保代码零报错后截图反馈结果。

skills/pine-develop/SKILL.md tradesdontlie/tradingview-mcp

Trigger Scenarios

需要编写或修改TradingView Pine Script指标/策略 遇到Pine Script编译错误需要修复 验证交易策略在图表上的表现

Install

npx skills add tradesdontlie/tradingview-mcp --skill pine-develop -g -y
More Options

Use without installing

npx skills use tradesdontlie/tradingview-mcp@pine-develop

指定 Agent (Claude Code)

npx skills add tradesdontlie/tradingview-mcp --skill pine-develop -a claude-code -g -y

安装 repo 全部 skill

npx skills add tradesdontlie/tradingview-mcp --all -g -y

预览 repo 内 skill

npx skills add tradesdontlie/tradingview-mcp --list

SKILL.md

Frontmatter
{
    "name": "pine-develop",
    "description": "Full Pine Script development loop — write code, compile, fix errors, iterate. Use when building a new indicator or strategy in TradingView."
}

Pine Script Development Loop

You are developing a Pine Script indicator or strategy in TradingView. Follow this loop precisely.

Step 1: Understand the Goal

If not already clear, ask the user:

  • What type? (indicator, strategy, library)
  • What does it do? (entry/exit logic, overlay, oscillator, etc.)
  • Overlay or separate pane?
  • Any specific inputs or visual elements?

Step 2: Pull Current Source (if modifying)

If modifying an existing script:

node scripts/pine_pull.js

Then read scripts/current.pine to understand what's there.

If creating new: start from scratch.

Step 3: Write the Pine Script

Write the complete script to scripts/current.pine. Every script MUST include:

  • //@version=6 header
  • Proper indicator() or strategy() declaration
  • All user inputs with input.*() functions and groups
  • Clear comments for each logical section

For strategies, include:

  • strategy.entry() and strategy.exit() calls
  • Position sizing via strategy() declaration
  • Default commission and slippage settings

Step 4: Push and Compile

node scripts/pine_push.js

This injects the code into TradingView's Pine Editor, clicks compile, and reports any errors.

Step 5: Fix Errors

If errors are reported:

  1. Read the error messages (line number + description)
  2. Edit scripts/current.pine locally — fix the specific lines
  3. Push again: node scripts/pine_push.js
  4. Repeat until 0 errors

Common Pine Script errors:

  • "Mismatched input" — usually indentation (Pine uses 4-space indentation, not braces)
  • "Could not find function or function reference" — typo in function name or wrong version
  • "Undeclared identifier" — variable used before declaration
  • "Cannot call X with argument type Y" — wrong parameter type

Step 6: Verify on Chart

After clean compilation:

  1. capture_screenshot — take a screenshot to verify it looks right
  2. data_get_strategy_results — if it's a strategy, check performance
  3. Show the user the results

Step 7: Iterate

If the user wants changes:

  1. Pull fresh: node scripts/pine_pull.js (in case TV modified anything)
  2. Edit locally
  3. Push + compile
  4. Screenshot to verify

IMPORTANT: Always compile after every change. Never claim "done" without a clean compile.

Version History

  • 1d733f5 Current 2026-07-05 14:43

Same Skill Collection

skills/chart-analysis/SKILL.md
skills/multi-symbol-scan/SKILL.md
skills/replay-practice/SKILL.md
skills/strategy-report/SKILL.md

Metadata

Files
0
Version
1d733f5
Hash
c46b8871
Indexed
2026-07-05 14:43

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-08 14:30
浙ICP备14020137号-1 $bản đồ khách truy cập$