A Claude Code plugin for AI-powered trading indicator development across TradingView (Pine Script), NinjaTrader (NinjaScript), and Tradovate (JavaScript).
Version: 1.0.0 | Author: Luther Barnum
This plugin provides 33 specialized commands, 10 AI agents, and 3 pattern libraries for developing trading indicators across three major platforms:
| Platform | Language | Commands |
|---|---|---|
| TradingView | Pine Script v5/v6 | 11 |
| NinjaTrader 8 | NinjaScript (C#) | 11 |
| Tradovate | JavaScript | 11 |
- Create new indicators with proper structure and conventions
- Convert indicators between platforms automatically
- Validate syntax against official documentation
- Debug runtime errors with platform-specific guidance
- Refactor code for better organization and performance
- Document indicators with auto-generated README files
# Clone the repository
git clone https://github.com/lgbarn/trading-indicator-plugins.git
# Add to Claude Code plugins
claude plugins add ./trading-indicator-pluginsclaude plugins add github:lgbarn/trading-indicator-pluginsclaude plugins listYou should see trading-indicators in the list.
/trading-indicators:pine:new-indicator MyVWAP --v6
/trading-indicators:pine:convert LB_MyVWAP.pine --to ninja
/trading-indicators:ninja:add-feature MyVWAPLB.cs "VWAP bands with 2SD"
/trading-indicators:tradovate:validate MyIndicatorLB.js
All three platforms share the same 11 commands. Invoke them using:
/trading-indicators:<platform>:<command> [arguments]
Where <platform> is pine, ninja, or tradovate.
| Command | Arguments | Description |
|---|---|---|
new-indicator |
<name> [--v5|--v6] |
Create a new indicator from scratch |
add-feature |
<file> <feature> |
Add functionality to existing indicator |
validate |
<file> |
Check syntax against official docs |
test |
<file> [--validate|--logic] |
Validate structure and calculation logic |
debug |
<file> [--error <msg>] |
Troubleshoot runtime errors |
explain |
<file> |
Analyze and explain what indicator does |
convert |
<file> --to <platform> |
Translate to another platform |
compare |
<file1> <file2> |
Compare indicators or versions |
refactor |
<file> [--organize|--optimize] |
Improve code organization |
cleanup |
<file> |
Remove unused code, fix formatting |
document |
<file> [--format md|inline] |
Generate documentation |
Creates a new indicator with proper file structure, headers, and organization.
Pine Script:
/trading-indicators:pine:new-indicator SessionVWAP --v6
Creates LB_SessionVWAP.pine with Pine Script v6 structure.
NinjaScript:
/trading-indicators:ninja:new-indicator SessionVWAP
Creates SessionVWAPLB.cs with proper C# namespace and lifecycle methods.
Tradovate:
/trading-indicators:tradovate:new-indicator SessionVWAP
Creates SessionVWAPLB.js with proper exports and class structure.
Adds new functionality to an existing indicator file.
Supported Features:
- Price levels: VWAP bands, Initial Balance extensions, Pivot Points
- Visual elements: Labels, background shading, candle coloring
- Calculations: TWAP, standard deviation bands, session detection
- Interactivity: Alert conditions, feature toggles, theme switching
Example:
/trading-indicators:pine:add-feature LB_MyVWAP.pine "2SD and 3SD bands"
Converts an indicator from one platform to another.
Example - Pine to NinjaScript:
/trading-indicators:pine:convert LB_MyVWAP.pine --to ninja
Example - NinjaScript to Tradovate:
/trading-indicators:ninja:convert MyVWAPLB.cs --to tradovate
Automatic Mappings:
| Concept | Pine Script | NinjaScript | Tradovate |
|---|---|---|---|
| Close price | close |
Close[0] |
d.close() |
| Previous close | close[1] |
Close[1] |
history.prior().close() |
| SMA | ta.sma(src, len) |
SMA(src, len)[0] |
SMA(len)(value) |
| New session | ta.change(time("D")) |
Bars.IsFirstBarOfSession |
d.tradeDate() !== lastDate |
Checks indicator code against official platform documentation.
/trading-indicators:pine:validate LB_MyVWAP.pine
Checks include:
- Function signature correctness
- Deprecated function detection
- Version compatibility
- Resource limit compliance
Validates indicator structure and tests calculation correctness.
Structure validation:
/trading-indicators:ninja:test MyVWAPLB.cs --validate
Logic validation:
/trading-indicators:ninja:test MyVWAPLB.cs --logic
Tests include:
- Required sections present
- Input/parameter definitions
- Plot validity
- Edge case handling (first bar, zero volume, session boundaries)
Identifies and fixes runtime errors.
/trading-indicators:tradovate:debug MyIndicatorLB.js --error "undefined is not a function"
Common issues handled:
| Platform | Error Type |
|---|---|
| Pine Script | NA values, array bounds, label limits |
| NinjaScript | NullReferenceException, IndexOutOfRange |
| Tradovate | undefined functions, null history access |
Analyzes and explains what an indicator does in plain language.
/trading-indicators:pine:explain LB_MyVWAP.pine
Output includes:
- Purpose summary
- Input documentation
- Calculation steps
- Trading interpretation
- Dependencies
Reorganizes code for better structure and performance.
Modes:
/trading-indicators:pine:refactor LB_MyVWAP.pine --organize # Group inputs, organize sections
/trading-indicators:pine:refactor LB_MyVWAP.pine --modernize # Update to latest syntax
/trading-indicators:pine:refactor LB_MyVWAP.pine --optimize # Performance improvements
/trading-indicators:pine:refactor LB_MyVWAP.pine --cleanup # Remove unused code
Compares two indicators or cross-platform versions.
Same platform:
/trading-indicators:pine:compare LB_MyVWAP_v1.pine LB_MyVWAP_v2.pine
Cross-platform:
/trading-indicators:pine:compare LB_MyVWAP.pine MyVWAPLB.cs --cross-platform
Removes unused variables, commented code, and fixes formatting.
/trading-indicators:ninja:cleanup MyVWAPLB.cs
Creates documentation from indicator code.
Markdown README:
/trading-indicators:pine:document LB_MyVWAP.pine --format md
Inline comments:
/trading-indicators:pine:document LB_MyVWAP.pine --format inline
The plugin includes scaffold patterns for each platform. Invoke them to get structure guidance:
/trading-indicators:pine-patterns
/trading-indicators:ninja-patterns
/trading-indicators:tradovate-patterns
- Input group structure (Feature Toggles, Settings, Colors)
- Session detection with timezone handling
- VWAP calculation with standard deviation bands
- Persistent state using
varkeyword - Resource limit management
- Namespace and class structure
- Lifecycle methods (
OnStateChange,OnBarUpdate) - Property attributes with validation
- Series object initialization
- Drawing object patterns
- Class structure (
init,map,filter) - Module exports with params and plots
- History access patterns
- Session detection with
tradeDate() - Helper function initialization
The plugin provides 10 specialized AI agents:
| Agent | Role | Use When |
|---|---|---|
pine-expert |
Pine Script v5/v6 specialist | Creating/modifying Pine indicators |
ninjascript-expert |
NinjaTrader 8 C# specialist | Creating/modifying NinjaScript |
tradovate-expert |
Tradovate JavaScript specialist | Creating/modifying Tradovate |
converter |
Cross-platform translation | Converting between platforms |
code-reviewer |
Quality review (read-only) | Pre-commit code review |
debugger |
Error troubleshooting | Runtime error analysis |
testing-agent |
Structure/logic validation | Pre-deployment validation |
documentation-generator |
README generation | Creating user docs |
performance-analyzer |
Optimization analysis (read-only) | Performance bottlenecks |
doc-researcher |
Official docs lookup | Syntax verification |
User: Create a new Pine Script v6 indicator that calculates session VWAP
with 1SD and 2SD bands for /ES futures
Claude: [Invokes /trading-indicators:pine:new-indicator SessionVWAP --v6]
I'll create a new Pine Script v6 indicator with:
- Session VWAP calculation with reset at RTH open (9:30 AM ET)
- 1 and 2 standard deviation bands
- Proper input groups for customization
[Creates LB_SessionVWAP.pine]
User: Convert my VWAP indicator to NinjaTrader
Claude: [Invokes /trading-indicators:pine:convert LB_SessionVWAP.pine --to ninja]
Converting with the following mappings:
- close → Close[0]
- ta.sma() → SMA()[0]
- input.int() → [NinjaScriptProperty] int
- session detection → Bars.IsFirstBarOfSession
[Creates SessionVWAPLB.cs]
User: My NinjaScript indicator shows "Index was outside the bounds of the array"
Claude: [Invokes /trading-indicators:ninja:debug MyIndicatorLB.cs --error "Index outside bounds"]
Root cause: Accessing Close[10] when CurrentBar < 10
Fix: Add bar history check
Before: double value = Close[10];
After: if (CurrentBar < 10) return;
double value = Close[10];
All indicators developed with this plugin are optimized for:
| Setting | Value |
|---|---|
| Instruments | /ES (S&P 500), /NQ (Nasdaq 100) futures |
| Timeframe | 5-minute bars |
| Session | RTH 9:30 AM - 4:00 PM ET |
| Timezone | America/New_York |
- VWAP - Volume Weighted Average Price with standard deviation bands
- TWAP - Time Weighted Average Price for confirmation
- Initial Balance - First 30-60 minutes range
- Classic Pivots - Daily/weekly pivot levels
trading-indicator-plugins/
├── plugins/
│ └── trading-indicators/
│ ├── .claude-plugin/
│ │ └── plugin.json # Plugin configuration
│ ├── agents/ # 10 specialized agents
│ │ ├── pine-expert.md
│ │ ├── ninjascript-expert.md
│ │ ├── tradovate-expert.md
│ │ ├── converter.md
│ │ ├── code-reviewer.md
│ │ ├── debugger.md
│ │ ├── testing-agent.md
│ │ ├── documentation-generator.md
│ │ ├── performance-analyzer.md
│ │ └── doc-researcher.md
│ ├── commands/ # 33 commands (11 per platform)
│ │ ├── pine/
│ │ ├── ninja/
│ │ └── tradovate/
│ └── skills/ # 3 pattern libraries
│ ├── pine-patterns/
│ ├── ninja-patterns/
│ └── tradovate-patterns/
└── README.md
| Platform | Pattern | Example |
|---|---|---|
| Pine Script | LB_<Name>.pine |
LB_SessionVWAP.pine |
| NinjaScript | <Name>LB.cs |
SessionVWAPLB.cs |
| Tradovate | <Name>LB.js |
SessionVWAPLB.js |
All commands follow a consistent workflow:
- Discussion First - Claude discusses the approach before generating code
- Documentation Verification - Syntax verified against official docs
- Approval Required - Changes presented for approval before implementation
- No Auto-Commit - Users test and commit changes manually
- Claude Code CLI
- For development:
- TradingView account (Pine Script)
- NinjaTrader 8 (NinjaScript)
- Tradovate account (JavaScript)
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
MIT License - See LICENSE file for details.
For issues or questions:
- Open an issue on GitHub
- Check the Claude Code documentation