一键导入
pine-develop
// Full Pine Script development loop — write code, compile, fix errors, iterate. Use when building a new indicator or strategy in TradingView.
// Full Pine Script development loop — write code, compile, fix errors, iterate. Use when building a new indicator or strategy in TradingView.
| 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. |
You are developing a Pine Script indicator or strategy in TradingView. Follow this loop precisely.
Power-toolkit shortcut: before applying significant edits, call
pine_checkfor a server-side compile check (no chart needed) and runpine_analyzefor offline static analysis. If you're about to overwrite an existing chart's indicators, usestate_snapshotfirst so the user can revert withstate_restore.
If not already clear, ask the user:
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.
Write the complete script to scripts/current.pine. Every script MUST include:
//@version=6 headerindicator() or strategy() declarationinput.*() functions and groupsFor strategies, include:
strategy.entry() and strategy.exit() callsstrategy() declarationnode scripts/pine_push.js
This injects the code into TradingView's Pine Editor, clicks compile, and reports any errors.
If errors are reported:
scripts/current.pine locally — fix the specific linesnode scripts/pine_push.jsCommon Pine Script errors:
After clean compilation:
capture_screenshot — take a screenshot to verify it looks rightdata_get_strategy_results — if it's a strategy, check performanceIf the user wants changes:
node scripts/pine_pull.js (in case TV modified anything)IMPORTANT: Always compile after every change. Never claim "done" without a clean compile.
Analyze a chart — set up symbol/timeframe, add indicators, scroll to key dates, annotate, and screenshot. Use when the user wants technical analysis or chart review.
Post-trade review — pull losing trades from the strategy tester, screenshot each entry in context, and cluster common failure patterns. Use when the user asks "why am I losing?", "review my losses", or "what's wrong with my strategy?".
Daily morning scan — load saved morning layout, screenshot watchlist symbols, and summarize overnight pre-market state. Use when the user says "good morning", "morning prep", or asks for a pre-open briefing.
Cross-asset reasoning across a multi-pane layout — set a 2x2 grid, assign correlated symbols to each pane, and identify leader/laggard/divergence. Use when the user asks to "compare indices", "watch the complex", or wants correlated-asset reasoning.
Scan multiple symbols for setups, patterns, or strategy performance. Use when comparing across instruments or screening for opportunities.
Migrate Pine Script v4 / v5 source to v6 — analyze, apply migration rules, compile-check, iterate until clean. Use when the user hands over an older script or asks to "upgrade to v6" / "port this Pine code".