Technical Docs
Reference documentation for the mi-casa codebase.
| Note | Description |
|---|---|
| Architecture Overview | Full stack table, request flow, directory structure, path aliases, DI pattern |
| Authentication Flow | Login, invite signup, token refresh, change password — sequence diagrams + security properties |
| Frontend State Management | Redux store shape, RTK Query slice pattern, re-auth interceptor, localStorage persistence |
| Database Schema | All tables, column types, relationships, migration workflow, repository layer |
| Environment Variables | Every env var, type, default, and which service uses it |
| Environment Variables Reference — Deployment | Overview table showing which vars go to which deployment (mi-casa / ohlc-service / ctrader-service) plus quick copy-paste lists per service |
| Error Handling Patterns | ErrorOr<T>, AppError types, HTTP status mapping, response shapes, validation |
| OHLC Feature Enhancements | New pattern types (Cypher, Three Drives, ABCD), composite signal score, multi-timeframe confirmation, backtest improvements, indicator overlays, live alerts, BTC/ETH symbols |
| OHLC Phase 2 — Actionability & Observability | Desktop/email notifications, analytics dashboard, chart drawing tools, watchlist, paper portfolio |
| Broker — IC Markets EU + cTrader Open API | IC Markets EU chosen as single broker; Raw Spread account; live tick streaming via cTrader Open API WebSocket |
| OHLC Service — Candle Data Flow | Live feed sequence, backfill flow, REST endpoints, and service-to-service auth pattern for ohlc-service ↔ mi-casa |
| Markets — Pattern Detection | All pattern detection algorithms: harmonic XABCD, structure (ABCD, Three Drives, Double Top/Bottom, H&S), and 19 candlestick patterns — plus signal scoring and SL/TP logic |
| Markets — Replay Feature | Candle-by-candle replay: Redux state, pattern filter multiselects, simulated trade overlay (auto-entry, live P&L, SL/TP), and trade log |
| Broker — IC Markets EU Leverage Limits (Retail) | ESMA retail leverage caps per CFD category, tracked symbol mapping, and margin calculation formula |
| Trading System — Dependency Map | End-to-end dependency map: auto-trade prerequisites, SL/TP calculation, resolution matrix, pattern config fallback chain, pending order activation, and known bugs |
| Backtest System — Dependency Map | Backtest pipeline: entry strategy simulation per mode (swing_confirmation / prz_touch / candle_close), SL/TP anchor logic, walk-forward scanner, output shape, and known bugs |
| Optimisation System — Dependency Map | Optimisation pipeline: 50-config grid, composite scoring, best-run selection, apply flow, what does/doesn’t propagate to live trading, and known bugs |
| Strategy-gates-Pattern — Auto-Trading Rule | Architectural rule: why a detected harmonic pattern never opens a trade without a matching enabled Strategy — supported strategy types and what bypasses the gate |
| Auto-Trading — Per-Strategy Account Routing | How ctraderAccountId on a Strategy routes trades to paper vs. a specific live account — stale-signal gate, immutable pending order snapshots, and disconnect guard |