More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Crypto Strategy Backtester

    0

    Backtest and walk-forward test rule-based crypto strategies on Binance public candles, with fees, slippage and lookahead checks. Not financial advice.

    Free

    Security scanned
    Crypto Strategy Backtester

    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-sampleOut-of-sampleBuy & hold (OOS)
    Return %+324.1+11.2-39.7
    Max drawdown %31.024.259.9
    Sharpe1.590.44-0.57
    Trades5321
    Win rate %34.019.1
    Profit factor3.811.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

    1. To try other average lengths, run walkforward so the length is chosen on training windows only, not on the whole history.
    2. 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: backtest runs fixed parameters with a chronological in-sample/out-of-sample split; walkforward chooses 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

    1. Describe the strategy: symbols, timeframe, entry and exit rules, or pick a built-in.
    2. The agent uses backtest for a stated rule, walkforward when parameters are being chosen.
    3. scripts/backtest.py downloads closed candles from data-api.binance.vision (fallback api.binance.com), caches them and simulates trades: signals at the close, fills at the next open.
    4. 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.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Trading & Investing.

    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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    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 to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 3 days ago

    • Free with an Agensi account

    Software
    Python 3.10+

    No Binance account or API key needed: the skill reads public market data only and cannot place orders.

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access

    File Scopes

    ~/.cache/crypto-strategy-backtester/**

    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.

    Listed3 days ago

    What's inside

    Frequently Asked Questions

    The backtest engine, 10 built-in strategies (v1-v10), a lookahead checker for your own strategy files, reference notes on metrics and common pitfalls, four worked examples and a strategy template. It is free under the PolyForm Noncommercial license.

    Signals are computed at a candle's close and filled at the next candle's open, and unclosed candles are dropped. A custom strategy file must also pass lookahead checks (changing future candles must not change earlier signals, on synthetic and real data) before it is backtested.

    It is designed for any Python-capable AI agent or environment running Python 3.10+. It connects directly to Binance’s public data API, so you do not need your own API keys to fetch historical candle data.

    The current version supports long-only spot trading with fixed fee and slippage modeling. It does not currently support shorting, margin/leverage, or complex order book dynamics like market impact.

    Both. backtest runs fixed parameters. walkforward picks parameters on each training window from a small grid and reports only the following test windows, so the reported numbers are out-of-sample. Use it whenever parameters are being chosen.

    Yes. Every fill pays a 0.1% fee and 5 bps slippage by default; --fee and --slippage-bps change them, and every report includes a stress run with costs x1.5 (--cost-stress).

    New in Trading & Investing

    Free