improve-trading-strategies
Iterative refinement, parameter optimization, and ML enhancement of existing trading strategies. Provides 3 tools: refine_strategy (targeted code changes, $0.50-$3.00), optimize_strategy (parameter tuning, $2-$4), enhance_with_allora (ML integration, $1-$2.50). More cost-effective than regenerating from scratch. Use when you have working strategies that need improvement. Always test improvements with test-trading-strategies before deploying.
What this skill does
# Improve Trading Strategies
## Quick Start
This skill provides tools to improve existing strategies through refinement, optimization, and ML enhancement.
**Load the tools first**:
```
Use MCPSearch to select: mcp__workbench__refine_strategy
Use MCPSearch to select: mcp__workbench__optimize_strategy
Use MCPSearch to select: mcp__workbench__enhance_with_allora
```
**Quick improvement pattern**:
```
1. Get existing code:
(use browse-robonet-data) get_strategy_code(strategy_name="MyStrategy")
2. Make targeted changes:
refine_strategy(
strategy_name="MyStrategy",
changes_description="Add trailing stop at 1% below peak profit",
mode="new"
)
3. Test improvement:
(use test-trading-strategies) run_backtest(strategy_name="MyStrategy_refined")
```
**When to use this skill**:
- Have existing strategy that needs improvement
- Want to add features without rewriting from scratch
- Need to tune parameters for better performance
- Want to integrate ML predictions (Allora Network)
- Cheaper than regenerating with `build-trading-strategies`
## Available Tools (3)
### refine_strategy
**Purpose**: Make targeted code changes with AI editing
**Parameters**:
- `strategy_name` (required): Strategy to refine (any version)
- `changes_description` (required): Specific changes you want
- `mode` (required): "new" (create new version, safe) or "replace" (overwrite existing)
**Returns**: Refined strategy code with automatic validation and safety checks
**Pricing**: Real LLM cost + margin (max $3.00)
- Typical: $0.50-$1.50 depending on change complexity
**Execution Time**: ~20-30 seconds
**Use when**:
- Making specific code changes (add indicator, change threshold, fix bug)
- Adding features (trailing stop, new exit condition)
- Cheaper than regenerating with create_strategy ($0.50-$3.00 vs $1-$4.50)
**Best practice**: Always use `mode="new"` to preserve original (can compare before/after)
### optimize_strategy
**Purpose**: Tune numeric parameters using backtesting data and AI
**Parameters**:
- `strategy_name` (required): Strategy to optimize
- `start_date` (required): Start date (YYYY-MM-DD)
- `end_date` (required): End date (YYYY-MM-DD)
- `symbol` (required): Trading pair (e.g., "BTC-USDT")
- `timeframe` (required): Timeframe (1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d)
**Returns**: Optimized strategy version with improved parameters + performance comparison (before vs after)
**Pricing**: Real LLM cost + margin (max $4.00)
- Typical: $2.00-$3.50 (most expensive improvement tool)
**Execution Time**: ~30-60 seconds
**Use when**:
- Strategy logic is good but parameters need tuning
- Want AI to search parameter space
- Have sufficient backtest data (6+ months recommended)
**Warning**: Can lead to overfitting. Use walk-forward validation.
### enhance_with_allora
**Purpose**: Add Allora Network ML price predictions to strategy logic
**Parameters**:
- `strategy_name` (required): Strategy to enhance
- `symbol` (required): Trading pair
- `timeframe` (required): Timeframe
- `start_date` (required): Start date for comparison backtest
- `end_date` (required): End date for comparison backtest
**Returns**: Enhanced strategy version with ML signals integrated + before/after performance comparison
**Pricing**: Real LLM cost + margin (max $2.50)
- Typical: $1.00-$2.00
**Execution Time**: ~30-60 seconds
**Use when**:
- Strategy is profitable but could use ML signals
- Trading BTC, ETH, SOL, or NEAR (Allora coverage)
- Want to combine technical analysis with ML predictions
**Note**: Requires Allora topics available for your symbol/timeframe (check with browse-robonet-data)
## Core Concepts
### Iterative Improvement Pattern
**Recommended improvement sequence**:
```
1. START: Working strategy (tested, decent performance)
Sharpe: 0.8, Drawdown: 15%, Win rate: 48%
2. REFINE: Fix obvious issues ($0.50-$1.50)
- Add missing stop loss
- Fix indicator parameter typo
- Add position sizing limit
→ New Sharpe: 1.1, Drawdown: 12%
3. TEST: Validate improvement
- Compare metrics before/after
- Ensure improvement is real, not noise
4. OPTIMIZE: Tune parameters ($2-$4)
- Search parameter space for RSI threshold
- Find optimal Bollinger Band period
→ New Sharpe: 1.4, Drawdown: 10%
5. TEST: Validate optimization
- Test on out-of-sample data
- Check for overfitting
6. ENHANCE: Add ML predictions ($1-$2)
- Integrate Allora Network signals
- Use ML as confirmation filter
→ New Sharpe: 1.7, Drawdown: 9%
7. TEST: Final validation
- Compare all metrics end-to-end
- Decide if ready for deployment
TOTAL COST: ~$4-7 (much cheaper than regenerating 3-4 times at $2.50 each = $7.50-$10)
```
### Optimization Best Practices
**Avoiding overfitting**:
**What is overfitting?**
- Parameters tuned to past data perform poorly on new data
- Strategy "memorizes" historical noise instead of learning patterns
- Common with excessive optimization
**How to avoid**:
**1. Use sufficient data** (6+ months minimum):
```
optimize_strategy(
strategy_name="MyStrategy",
start_date="2024-01-01",
end_date="2024-12-31", # 12 months
symbol="BTC-USDT",
timeframe="1h"
)
```
**2. Walk-forward validation**:
```
# Train on first 8 months
optimize_strategy(..., start_date="2024-01-01", end_date="2024-08-31")
# Test on last 4 months (use test-trading-strategies)
run_backtest(..., start_date="2024-09-01", end_date="2024-12-31")
# Performance should be similar on test period
# If much worse → overfitted
```
**3. Limit optimization iterations**:
- 1st optimization: Often yields 20-30% improvement
- 2nd optimization: Yields 10-15% improvement
- 3rd optimization: Yields <5% improvement (diminishing returns)
- 4th+ optimization: Often makes performance worse (overfitting)
**Stop after 2-3 optimization rounds**
**4. Compare multiple metrics** (not just one):
```
Before optimization: Sharpe 1.0, Drawdown 15%, Win rate 52%
After optimization: Sharpe 1.3, Drawdown 14%, Win rate 54%
✓ Multiple metrics improved consistently → Good
✗ Sharpe jumped to 3.0 but drawdown 40% → Overfitted/risky
```
**5. Keep parameter ranges reasonable**:
- RSI: 10-20 (not 2-100)
- Moving average: 20-200 (not 1-1000)
- Stop loss: 1-5% (not 0.1-50%)
### Allora Network ML Integration
**What Allora provides**:
- ML-powered price predictions
- Multiple horizons: 5m, 8h, 24h, 1 week
- Assets: BTC, ETH, SOL, NEAR
- Networks: Mainnet (production) + Testnet (experimental)
**How to use ML predictions**:
**Pattern 1: ML as confirmation filter**
```
Original strategy: Buy when RSI < 30
Enhanced strategy: Buy when RSI < 30 AND Allora predicts price increase
→ Reduces false signals, improves win rate
```
**Pattern 2: ML as primary signal**
```
Original strategy: Trend following with EMA
Enhanced strategy: Buy when Allora predicts strong upward movement + EMA confirms
→ ML catches moves early, EMA confirms trend
```
**Pattern 3: ML for position sizing**
```
Original strategy: Fixed 90% margin position size
Enhanced strategy:
- 95% margin when Allora confidence high
- 85% margin when Allora confidence medium
- 70% margin when Allora confidence low
→ Adaptive sizing based on prediction confidence
```
**Before using enhance_with_allora**:
```
1. Check Allora topic availability (use browse-robonet-data):
get_allora_topics()
→ Verify your symbol has predictions
2. Match prediction horizon to strategy timeframe:
- 5m scalping strategy → Use 5m predictions
- 1h swing strategy → Use 8h predictions
- 4h daily strategy → Use 24h predictions
3. Test before/after:
- enhance_with_allora automatically runs comparison backtest
- Check improvement metrics
- ML should improve Sharpe by 10-30% (not 200%—that's unrealistic)
```
**Realistic ML improvement expectations**:
- **10-30% Sharpe improvement**: Good, realistic
- **30-50% improvement**: Excellent (verify it's real, not overfitting)
- **>50% improvement**: Suspicious, liRelated in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.