- Home
- Skills
- Trading & Investing
- Crypto Strategy Backtester
More screenshots
Works with the AI Agents you already use
Crypto Strategy Backtester
Backtest and walk-forward test rule-based crypto strategies on Binance public candles, with fees, slippage and lookahead checks. Not financial advice.
Free
Crypto Strategy Backtester
Example session with this skill installed
Does it work to hold BTC and ETH only while the price is above its 50-day moving average, and sit in cash otherwise? Last four years.
- Read your context and instructions
- Compiled the crypto strategy backtester
Your rule maps to built-in strategy v9 with fast=1 slow=50 (fast=1 is the close itself), so there is no difference from your description. You stated one rule and did not ask for tuning, so this is a fixed-parameter backtest. No stop was asked for; default costs.
python scripts/backtest.py backtest --symbols BTC/USDT ETH/USDT --timeframe 1d --days 1460 \
--end 2026-11-01 --strategy v9 --params fast=1 slow=50
Strategy: v9, long while the close is above SMA(50), flat below
Data: BTC/USDT and ETH/USDT, daily, 2022-11-02 to 2026-10-31, 0.1% fee + 5 bps slippage per fill
Test: fixed parameters; in-sample before 2025-08-19, out-of-sample after (last 30%)
| In-sample | Out-of-sample | Buy & hold (OOS) | |
|---|---|---|---|
| Return % | +324.1 | +11.2 | -39.7 |
| Max drawdown % | 31.0 | 24.2 | 59.9 |
| Sharpe | 1.59 | 0.44 | -0.57 |
| Trades | 53 | 21 | |
| Win rate % | 34.0 | 19.1 | |
| Profit factor | 3.81 | 1.45 |
OOS return with costs x1.5: +9.4%
Warnings
- 21 out-of-sample trades is too few to trust the win rate, profit factor or Sharpe.
- Sharpe dropped from 1.59 to 0.44 out-of-sample. In-sample was a strong bull market in which buy and hold made +307%, so most of that figure is the market.
- BTC and ETH are today's survivors; the result says nothing about smaller coins.
Verdict: In the last 14 months the filter did what trend filters do: it stayed out of most of a -40% decline and cut the drawdown from 60% to 24%, ending slightly positive. In the rising market before that it roughly matched holding. That is evidence of risk reduction on two coins over one cycle, not of an edge in returns, and the out-of-sample sample is small.
Next steps
- To try other average lengths, run
walkforwardso the length is chosen on training windows only, not on the whole history. - Add more symbols to reduce the dependence on two coins.
Real run on 2026-11-10; --end is fixed so the numbers can be reproduced.
Research and education only. Not financial advice.
Connects securely to your tools. The creator never sees your data.
About this skill
Testing a crypto strategy by eye or with back-of-the-envelope math is easy to get wrong. This skill gives your agent a bar-by-bar backtesting engine that runs rule-based strategies on Binance public candles, charges fees and slippage on every fill, and reports the out-of-sample result next to buy and hold.
Research and education only. Not financial advice. No API key, no Binance account and no order code: the skill only reads public market data.
What it does
- Two test modes:
backtestruns fixed parameters with a chronological in-sample/out-of-sample split;walkforwardchooses parameters on each training window and reports only the test windows. - Costs on every fill: 0.1% fee per side and 5 bps slippage by default, plus a stress run with costs x1.5.
- Built-in strategies (v1-v10): RSI, EMA/SMA trend, Bollinger, Donchian and ATR rules. Your description is mapped to the closest one and any difference is stated.
- Custom strategy checks: a
generate_signals(df, **params)file must pass lookahead checks (changed future candles, prefix runs, synthetic and real data) before it is backtested. - Honest report: return vs buy and hold, max drawdown, Sharpe, win rate and profit factor, out-of-sample first, with automatic warnings (few trades, in-sample to out-of-sample decay, unstable parameters, PSR/deflated Sharpe, survivorship bias).
How it works
- Describe the strategy: symbols, timeframe, entry and exit rules, or pick a built-in.
- The agent uses
backtestfor a stated rule,walkforwardwhen parameters are being chosen. scripts/backtest.pydownloads closed candles fromdata-api.binance.vision(fallbackapi.binance.com), caches them and simulates trades: signals at the close, fills at the next open.- The agent reports the out-of-sample numbers next to buy and hold, with the warnings and a plain verdict.
Requirements
Python 3.10+, pandas and certifi (pip install -r requirements.txt). Candles are cached in ~/.cache/crypto-strategy-backtester/ohlcv.
Why not just ask the model?
A model asked to "backtest" in chat can invent numbers or let future data leak into signals. Here every number comes from a deterministic engine, unclosed candles are dropped, and custom code is checked for lookahead before it runs.
Use cases
- Check whether a moving-average or golden-cross filter beat holding BTC over the last cycle.
- Tune RSI or breakout thresholds with walk-forward folds instead of picking the best backtest.
- Audit your own strategy code for lookahead bias.
- See how much of a result survives higher fees and slippage.
Limitations
Long-only spot, whole equity per position. No leverage, shorting, futures, funding rates or order-book depth. Symbols chosen today carry survivorship bias. Past results do not predict future returns.
License
PolyForm Noncommercial 1.0.0: free for personal, research and other noncommercial use. Full terms in the LICENSE file.
Long-only spot, whole equity per position. No shorting, leverage, futures or funding rates. Binance spot pairs only. No order execution and no API key support. Symbols chosen today carry survivorship bias. Requires Python 3.10+.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 3 days ago
- Free with an Agensi account
Requires
Permissions
File Scopes
Network: downloads public candles from data-api.binance.vision (fallback api.binance.com). Write files: caches candles in ~/.cache/crypto-strategy-backtester. Terminal: runs scripts/backtest.py. No environment variables, credentials or order endpoints are used.