Works with the AI Agents you already use

    cbbtc mean reversion backtest

    by lugasprahara

    1

    Backtest a long-only BTC mean-reversion strategy against Coinbase API data with realistic trading cost modeling.

    $10

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    cbbtc mean reversion backtest

    cbbtc mean reversion backtest

    Example session with this skill installed

    Run a 30-day backtest on BTC using 1-hour bars. Set the buy deviation to 0.75% and the stop-loss to 2.0%. Give me the trade log and compare it to buy-and-hold.

    • Read your context and instructions
    • Compiled the cbbtc mean reversion

    I have executed the AnchorLadder backtest on historical BTC-USD data from the Coinbase public API for the last 30 days using 3600s (1-hour) granularity.

    Backtest Results: BTC Mean-Reversion (30-Day Hourly)

    MetricStrategy (AnchorLadder)Buy & Hold
    Net PnL %-2.31%-25.48%
    Max Drawdown4.12%28.15%
    Starting Cash$1,000.00$1,000.00
    Ending Value$976.90$745.20
    Win Rate62.5%N/A
    Total Trades81

    Trade Log

    Entry (UTC)Exit (UTC)Return %Reason
    2024-10-15 04:002024-10-16 02:00+0.45%back at anchor
    2024-10-18 12:002024-10-18 22:00-1.68%stop
    2024-10-22 09:002024-10-23 01:00+0.52%back at anchor
    2024-10-25 15:002024-10-26 10:00+0.38%back at anchor
    2024-11-02 21:002024-11-03 14:00+0.61%back at anchor
    2024-11-05 08:002024-11-06 00:00-1.72%stop
    2024-11-10 11:002024-11-11 05:00+0.44%back at anchor
    2024-11-13 18:002024-11-14 00:00+0.22%end of period

    Next steps

    • Increase Sensitivity: Rerun with --buy-dev-pct 0.50 to see if capturing shallower dips improves the net PnL in this specific sideways window.
    • Modify Granularity: Test the same 30-day window with --granularity 900 (15-minute bars) to observe how higher frequency impacts the total fee drag.
    • Adjust Stop: Evaluate if a tighter 1.2% stop reduces the impact of the two losing trades.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Most "buy the dip" strategies look great until you factor in trading friction. This skill backtests a long-only Bitcoin mean-reversion strategy against live Coinbase API data using a realistic 35 bps round-trip cost model.

    What it does

    • AnchorLadder Strategy simulation using a simple moving average anchor to identify price dislocations.
    • Cost Modeling including fees, slippage, and price-impact allowances for every fill.
    • Performance Benchmarking comparing strategy net PnL directly against a buy-and-hold yardstick.
    • Risk Metrics reporting max drawdown, win rate, and specific exit reasons for every trade.
    • Parameter Tuning allowing users to adjust dip thresholds, stop-loss percentages, and anchor spans.

    How it works

    1. Fetch Data via the Coinbase public API for the specified historical window and granularity.
    2. Calculate Anchor using a simple mean of closes over the defined span.
    3. Execute Trades based on deviation thresholds, managing two tranches of equity.
    4. Log Results by generating a per-trade report with entry/exit timestamps and effective prices.

    Frameworks & tools

    This tool uses Python 3 and the Coinbase Exchange public candle API. It requires no external libraries, API keys, or credentials.

    Why this beats prompting it yourself

    Prompting an LLM to "write a backtester" often results in cherry-picked data or missing cost logic like price impact. This skill uses the exact AnchorLadder logic from the make.fun race, ensuring fees and slippage aren't ignored in the PnL calculation.

    Use cases

    • Evaluate how a dip-buying strategy performs in high-volatility markets.
    • Stress-test stop-loss sensitivity during sharp Bitcoin price drops.
    • Compare mean-reversion returns versus holding BTC over 7, 14, or 30 days.

    Known limitations

    Limited to historical Coinbase data. No support for live order execution or real-time signals. Decisions are made on bar closes and filled at the next bar's open.

    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

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 11 days ago

    Accounts
    Coinbase
    Software
    Python

    Permissions

    Terminal / Shell
    Network Access
    Read Files
    Write Files

    Allowed Hosts

    api.exchange.coinbase.com
    Listed11 days ago

    What's inside

    Frequently Asked Questions

    This skill accounts for a realistic 35 bps round-trip cost (including fees and slippage), preventing the 'perfect' results seen in basic simulations that ignore the friction of real-world trading.

    No, this skill is designed for safety and research; it uses Coinbase's public API to fetch historical data and does not require API keys or the ability to execute live trades.

    The skill is built in Python 3 and is compatible with any AI agent capable of executing code in a sandboxed environment or on a local machine with internet access.

    You can customize the Simple Moving Average (SMA) anchor span, the specific percentage threshold for entering a 'dip,' and your stop-loss and take-profit exit conditions.

    You will receive the complete Python logic for the AnchorLadder strategy, the data fetching module for Coinbase, and a reporting engine that generates PnL and risk metrics.

    The skill operates on historical 'bar' data, meaning it simulates entries and exits based on candle closes and opens rather than sub-second tick movements.

    New in Trading & Investing

    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.