cbbtc sma360 swing bot

    by nurdiyanto

    1

    A deterministic SMA360 mean-reversion swing bot for cbBTC using the agent-fun/bars-replay/v1 protocol.

    $9

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    cbbtc sma360 swing bot

    Example session with this skill installed

    I have a dataset of cbBTC/USDC 1-minute bars in NDJSON format. I need to generate order intents for a mean-reversion swing strategy using a 360 SMA. Use the standard 90 bps band.

    • Read your context and instructions
    • Compiled the cbbtc sma360 swing

    The strategy has been initialized. I processed the provided bar data according to the SMA360 parameters. Since the 60-bar history threshold was met, the following order intents were generated based on the 0.9% deviation from the mean.

    Strategy Execution Log

    TimestampEventPriceSMA360Action
    2024-05-20T10:00:00ZHistory64200.5064500.00Warm-up (60/60)
    2024-05-20T10:42:00ZSignal63850.0064450.00BUY (Price < SMA - 0.9%)
    2024-05-20T12:15:00ZSignal65100.0064510.00SELL (Price > SMA + 0.9%)

    Generated Order Intents

    {"type": "reply", "batch_id": 1042, "orders": [{"side": "buy", "symbol": "cbBTC/USDC", "type": "market", "amount": "ALL", "max_slippage_bps": 100}]}
    {"type": "reply", "batch_id": 1135, "orders": [{"side": "sell", "symbol": "cbBTC/USDC", "type": "market", "amount": "ALL", "max_slippage_bps": 100}]}
    

    Next steps

    1. Pipe these intents into your exchange execution bridge.
    2. Monitor stdout for stop-loss triggers if price hits 1.5% below entry.
    3. Adjust BAND_BPS in main.py if market volatility increases.

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

    About this skill

    High-volatility markets often punish complex strategies that overfit. This skill provides a deterministic mean-reversion bot for cbBTC/USDC based on a 360-bar simple moving average (SMA). It targets specific price deviations to capture swings while enforcing a hard stop-loss.

    What it does

    • Mean-reversion signals identifies buy opportunities when price drops 0.9% below the 360-minute average.
    • Automated exits triggers a full position sell when price rises 0.9% above the mean.
    • Risk management executes a hard 1.5% stop-loss based on the entry-decision bar.
    • Cold-start protection waits for a minimum of 60 bars of history before calculating averages or issuing orders.
    • Deterministic execution ensures identical output for identical input by using pure standard library logic without randomness.

    How it works

    1. Initialize the bot by piping a stream of newline-delimited JSON bars into the script.
    2. Accumulate 1-minute bar data until the MIN_HISTORY threshold is met.
    3. Monitor the agent-fun/bars-replay/v1 protocol messages for entry and exit triggers.
    4. Emit order intents to stdout for external execution layers to process.

    Frameworks & tools

    Built with Python 3 using only the standard library. It implements the agent-fun/bars-replay/v1 wire protocol for compatibility with bar-replay environments.

    Why this beats prompting it yourself

    Writing reliable trade logic in a prompt often leads to calculation errors or inconsistent state management. This skill provides a tested, 141-line implementation that handles state transitions and protocol compliance out of the box.

    Use cases

    • Backtesting run historical cbBTC data through the bot to validate mean-reversion assumptions.
    • Paper trading connect the stdout to a mock execution layer for strategy dry-runs.
    • Live execution integrate with a custom broker bridge that consumes the bot's JSON order intents.

    Known limitations

    Does not fetch live market data or execute trades directly. Requires an external data feed and execution layer compliant with the specific JSON wire protocol.

    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 16 days ago

    Software
    Python

    Permissions

    Terminal / Shell
    Listed16 days ago

    What's inside

    Frequently Asked Questions

    This skill automates mean-reversion trading for cbBTC by buying when the price deviates 0.9% below its 360-minute average and selling when it rises 0.9% above. It solves the issue of strategy 'overfitting' by using a deterministic, math-based approach rather than probabilistic AI guessing.

    The skill is built on the agent-fun/bars-replay/v1 protocol, making it compatible with any AI agent or environment that supports newline-delimited JSON bar streams. It acts as a logic engine that consumes data and emits order intents for your execution layer to process.

    You will receive the complete Python source code for the trading logic, which is designed to be lightweight and dependency-free. It includes the state management system, SMA calculation engine, and the protocol-compliant messaging interface.

    No, the bot is designed to be 'stateless' regarding external APIs to ensure security. It requires an external data feed (to pipe in JSON bars) and an execution bridge (to turn its JSON outputs into actual trades) to function in a live environment.

    The bot includes a 'Cold-start protection' feature that requires a minimum of 60 bars of history before it begins issuing signals. This ensures the strategy doesn't execute on incomplete or volatile initial data.

    Risk is managed through a hard 1.5% stop-loss calculated from the entry-decision bar. Because the logic is deterministic, the bot will always execute this exit signal at the exact moment the threshold is hit, removing emotional bias from the trade.

    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.