DRT Multi-Venue System Documentation
System Overview
Welcome to the official local HTML documentation wiki for the drt-multi-venue trading engine. This venue-agnostic system standardizes market data, feature calculation, and order execution across FXCM and Interactive Brokers (IBKR).
Core Architectural Objectives
- Train/Serve Feature Parity: Single shared feature engine eliminating calculation divergence.
- Regional DST Handling: UTC boundary management for Tokyo (ADR), London (ODR), and New York (RDR).
- High Performance Architecture: Async I/O streaming, Redis Streams, DuckDB state cache, and Parquet archiving.
Quick Navigation
| Section | Description |
|---|---|
| Architecture | System topology, repository layout, data pipeline, and configuration overview. |
| Infrastructure | Redis Streams event bus, DuckDB state cache with WAL tuning, partitioned Parquet archive, and structlog JSON logging. |
| Feature Engine | Initial Balance (IB), Defining Range (DR/IDR), V-shape metrics, and price map clustering. |
| Train/Serve Parity | Divergence resolution between batch offline research and streaming live execution. |
| Broker Adapters | BrokerClient protocol lifecycle, IBKR futures auto-roll, FXCM Java Gateway, and synthetic Mock adapter. |
| Order Execution & Risk | Order Gateway, 9-state lifecycle machine, fat-finger risk filters, multi-TP brackets, GTD expiry watcher, and reconciliation. |
| Bot Versions & Strategies | Full comparison of v1 and v4 bots (v4_flat, v4, v4_ibs15, v4_5m), E3/5m ratchets, IBS_V2_LS daily sleeve, v4_blend sizing, and obs.extra calendar hook status. |
| Bot Journal & Decisions | How to read the bots' journal: every decision label (no_signal / skipped / taken / blocked and their reasons), risk gates, order statuses and broker events. |
| Web Dashboard & Control | TradingView Lightweight Charts v4, viewer_v2 TradeZone primitive overlay, real-time manual order tickets, and VM telemetry. |
| Remote Access & Security | Turnkey Let's Encrypt Caddy HTTPS proxy, Cloudflare Zero Trust Tunnel (0 open ports), and mobile PWA installation. |
| Integration Flow | End-to-end data flow from broker streams through SessionTracker, Redis Streams, DuckDB, and Parquet. |
| Deployment & Ops | ARM VM hardware envelope, 3.0 GB container constraints, watchdog monitoring, and deployment automation. |
| Live Streaming | Host-isolated credentials, demo/prod profiles, 2-strike anti-lockout circuit breaker, and streaming diagnostics. |
| Data Schemas | Complete specifications for Bar, Tick, IBMetrics, ExpansionMetrics, OrderRequest, and Fill schemas. |
| Changelog | Version release notes and track of implementation checkpoints. |