quant-trading-system

Complete quantitative trading stack with risk management, circuit breakers, and execution hooks

View on GitHub
Author jmanhype
Namespace @jmanhype/multi-agent-intelligence-marketplace
Category general
Version 1.0.0
Stars 16
Downloads 5
self.md verified
Table of content

Complete quantitative trading stack with risk management, circuit breakers, and execution hooks

Installation

npx claude-plugins install @jmanhype/multi-agent-intelligence-marketplace/quant-trading-system

Contents

Files: README.md, plugin.json

Documentation

Complete production-grade quantitative trading stack for cryptocurrency markets.

Features

๐Ÿ›ก๏ธ Safety First

๐Ÿ“Š Trading Infrastructure

๐Ÿ”„ Automated Workflows

Installation

/plugin install quant-trading-system

Configuration

Required Environment Variables

EXCHANGE_API_KEY=your_api_key
EXCHANGE_SECRET=your_api_secret

Optional Configuration

PAPER_TRADING=true              # Default: true (safe mode)
TRADE_INTERVAL=5                # Minutes between trades
MAX_POSITION_SIZE=1000          # Maximum position size in USD
RISK_LIMIT_PERCENT=2            # Max risk per trade (%)

Usage

Paper Trading (Safe)

# Hooks automatically enforce paper mode without PIN
/crypto-trader start

Live Trading (Requires Approval)

# Set environment
export PAPER_TRADING=false

# Start trading (will prompt for PIN via guard_approve.sh)
/crypto-trader start

Emergency Stop

# Immediately halt all trading
.claude/hooks/kill_switch.sh

Circuit Breaker

The circuit breaker automatically triggers when:

Status: Automatically flips to paper trading mode

Hooks

pre_trade.sh

Runs before every trade:

post_trade.sh

Runs after every trade:

circuit_breaker.sh

Continuously monitors:

Auto-recovery: Resumes paper trading after cooldown

Commands

/ccxt-exchange

CCXT exchange operations:

/ccxt-exchange balance           # Check account balance
/ccxt-exchange ticker BTC/USDT   # Get ticker data
/ccxt-exchange markets           # List available markets

/metrics-write

Write custom metrics:

/metrics-write trade_count 42
/metrics-write total_pnl 1250.50

Safety Checklist

Before going live:

Workflows

crypto-trader.md

5-minute trading loop:

  1. Fetch market data
  2. Run strategy signals
  3. Pre-trade validation
  4. Execute trades
  5. Post-trade logging
  6. Sleep until next interval

quant-trading-workflow.md

Complete workflow:

  1. Research phase (DSPy optimization)
  2. Backtesting
  3. Paper trading validation
  4. Gradual live deployment
  5. Continuous monitoring

Risk Management

The risk-manager agent enforces:

Troubleshooting

Trade Rejected

Check:

  1. pre_trade.sh logs in .claude/hooks/logs/
  2. Risk limits in configuration
  3. Exchange API connectivity
  4. Account balance

Circuit Breaker Triggered

  1. Check .claude/hooks/logs/circuit_breaker.json
  2. Review error messages
  3. Wait for cooldown period
  4. Restart in paper mode
  5. Investigate root cause

Kill Switch Activated

  1. All positions immediately closed
  2. All orders cancelled
  3. System halted
  4. Manual intervention required to restart

Examples

Basic Setup

# Install plugin
/plugin install quant-trading-system

# Configure
export EXCHANGE_API_KEY=xxx
export EXCHANGE_SECRET=yyy
export PAPER_TRADING=true

# Start paper trading
/crypto-trader start

Production Deployment

# After successful paper trading
export PAPER_TRADING=false
export MAX_POSITION_SIZE=500
export RISK_LIMIT_PERCENT=1

# Start with approval guard
/crypto-trader start
# (Will prompt for PIN approval)

Monitoring

Logs stored in:

.claude/hooks/logs/
โ”œโ”€โ”€ trades.jsonl          # All trades
โ”œโ”€โ”€ circuit_breaker.json  # Circuit breaker events
โ”œโ”€โ”€ pre_trade.json        # Pre-trade validations
โ””โ”€โ”€ post_trade.json      

...(truncated)

## Source

[View on GitHub](https://github.com/jmanhype/claude-code-plugin-marketplace)
Tags: general