A case study building a trading bot with BALIA OS that uses a crypto exchange API to detect price-action patterns and automatically enter and exit positions. It's built with the rigor required of any system that handles investment decisions — preventing data leakage, validating backtests in proper time-series order, and more.
Whether you're working with a widely known technical-analysis pattern like a head-and-shoulders or inverse head-and-shoulders, or a trading method you've developed yourself through experience, you can show the agent chart images and tell it "when the chart looks like this, judge it this way" — building a system that handles chart monitoring, entry decisions, and automatic order placement end to end.
| Tool | Role | Think of it as |
|---|---|---|
| Chat Claude (claude.ai) | Decides "what to build" through conversation. Handles the design/spec side | A planning session with your architect |
| Claude Code in VS Code | Takes the finalized design and actually creates the files and writes the code | The contractor on site |
Most off-the-shelf auto-trading software builds its logic once from historical data and then keeps using it unchanged forever. The build approach in this guide differs from that in two major ways.
| Typical Auto-Trading Software | This Guide's Build Approach | |
|---|---|---|
| Symbol Selection | Keeps using the logic/symbols decided at the start, unchanged | Re-runs a backtest on that day's market data every day and re-selects favorable symbols |
| Improving Accuracy | Just keeps using the logic exactly as originally built | Reviews daily trade results — especially trades that hit stop-loss — and keeps teaching the agent what it learns, continuously improving accuracy over time |
Symbol selection is automatically re-tested every morning, and the watchlist keeps updating. The pre-order pattern check is also designed around a continuous improvement cycle — reviewing stop-loss trades and adding newly worded patterns one at a time. It's a system built to never just be "finished" with a fixed piece of logic.
| Phase | Content | Tool Used | Deliverable |
|---|---|---|---|
| Phase 0 | Environment setup and data foundation (choosing an exchange, obtaining API keys, collecting historical data, designing the data storage approach) | Both | Requirements sheet + full environment setup |
| Phase 1 | Signal and feature design (designing technical indicators and pattern detection, preventing data leakage) | Chat Claude | Signal design document |
| Phase 2 | Building the strategy backtest engine (time-series train/valid/test split, building the cassette) | Both | Strategy backtest engine + SKILL.md/WORKFLOW.md/SPEC & soul.md |
| Phase 3 | Parameter tuning (tune using only the valid period; the test period is for final confirmation only) | Both | Tuned parameters + final evaluation results |
| Phase 4 | Rollout to live trading (demo/paper trading first → then a small live position, a design that can support multiple exchanges, ongoing monitoring) | Both | A running trading bot + monitoring setup |
You build up validation on historical data step by step before ever going live — the kind of careful process any serious financial system requires. Since the assumptions vary a lot by target symbol and exchange, there's no ready-made TASK.md that skips the interview. Always start with the Phase 0 requirements interview.
Just paste this prompt as-is into a new conversation with "Chat Claude" (claude.ai) to kick off the Phase 0 requirements interview.
The rest is available in the full guide after purchasing T1.
(Full text including the default symbol-selection logic, entry/exit logic, details on preventing data leakage, and instruction-sheet templates for Phase 1 onward)
⚠️ This guide and this cassette are not intended as investment advice or a solicitation to invest.
BALIA OS is a tool that helps you build automated systems, including trading bots. It does not guarantee any specific investment outcome. Backtest results based on historical data do not guarantee future market conditions or future trading performance.
Crypto trading involves large price swings, and losses can exceed your invested principal. Always trade based on your own judgment and at your own risk.
The design philosophy and methods introduced in this guide (pattern detection, risk management thinking, etc.) are provided for informational purposes only and do not guarantee any specific hit rate, win rate, or profit. Regulations and tax treatment for crypto trading vary by country and region. Follow the laws of your own jurisdiction regarding exchange availability and tax treatment, and consult a professional as needed.
The default symbol-selection logic, entry/exit logic, thinking behind preventing data leakage, instruction-sheet templates for Phase 1 onward, and more — the full write-up is all laid out on the BALIA OS guide site.
See the Full Build Guide →Other case studies built the same way — reservation management systems, community/fan site auto-updates, boat race prediction, and more — are live or in progress.
See All Case Studies →