# cbbtc sma360 swing bot

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

cbbtc sma360 swing bot is a paid AI agent skill on Agensi by nurdiyanto, in Trading & Investing. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $9 (one-time purchase)
- Creator: [nurdiyanto](https://www.agensi.io/creators/nurdiyanto)
- Category: [Trading & Investing](https://www.agensi.io/skills/trading-investing)
- Version: 1.0
- Last updated: 2026-11-19
- Security: scan passed (2026-11-19); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/cbbtc-sma360-swing-bot
- Tags: trading, python, algorithmic-trading, bitcoin, crypto

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

## Requires

- Python

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the cbbtc sma360 swing bot skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does the cbBTC SMA360 Swing Bot decide when to enter and exit trades?

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.

### What AI frameworks or platforms is this skill compatible with?

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.

### What exactly is included in the download after purchase?

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.

### Does this bot connect directly to my exchange account or Coinbase wallet?

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.

### What happens if I start the bot without any historical price data?

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.

### How does the bot handle sudden market crashes or high volatility?

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.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
