From trading-experiment
This skill should be used when the user asks to "run a trading experiment", "find a trading strategy", "backtest strategies", "research crypto strategies", "optimize a trading strategy", "find alpha", or wants autonomous strategy research and backtesting. Designs, backtests, and iterates on trading strategies using MCP backtesting tools until a target performance threshold is met on out-of-sample data.
How this skill is triggered — by the user, by Claude, or both
Slash command
/trading-experiment:experimentThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are orchestrating an autonomous crypto strategy research session. Understand what the user wants in their own words, confirm the plan, then dispatch the experiment-runner agent.
You are orchestrating an autonomous crypto strategy research session. Understand what the user wants in their own words, confirm the plan, then dispatch the experiment-runner agent.
The user describes what they want in natural language. Your job is to extract the experiment parameters from their description conversationally. DO NOT require flags or structured arguments.
What to extract (ask for anything missing):
BTC/USDT:USDT on binance.Example user inputs and how to parse them:
User: "4h timeframe over the last 6 months, the btcusdt perp contract on binance. Focus on levels for limit orders with good risk management for steady growth. Dynamic position sizing based on risk % if stopped out."
User: "Find me something that works on ETH daily, I don't care what"
If the user's description is clear enough to proceed, confirm the parameters and move on. If key details are missing (especially the trading idea and instrument), ask ONE focused question to fill the gap. Don't interrogate — infer reasonable defaults from context.
Before dispatching the agent:
get_market_info with the parsed symbol to understand trading constraints: fees (maker/taker), contract type (spot/perpetual), leverage limits, collateral currency, funding rate impact, minimum order sizes. This informs realistic backtest parameters.fetch_ohlcv with the parsed symbol, timeframe, since, and until to confirm data availability. Report the number of candles fetched.list_helpers to show the agent what utilities are already available (so it doesn't reinvent them).Encode these principles in the agent dispatch. The experiment-runner must understand:
Think like a researcher, not an indicator configurator. The goal is to discover exploitable market behaviors, not to tune RSI thresholds.
The agent follows this loop each iteration:
Step 1 — Plan: Decide what to test and why. State a falsifiable hypothesis. Reference what you learned from previous iterations. If pivoting, summarize what the previous direction taught you about the market.
Step 2 — Code: Write a backtesting.py Strategy subclass following these rules:
Strategy (available in namespace, no import needed)self.I(fn, ...) inside init()sma_period = 20)self.data.Close, self.data.High, self.data.Low, self.data.Open, self.data.Volumepd.Series(self.data.Close)Strategy, pd (pandas), np (numpy), ta (pandas_ta), math, helpers (reusable functions — ATR, stops, sizing, regime filters, z-scores, etc.)self.buy() / self.sell() / self.buy(limit=price) / self.buy(stop=price). Exit: self.position.close()self.buy(size=0.5) for 50% equity, or use helpers.position_size_pct(equity, stop_dist, risk_pct) for risk-based sizingself.buy(sl=stop_price, tp=target_price) for stop-loss/take-profit at absolute price levelshelpers.atr(), helpers.atr_stop(), helpers.atr_target() for ATR-based risk management instead of reimplementinghelpers.position_size_pct() (fixed risk), helpers.kelly_size() (Kelly criterion), helpers.volatility_scaled_size() (vol-targeting), helpers.max_drawdown_size() (DD-aware scaling)add_helper so it persists across all future strategieslist_helpers to see what's available before writing custom utility codereferences/code-guide.md for full helpers API, order types, and examplesMarket-aware design:
get_market_info results to understand real trading constraintsnext() must only use data available at the current barinit() explaining what each indicator capturesStep 3 — Backtest: Call run_backtest with validate_oos=true. This splits data into in-sample (70%) and out-of-sample (30%) and reports both.
Step 4 — Analyze: Interpret results honestly.
Step 5 — Save: Call save_strategy with the strategy name, code, hypothesis, metrics, and experiment type. Do NOT paste full strategy code into the conversation — save it and reference by name.
Step 6 — Decide: Based on analysis, choose next action:
The experiment ends when ANY of these is true:
Enforce these automatically:
Keep the conversation efficient:
save_strategy. Reference strategies by name, not by pasting code.get_experiment_summary every 5-10 iterations to reorient. It returns the full history of what has been tried.After confirming data availability and parameters, dispatch the experiment-runner agent using the Agent tool. Pass the full context from the conversation — the user's original description, all extracted parameters, market info, and available helpers:
Trading idea: {user's description in their own words}
Instrument: {symbol} ({contract_type}) on {exchange}
Timeframe: {timeframe} | Date range: {since} to {until}
Entry style: {market orders / limit orders / stop orders / as user described}
Risk management: {user's preferences — sizing method, stop style, max DD tolerance}
Target: OOS Sharpe >= {target_sharpe}, Max DD >= {target_max_dd}%
Max iterations: {max_iterations}
Commission: {actual taker fee from get_market_info} + {slippage}
Market info: {key details — fees, contract type, leverage, collateral, funding rate notes}
Available helpers: {summary from list_helpers}
Run the experiment loop. Design your first experiment based on the trading idea.
Iterate until targets are met on OOS data or max iterations reached.
When the agent completes (or you receive its final output), present to the user:
get_strategy and displaynpx claudepluginhub lecheeseroyale/onspotify-plugins --plugin trading-experimentBacktests crypto/stock trading strategies on historical data. Computes Sharpe/Sortino ratios, drawdowns; plots equity curves; optimizes parameters via grid search.
Generates trading plans covering risk management, position sizing, entry/exit rules, trade management, psychology, and performance tracking for day, swing, position, options trading, and investing.
Builds financial models, backtests trading strategies, and analyzes market data with risk metrics, portfolio optimization, and statistical arbitrage.