pine-backtester
Implements comprehensive backtesting and performance metrics. Use when adding trade analysis, equity curves, or statistical…
Analyzes trading concepts and YouTube videos to extract Pine Script specifications. Use when planning indicators or analyzing video tutorials.
$ npx -y skills add traderspost/pinescript-agents --skill pine-visualizer --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/pine-visualizerContext preview
The summary Claude sees to decide when to auto-load this skill.
Analyzes trading concepts and YouTube videos to extract Pine Script specifications. Use when planning indicators or analyzing video tutorials.
name: pine-visualizer description: Analyzes trading concepts and YouTube videos to extract Pine Script specifications. Use when planning indicators or analyzing video tutorials. allowed-tools: Read, Glob, Grep, Bash, WebFetch
Specialized in decomposing complex trading ideas into actionable Pine Script components.
**IMMEDIATELY run the video analyzer** - do not ask for permission:
python tools/video-analyzer.py "<youtube_url>"
The tool automatically: 1. **Fetches video metadata** (title, author, duration) 2. **Extracts transcript** using the fastest available method:
3. **Analyzes trading content**:
4. **Generates a specification** for Pine Script implementation 5. **Saves analysis** to `projects/analysis/` for reference
# Standard analysis (uses YouTube captions, fast) python tools/video-analyzer.py "https://youtube.com/watch?v=ABC123" # Force Whisper transcription (slower but works without captions) python tools/video-analyzer.py "https://youtube.com/watch?v=ABC123" --whisper # Use larger Whisper model for better accuracy python tools/video-analyzer.py "https://youtube.com/watch?v=ABC123" --whisper --model medium # Output raw JSON for programmatic use python tools/video-analyzer.py "https://youtube.com/watch?v=ABC123" --json
1. **Review the analysis** with the user 2. **Confirm understanding** - ask if the extracted concepts match their expectations 3. **Refine if needed** - user can describe adjustments 4. **Proceed to implementation** - hand off to pine-developer skill
**When breaking down trading ideas, ALWAYS plan for UDT architecture FIRST.**
Plan for UDT architecture when the trading idea involves:
When decomposing a trading idea, include this section:
UDT ARCHITECTURE: 1. Type Definition - What fields does each instance need? - Include time + bar_index for coordinates - Include drawing objects as fields 2. Storage - Single var array for collection - Named instances for special cases (original, live, current) 3. Methods - delete(): Clean up drawing objects - draw(): Create visuals using xloc.bar_time - calculateY(): If line-based calculations needed 4. Coordinate Strategy - Store TIME when events occur (for unlimited lookback drawing) - Store bar_index for Y calculations (slope * bar + intercept)
**User Request**: "Create an indicator that marks swing highs and draws levels from them"
**UDT-First Breakdown**:
UDT ARCHITECTURE:
1. Type Definition:
type SwingHigh
int detectedTime // When swing was detected
int detectedBar // For Y calculations
float price // The high price
int confirmedTime // When confirmed
line levelLine = na // Horizontal level from swing
label marker = na // Label marking the swing
2. Storage:
var array<SwingHigh> swingHighs = array.new<SwingHigh>()
var SwingHigh currentPending = na // Unconfirmed swing
3. Methods:
method delete(SwingHigh this) =>
if not na(this.levelLine)
line.delete(this.levelLine)
if not na(this.marker)
label.delete(this.marker)
method draw(SwingHigh this, color lineColor) =>
this.delete()
// Use xloc.bar_time for unlimited lookback!
this.levelLine := line.new(this.detectedTime, this.price,
time, this.price, xloc=xloc.bar_time, ...)
this.marker := label.new(this.detectedTime, this.price,
"SH", xloc=xloc.bar_time, ...)
4. Coordinate Strategy:
When swing detected:
capturedTime := time // For drawing
capturedBar := bar_index // For calculationsWhen analyzing a trading idea, flag these issues:
| If the idea has... | Flag this issue... | Recommend instead... | |--------------------|--------------------|----------------------| | Multiple related values | Don't use parallel arrays | Use single UDT array | | Historical drawings | bar_index has 5000 limit | Use xloc.bar_time | | Repeated drawing code | DRY violation | UDT draw() method | | Manual line deletion | Error-prone | UDT delete() method |
When analyzing and planning implementations, consider these critical 2025 updates:
**March 2025: Use `for...in` for Collections** When planning loop-based implementations (order blocks, swing detection, pattern scanning):
// ✅ BEST: Use for...in for arrays (safe, clean, preferred)
for element in myArray
// Process element directly - no boundary issues
// ✅ BEST: With index when needed (e.g., order blocks, swing points)
for [index, element] in myArray
// Have both index and value
// ✅ Works with maA comprehensive Pine Script development environment powered by Claude Code's Skills system. This tool helps you create professional TradingView indicators and strategies with AI assistance. Just type start to begin!
Implements comprehensive backtesting and performance metrics. Use when adding trade analysis, equity curves, or statistical…
Troubleshoots Pine Script issues and adds debugging capabilities. Use when scripts have errors or unexpected behavior.
Writes production-quality Pine Script v6 code following TradingView guidelines. Use when implementing indicators, strategies, or…
Orchestrates complex Pine Script projects by coordinating multiple development phases. Use for complete trading systems.
Optimizes Pine Script for performance and user experience. Use when improving speed, UI organization, or visual appeal.
Prepares Pine Scripts for TradingView publication with documentation and compliance checks. Use when finalizing scripts for…