npx skills add ...
npx skills add robonet-tech/skills --skill 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.
npx skills add robonet-tech/skills --skill build-trading-strategies
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:
Basic usage:
Returns complete Python strategy code ready for backtesting.
When to use this skill:
When NOT to use this skill:
design-trading-strategies first ($0.05-$1.00)improve-trading-strategies ($0.50-$3.00)browse-robonet-data first (free-$0.001)Purpose: Generate complete crypto trading strategy code with AI
Parameters:
strategy_name (required, string): Name following pattern {Name}_{RiskLevel}[_suffix]
description (required, string): Detailed requirements including:
Returns: Complete Python strategy code with:
should_long() - Check if conditions met for long entryshould_short() - Check if conditions met for short entrygo_long() - Execute long entry with position sizinggo_short() - Execute short entry with position sizingon_open_position(), update_position(), should_cancel_entry()Pricing: Real LLM cost + margin (max $4.50)
Execution Time: ~30-60 seconds
Use when:
Purpose: Generate Polymarket strategy code with YES/NO token trading logic
Parameters:
strategy_name (required, string): Name following same pattern as create_strategydescription (required, string): Detailed requirements for YES/NO token logic:
Returns: Complete Python strategy code with:
should_buy_yes() - Check if conditions met for YES token entryshould_buy_no() - Check if conditions met for NO token entrygo_yes() - Execute YES token purchase with sizinggo_no() - Execute NO token purchase with sizingshould_sell_yes(), should_sell_no(), on_market_resolution()Pricing: Real LLM cost + margin (max $4.50)
Execution Time: ~30-60 seconds
Use when:
All crypto strategies must implement these required methods:
Optional but recommended methods:
Follow this pattern: {Name}_{RiskLevel}[_suffix]
Risk Levels:
Examples:
RSIMeanReversion_M - Base strategy, medium riskMomentumBreakout_H_optimized - After optimization, high riskTrendFollower_L_allora - With Allora ML enhancement, low riskBollingerBands_M_v2 - Version 2 of strategyWhy naming matters:
Recommended position sizing: 85-95% of available margin
Common approaches:
1. Fixed percentage (simple, predictable):
2. Volatility-based (adaptive to market conditions):
3. Risk-based (size based on stop loss distance):
Best practice: Specify position sizing approach in description when creating strategy
Every strategy should include:
1. Stop Loss (mandatory):
2. Take Profit (recommended):
3. Position sizing (see above)
Red flags (avoid these):
170+ technical indicators via jesse.indicators:
Use exact names when describing strategy requirements:
Momentum (16 indicators):
Trend (12 indicators):
Volatility (8 indicators):
Volume (10 indicators):
How to find indicators:
In strategy description, use exact names: ✓ "Use RSI with period 14" ✓ "Use Bollinger Bands with period 20, std 2" ✗ "Use relative strength" (ambiguous) ✗ "Use BB" (unclear abbreviation)
This is the most expensive tool ($1-$4.50). Minimize waste:
Before using create_strategy:
browse-robonet-data (verify symbols/indicators available)design-trading-strategies ($0.05-$1.00 exploration)Avoid these costly mistakes:
Cost-saving pattern:
Anatomy of a good description:
Example of GOOD description:
Example of BAD description:
Problems:
After strategy is generated, verify code includes:
ta.rsi(self.candles, period=14))If validation fails:
improve-trading-strategies skill to fix issues ($0.50-$3.00)create_strategy ($1-$4.50)Match strategy logic to timeframe:
Scalping (1m-5m):
Intraday (15m-1h):
Swing Trading (4h-1d):
Specify timeframe in description:
Goal: Create new strategy from concept
Cost: ~$2-4 total ($0.30 ideas + $2.50 creation + $0.001 test)
Goal: Transform AI-generated concept into working code
Cost: ~$3 ($0.30 ideas + $2.50 creation + $0.001 test)
Goal: Create Polymarket YES/NO token trading strategy
Cost: ~$2.50 + $0.001 test = $2.501
Describe higher timeframe context in strategy requirements:
AI will generate code that checks higher timeframe conditions.
Specify precise logic for multiple conditions:
AI can handle complex multi-condition logic if clearly specified.
Specify adaptive sizing in description:
Issue: Strategy code doesn't run or has syntax errors
Solutions:
improve-trading-strategies skill with refine_strategy to fix errorsIssue: Generated logic differs from what you requested
Solutions:
improve-trading-strategies skill to refine specific partsIssue: Strategy uses indicators that don't exist in Jesse
Solutions:
browse-robonet-data first to verify indicatorsrefine_strategy to replace with valid indicatorsIssue: Generated code is overly complicated with 8+ indicators
Solutions:
refine_strategy to remove unnecessary complexityIssue: Generated code lacks stop loss or position sizing
Solutions:
refine_strategy to add stop loss and sizingAfter building a strategy:
Test the strategy (CRITICAL - do this next):
test-trading-strategies skill to backtestImprove the strategy (if needed):
improve-trading-strategies skill to refine codeDeploy to production (only after thorough testing):
deploy-live-trading skill (HIGH RISK)This skill provides AI-powered strategy code generation:
Core principle: This is expensive. Prepare thoroughly before using:
Critical warning: Generated code may have bugs or not match expectations. ALWAYS test with test-trading-strategies before deploying. NEVER deploy untested strategies to live trading.
Cost optimization: Spending 5 minutes preparing ($0-$0.30 exploration) saves dollars in wasted generations and improves success rate dramatically.
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() 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 orderdef go_long(self):
qty = utils.size_to_qty(self.balance * 0.90, self.price)
self.buy = qty, self.pricedef 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.pricedef 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.pricedef 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) # Shortdef 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(Use browse-robonet-data skill)
get_all_technical_indicators(category="momentum")1. browse-robonet-data ($0.001) → Verify resources
2. design-trading-strategies ($0.30) → Explore 3 ideas
3. Pick best idea and refine description
4. create_strategy ($2.50) → Generate once, correctly
Total: $2.80 with high success rate
vs.
1. create_strategy ($2.50) → Vague requirements
2. Doesn't work, try again ($2.50)
3. Still not right ($2.50)
Total: $7.50 with frustrationEntry Conditions:
- Specific indicator with exact parameters
- Exact thresholds
- Multiple conditions with AND/OR logic
Exit Conditions:
- Stop loss method and distance
- Take profit method and target
- Trailing stop if applicable
Position Sizing:
- Percentage of margin to use
- Or risk-based sizing method
Risk Management:
- Maximum loss per trade
- Any position limits
Context:
- Timeframe (5m, 1h, 4h, 1d)
- Market regime (trending, ranging)"RSI Mean Reversion strategy for BTC-USDT on 1h timeframe.
ENTRY (Long):
- RSI(14) < 30 (oversold)
- Price touches lower Bollinger Band (20-period, 2 std dev)
- Confirm with volume: current volume > 1.2× 20-period average
EXIT (Long):
- Take profit: Price reaches middle Bollinger Band
- Stop loss: 2% below entry price
- Trailing stop: Once profit >3%, trail stop at 1.5% below highest price
POSITION SIZING:
- Use 90% of available margin per trade
- Single position at a time (no pyramiding)
RISK MANAGEMENT:
- Maximum loss: 2% of account per trade
- No new trades if in drawdown >10%""Build a profitable BTC strategy using RSI and Bollinger Bands""For 1h timeframe..." (helps AI tune indicator parameters appropriately)1. Explore data (use browse-robonet-data):
get_all_symbols() → Choose BTC-USDT
get_all_technical_indicators(category="momentum") → Pick RSI
get_all_technical_indicators(category="volatility") → Pick Bollinger Bands
2. Optional: Generate ideas (use design-trading-strategies):
generate_ideas(strategy_count=3) → Get concepts
Pick best concept as starting point
3. Write detailed description:
- Entry: RSI < 30 AND price at lower BB
- Exit: Price at middle BB OR stop loss 2%
- Sizing: 90% margin
- Timeframe: 1h
4. Create strategy:
create_strategy(
strategy_name="RSIMeanReversion_M",
description="[detailed description from step 3]"
)
5. Validate generated code:
- Check all required methods present
- Verify indicators match description
- Confirm risk management included
6. Test immediately (use test-trading-strategies):
run_backtest(strategy_name="RSIMeanReversion_M", ...)1. Generate ideas (use design-trading-strategies):
generate_ideas(strategy_count=3)
Idea #2: "Bollinger Band Breakout"
Entry: Price breaks above upper BB with high volume
Exit: Price returns to middle BB
Uses: Bollinger Bands, Volume
2. Refine idea into detailed description:
"Bollinger Band Breakout strategy for ETH-USDT on 4h timeframe.
ENTRY (Long):
- Price closes above upper Bollinger Band (20, 2)
- Current volume > 1.5× 20-period average volume
- ADX(14) > 25 (confirm trend strength)
EXIT (Long):
- Price closes below middle Bollinger Band
- Or stop loss 3% below entry
- Or take profit at 9% above entry (3:1 reward:risk)
POSITION SIZING: 85% of margin
RISK: Max 3% loss per trade"
3. Create strategy:
create_strategy(
strategy_name="BollingerBreakout_H",
description="[detailed description from step 2]"
)
4. Test and validate:
run_backtest(strategy_name="BollingerBreakout_H", ...)1. Browse prediction markets (use browse-robonet-data):
get_data_availability(data_type="polymarket")
→ See available markets
2. Analyze market data:
get_prediction_market_data(condition_id="...")
→ Study YES/NO token price history
3. Write detailed description:
"Polymarket probability arbitrage strategy for crypto_rolling markets.
BUY YES TOKEN when:
- YES token price < 0.40 (implied 40% probability)
- Market has >$10k volume (sufficient liquidity)
- Time to resolution > 2 hours (avoid last-minute volatility)
BUY NO TOKEN when:
- NO token price < 0.40 (YES price > 0.60)
- Same liquidity and time criteria
EXIT:
- Sell when price reaches 0.55 (15% profit target)
- Or hold until market resolution
- Stop loss: Sell if price drops to 0.25 (37.5% loss)
POSITION SIZING: 5% of capital per market
MAX POSITIONS: 10 simultaneous markets"
4. Create prediction market strategy:
create_prediction_market_strategy(
strategy_name="PolymarketArbitrage_M",
description="[detailed description from step 3]"
)
5. Test on historical markets:
run_prediction_market_backtest(...)"ETH-USDT swing trading strategy on 1h timeframe with 4h trend filter.
HIGHER TIMEFRAME (4h):
- Only take long trades when 4h EMA(50) is rising
- Only take short trades when 4h EMA(50) is falling
ENTRY TIMEFRAME (1h):
- [standard entry conditions on 1h]
...""Entry requires ALL of these conditions (AND logic):
1. RSI(14) < 30
2. Price < Lower Bollinger Band (20, 2)
3. MACD histogram positive (bullish divergence)
4. Volume > 1.3× average
OR entry if these alternative conditions met:
1. Price makes higher low
2. RSI makes higher low (bullish divergence)
3. Volume surge (>2× average)""Position sizing based on volatility:
- When ATR(14) < 2% of price: Use 95% margin (low volatility)
- When ATR between 2-4%: Use 85% margin (normal)
- When ATR > 4%: Use 70% margin (high volatility)
This reduces risk during volatile periods."