- Home
- Skills
- Trading & Investing
- cbbtc sma360 swing bot
cbbtc sma360 swing bot
by nurdiyanto
A deterministic SMA360 mean-reversion swing bot for cbBTC using the agent-fun/bars-replay/v1 protocol.
$9
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
| Timestamp | Event | Price | SMA360 | Action |
|---|---|---|---|---|
| 2024-05-20T10:00:00Z | History | 64200.50 | 64500.00 | Warm-up (60/60) |
| 2024-05-20T10:42:00Z | Signal | 63850.00 | 64450.00 | BUY (Price < SMA - 0.9%) |
| 2024-05-20T12:15:00Z | Signal | 65100.00 | 64510.00 | SELL (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
- Pipe these intents into your exchange execution bridge.
- Monitor
stdoutfor stop-loss triggers if price hits 1.5% below entry. - Adjust
BAND_BPSinmain.pyif 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
- Initialize the bot by piping a stream of newline-delimited JSON bars into the script.
- Accumulate 1-minute bar data until the
MIN_HISTORYthreshold is met. - Monitor the
agent-fun/bars-replay/v1protocol messages for entry and exit triggers. - 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
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 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
What's inside
Frequently Asked Questions
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.