build-trading-strategies
AI-powered generation of complete trading strategy code. Uses create_strategy and create_prediction_market_strategy to transform requirements into production-ready Python code. Most expensive AI tool ($1.00-$4.50 per generation). Generates complete Jesse framework strategies with entry/exit logic, position sizing, and risk management. Use after exploring data and optionally generating ideas. ALWAYS test with test-trading-strategies before deploying.
What this skill does
# Build Trading Strategies
## Quick Start
This skill generates complete, production-ready strategy code using AI. This is the **most expensive tool** in Robonet ($1-$4.50 per generation).
**Load the tools first**:
```
Use MCPSearch to select: mcp__workbench__create_strategy
Use MCPSearch to select: mcp__workbench__create_prediction_market_strategy
```
**Basic usage**:
```
create_strategy(
strategy_name="RSIMeanReversion_M",
description="Buy when RSI(14) < 30 and price at lower Bollinger Band (20,2).
Sell when RSI > 70 or price at middle Bollinger Band.
Stop loss at 2% below entry. Position size 90% of available margin."
)
```
Returns complete Python strategy code ready for backtesting.
**When to use this skill**:
- You have a clear strategy concept and want working code
- You've explored data and know what indicators/symbols to use
- You're ready to commit to expensive development ($1-$4.50)
**When NOT to use this skill**:
- You're still exploring ideas → Use `design-trading-strategies` first ($0.05-$1.00)
- You have existing code to improve → Use `improve-trading-strategies` ($0.50-$3.00)
- You haven't checked data availability → Use `browse-robonet-data` first (free-$0.001)
## Available Tools (2)
### create_strategy
**Purpose**: Generate complete crypto trading strategy code with AI
**Parameters**:
- `strategy_name` (required, string): Name following pattern `{Name}_{RiskLevel}[_suffix]`
- Risk levels: H (high), M (medium), L (low)
- Examples: "RSIMeanReversion_M", "MomentumBreakout_H_v2"
- `description` (required, string): Detailed requirements including:
- Entry conditions (specific indicator values and thresholds)
- Exit conditions (stop loss, take profit, trailing stops)
- Position sizing (percentage of margin to use)
- Risk management (max loss per trade)
- Indicators to use (exact names from browse-robonet-data)
- Timeframe context (5m scalping vs 1h swing trading)
**Returns**: Complete Python strategy code with:
- `should_long()` - Check if conditions met for long entry
- `should_short()` - Check if conditions met for short entry
- `go_long()` - Execute long entry with position sizing
- `go_short()` - Execute short entry with position sizing
- Optional methods: `on_open_position()`, `update_position()`, `should_cancel_entry()`
**Pricing**: Real LLM cost + margin (max $4.50)
- Typical cost: $1.00-$3.00 depending on complexity
- Most expensive tool in Robonet
**Execution Time**: ~30-60 seconds
**Use when**:
- Building new crypto perpetual trading strategy
- You have clear, detailed requirements
- You've verified indicators/symbols available (browse-robonet-data)
- Ready to commit to expensive operation
### create_prediction_market_strategy
**Purpose**: Generate Polymarket strategy code with YES/NO token trading logic
**Parameters**:
- `strategy_name` (required, string): Name following same pattern as create_strategy
- `description` (required, string): Detailed requirements for YES/NO token logic:
- Conditions for buying YES tokens (probability thresholds)
- Conditions for buying NO tokens
- Exit criteria (profit targets, time-based exits)
- Position sizing (percentage per market)
- Market selection criteria (categories, liquidity requirements)
**Returns**: Complete Python strategy code with:
- `should_buy_yes()` - Check if conditions met for YES token entry
- `should_buy_no()` - Check if conditions met for NO token entry
- `go_yes()` - Execute YES token purchase with sizing
- `go_no()` - Execute NO token purchase with sizing
- Optional methods: `should_sell_yes()`, `should_sell_no()`, `on_market_resolution()`
**Pricing**: Real LLM cost + margin (max $4.50)
- Typical cost: $1.00-$3.00
**Execution Time**: ~30-60 seconds
**Use when**:
- Building Polymarket prediction market strategies
- Trading on real-world events (politics, economics, sports)
- Want YES/NO token exposure based on probability analysis
## Core Concepts
### Jesse Framework Structure
**All crypto strategies must implement these required methods**:
```python
class MyStrategy(Strategy):
def should_long(self) -> bool:
"""Check if all conditions are met for long entry"""
# Return True to signal long entry opportunity
# Called every candle
def should_short(self) -> bool:
"""Check if all conditions are met for short entry"""
# Return True to signal short entry opportunity
# Called every candle
def go_long(self):
"""Execute long entry with position sizing"""
# Calculate position size (qty)
# Place buy order
# Set stop loss and take profit in on_open_position()
def go_short(self):
"""Execute short entry with position sizing"""
# Calculate position size (qty)
# Place sell order
# Set stop loss and take profit in on_open_position()
```
**Optional but recommended methods**:
```python
def on_open_position(self, order):
"""Set stop loss and take profit after entry"""
# Called when position opens
# Set self.stop_loss and self.take_profit
def update_position(self):
"""Update position (trailing stops, etc.)"""
# Called every candle while in position
# Modify stop loss for trailing stops
def should_cancel_entry(self) -> bool:
"""Cancel unfilled entry orders"""
# Return True to cancel pending entry order
```
### Strategy Naming Convention
**Follow this pattern**: `{Name}_{RiskLevel}[_suffix]`
**Risk Levels**:
- **H** (High): Aggressive strategies, high leverage, tight stops, >20% drawdown acceptable
- **M** (Medium): Balanced strategies, moderate leverage, standard stops, 10-20% drawdown
- **L** (Low): Conservative strategies, low leverage, wide stops, <10% drawdown
**Examples**:
- `RSIMeanReversion_M` - Base strategy, medium risk
- `MomentumBreakout_H_optimized` - After optimization, high risk
- `TrendFollower_L_allora` - With Allora ML enhancement, low risk
- `BollingerBands_M_v2` - Version 2 of strategy
**Why naming matters**:
- Helps organize strategies by risk profile
- Clear versioning (_v2, _v3) tracks evolution
- Suffixes (_optimized, _allora) indicate enhancements
- Consistent naming enables easy filtering and comparison
### Position Sizing Patterns
**Recommended position sizing**: 85-95% of available margin
**Common approaches**:
**1. Fixed percentage** (simple, predictable):
```python
def go_long(self):
qty = utils.size_to_qty(self.balance * 0.90, self.price)
self.buy = qty, self.price
```
**2. Volatility-based** (adaptive to market conditions):
```python
def go_long(self):
atr = ta.atr(self.candles, period=14)
# Reduce size in high volatility
size_multiplier = 0.90 if atr < self.price * 0.02 else 0.70
qty = utils.size_to_qty(self.balance * size_multiplier, self.price)
self.buy = qty, self.price
```
**3. Risk-based** (size based on stop loss distance):
```python
def go_long(self):
atr = ta.atr(self.candles, period=14)
stop_distance = atr * 2 # Stop at 2× ATR
# Risk 2% of balance per trade
risk_amount = self.balance * 0.02
qty = risk_amount / stop_distance
self.buy = qty, self.price
```
**Best practice**: Specify position sizing approach in description when creating strategy
### Risk Management Requirements
**Every strategy should include**:
**1. Stop Loss** (mandatory):
```python
def on_open_position(self, order):
atr = ta.atr(self.candles, period=14)
# Stop at 2× ATR below entry (long) or above entry (short)
self.stop_loss = qty, self.price - (atr * 2) # Long
# or
self.stop_loss = qty, self.price + (atr * 2) # Short
```
**2. Take Profit** (recommended):
```python
def on_open_position(self, order):
atr = ta.atr(self.candles, period=14)
# Target at 3× ATR (risk/reward = 1.5)
self.take_profit = qty, self.price + (atr * 3) # Long
```
**3. Position sizing** (see above)
**Red flags** (avRelated 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.