Back to Discover

trading-indicator-plugins

plugin

lgbarn

Claude Code plugin marketplace for trading indicator development (Pine Script, NinjaScript, Tradovate)

View on GitHub
30 starsSynced Aug 2, 2026

Install to Claude Code

/plugin marketplace add lgbarn/trading-indicator-plugins

README

Trading Indicators Plugin for Claude Code

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


Overview

This plugin provides 33 specialized commands, 10 AI agents, and 3 pattern libraries for developing trading indicators across three major platforms:

PlatformLanguageCommands
TradingViewPine Script v5/v611
NinjaTrader 8NinjaScript (C#)11
TradovateJavaScript11

Key Features

  • 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

Installation

Option 1: Clone and Install

# Clone the repository
git clone https://github.com/lgbarn/trading-indicator-plugins.git

# Add to Claude Code plugins
claude plugins add ./trading-indicator-plugins

Option 2: Direct Install from GitHub

claude plugins add github:lgbarn/trading-indicator-plugins

Verify Installation

claude plugins list

You should see trading-indicators in the list.


Quick Start

Create a New Pine Script Indicator

/trading-indicators:pine:new-indicator MyVWAP --v6

Convert Pine Script to NinjaScript

/trading-indicators:pine:convert LB_MyVWAP.pine --to ninja

Add Features to an Existing Indicator

/trading-indicators:ninja:add-feature MyVWAPLB.cs "VWAP bands with 2SD"

Validate Indicator Syntax

/trading-indicators:tradovate:validate MyIndicatorLB.js

Commands Reference

All three platforms share the same 11 commands. Invoke them using:

/trading-indicators:<platform>:<command> [arguments]

Where <platform> is pine, ninja, or tradovate.

Command Summary

CommandArgumentsDescription
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

Detailed Command Reference

new-indicator - Create New Indicator

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.


add-feature - Enhance Existing Indicator

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"

convert - Cross-Platform Translation

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:

ConceptPine ScriptNinjaScriptTradovate
Close pricecloseClose[0]d.close()
Previous closeclose[1]Close[1]history.prior().close()
SMAta.sma(src, len)SMA(src, len)[0]SMA(len)(value)
New sessionta.change(time("D"))Bars.IsFirstBarOfSessiond.tradeDate() !== lastDate

validate - Syntax Validation

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

test - Structure & Logic Validation

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)

debug - Error Troubleshooting

Identifies and fixes runtime errors.

/trading-indicators:tradovate:debug MyIndicatorLB.js --error "undefined is not a function"

Common issues handled:

PlatformError Type
Pine ScriptNA values, array bounds, label limits
NinjaScriptNullReferenceException, IndexOutOfRange
Tradovateundefined functions, null history access

explain - Indicator Analysis

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

refactor - Code Improvement

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

compare - Indicator Comparison

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

cleanup - Remove Dead Code

Removes unused variables, commented code, and fixes formatting.

/trading-indicators:ninja:cleanup MyVWAPLB.cs

document - Generate Documentation

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

Pattern Libraries

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

Pine Script Patterns

  • Input group structure (Feature Toggles, Settings, Colors)
  • Session detection with timezone handling
  • VWAP calculation with standard deviation bands
  • Persistent state using var keyword
  • Resource limit management

NinjaScript Patterns

  • Namespace and class structure
  • Lifecycle methods (OnStateChange, OnBarUpdate)
  • Property attributes with validation
  • Series object initialization
  • Drawing object patterns

Tradovate Patterns

  • Class structure (init, map, filter)
  • Module exports with params and plots
  • History access patterns
  • Session detection with tradeDate()
  • Helper function initialization

Specialized Agents

The plugin provides 10 specialized AI agents:

AgentRoleUse When
pine-expertPine Script v5/v6 specialistCreating/modifying Pine indicators
ninjascript-expertNinjaTrader 8 C# specialistCreating/modifying NinjaScript
tradovate-expertTradovate JavaScript specialistCreating/modifying Tradovate
converterCross-platform translationConverting between platforms
code-reviewerQuality review (read-only)Pre-commit code review
debuggerError troubleshootingRuntime error analysis
testing-agentStructure/logic validationPre-deployment validation
documentation-generatorREADME generationCreating user docs
performance-analyzerOptimization analysis (read-only)Performance bottlenecks
doc-researcherOfficial docs lookupSyntax verification

Usage Examples

Example 1: Create a Session VWAP Indicator

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]

Example 2: Convert Pine Script to NinjaScript

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]

Example 3: Debug a Runtime Error

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];

Trading Context

All indicators developed with this plugin are optimized for:

SettingValue
Instruments/ES (S&P 500), /NQ (Nasdaq 100) futures
Timeframe5-minute bars
SessionRTH 9:30 AM - 4:00 PM ET
TimezoneAmerica/New_York

Key Concepts

  • 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

Project Structure

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

File Naming Conventions

PlatformPatternExample
Pine ScriptLB_<Name>.pineLB_SessionVWAP.pine
NinjaScript<Name>LB.csSessionVWAPLB.cs
Tradovate<Name>LB.jsSessionVWAPLB.js

Workflow Philosophy

All commands follow a consistent workflow:

  1. Discussion First - Claude discusses the approach before generating code
  2. Documentation Verification - Syntax verified against official docs
  3. Approval Required - Changes presented for approval before implementation
  4. No Auto-Commit - Users test and commit changes manually

Requirements

  • Claude Code CLI
  • For development:
    • TradingView account (Pine Script)
    • NinjaTrader 8 (NinjaScript)
    • Tradovate account (JavaScript)

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

License

MIT License - See LICENSE file for details.


Support

For issues or questions:

Rendered live from lgbarn/trading-indicator-plugins's GitHub README — not stored, always reflects the source repo.

1 Plugin

NameDescriptionCategorySource
trading-indicatorsTrading indicator development for TradingView, NinjaTrader, and Tradovate./plugins/trading-indicators

0 Comments

Login required
Log in to post a comment or update on this repo.

No comments yet — be the first to share an update.