Back to Skills

QuantConnect

derekcrosslu
Updated Today
24 views
0
View on GitHub
Developmentgeneral

About

This skill provides a component library for developing modular QuantConnect strategies using reusable components. It helps developers quickly add indicators, signals, and risk management by discovering and integrating pre-built components rather than writing from scratch. Use it when creating new QuantConnect strategies or troubleshooting QC-specific issues.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/derekcrosslu/CLAUDE_CODE_EXPLORE
Git CloneAlternative
git clone https://github.com/derekcrosslu/CLAUDE_CODE_EXPLORE.git ~/.claude/skills/QuantConnect

Copy and paste this command in Claude Code to install this skill

Documentation

QuantConnect Strategy Development (Component-Based)

Develop modular strategies using reusable components: ./component

When to Load This Skill

  • Creating new QuantConnect strategy
  • Need to add indicators, signals, or risk management
  • Troubleshooting QC-specific issues

Component Library (Progressive Disclosure)

Use components instead of writing from scratch. Load only what you need.

Discovery

# List all components
./component list

# List by category
./component list indicators
./component list signals
./component list risk_management

# Search by keyword
./component search momentum
./component search stop

Integration

# View component code
./component show add_rsi

# Get integration guide
./component explain add_rsi

IMPORTANT: Do not read component source files directly. Use --help and explain commands.

Available Components

Indicators (indicators/)

  • add_rsi - RSI indicator for overbought/oversold
  • add_sma - Simple Moving Average for trend detection

Signals (signals/)

  • mean_reversion - RSI-based mean reversion signals
  • momentum_breakout - SMA crossover momentum signals

Risk Management (risk_management/)

  • stop_loss - Fixed or trailing stop loss

Sentiment (sentiment/)

  • Future: Kalshi prediction market integration

Strategy Development Workflow

1. Plan Strategy

1. Choose hypothesis (mean reversion, momentum, etc.)
2. Select components needed:
   - Indicators: RSI, SMA, MACD?
   - Signals: Mean reversion, breakout?
   - Risk: Stop loss, position sizing?

2. Browse Components

./component list
./component explain COMPONENT

3. Build Strategy

from AlgorithmImports import *
from strategy_components.indicators.add_rsi import add_rsi
from strategy_components.signals.mean_reversion import MeanReversionSignal

class MyStrategy(QCAlgorithm):
    def Initialize(self):
        # Add components
        self.rsi = add_rsi(self, symbol="SPY", period=14)
        self.signal = MeanReversionSignal(oversold=30, overbought=70)
        
    def OnData(self, data):
        # Use components
        if self.rsi.IsReady:
            signal = self.signal.get_signal(self.rsi.Current.Value, self.is_long)
            # Execute trades...

4. Test Strategy

# Local test first (if possible)
# Then: ./qc_backtest run --strategy strategy.py

Common Patterns

Mean Reversion

# Components: add_rsi, mean_reversion
self.rsi = add_rsi(self, "SPY", period=14)
self.signal = MeanReversionSignal(oversold=30, overbought=70)

Momentum Breakout

# Components: add_sma, momentum_breakout
self.sma = add_sma(self, "SPY", period=20)
self.signal = MomentumBreakoutSignal(volume_confirmation=True)

With Stop Loss

# Add: stop_loss component
self.stop_loss = StopLossManager(stop_loss_pct=0.05, trailing=False)
# Call: self.stop_loss.set_entry_price(price) after entry
# Check: if self.stop_loss.should_exit(current_price): ...

Beyond MCP Principles

  1. Use component CLI, not source code

    • ./component list - browse available
    • ./component explain COMPONENT - integration guide
    • Don't read .py files directly
  2. Progressive Disclosure

    • Load only components you need
    • Don't load entire 955-line skill
  3. Modular Architecture

    • Components are independent
    • Mix and match as needed
    • Reuse across strategies

Critical QC Errors (Still Important)

Error 1: SMA NoneType

Problem: self.sma.Current is None Fix: Check if self.sma.IsReady before using

Error 2: Data Key Missing

Problem: KeyError on data[self.symbol] Fix: Check if data.ContainsKey(self.symbol) first

Error 3: Warmup Issues

Problem: Strategy trades during warmup Fix: if self.IsWarmingUp: return

Authoritative Documentation

When confused about QC API or architecture:

Do not guess. Use component CLI and QC docs as source of truth.


Context Savings: 120 lines (vs 955 lines in old skill) = 87% reduction

Progressive Disclosure: Use component CLI to load only what you need

Trifecta: CLI works for humans, teams, AND agents

Beyond MCP Pattern: Use --help and explain, not source code

GitHub Repository

derekcrosslu/CLAUDE_CODE_EXPLORE
Path: .claude/skills/quantconnect

Related Skills

subagent-driven-development

Development

This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.

View skill

algorithmic-art

Meta

This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.

View skill

executing-plans

Design

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

View skill

cost-optimization

Other

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

View skill