AITOS — AI-Assisted Trading Architecture
An AI-assisted market analysis pipeline featuring stage-gated signal scoring, ONNX Runtime sequence model inference, deterministic risk gates, and paper trading parity.
[DISCLAIMER & STATUS: EXPERIMENTAL / WIP]
AITOS evaluates machine learning market signals against hard risk boundaries. It does not constitute financial advice or live trading recommendations.
AITOS evaluates machine learning market signals against hard risk boundaries. It does not constitute financial advice or live trading recommendations.
1. Executive Overview
AITOS decouples probabilistic candidate signal generation from execution authority. Machine learning models (PyTorch / ONNX Runtime) generate candidate scoring vectors, but a deterministic risk engine evaluates daily loss limits, account capital caps, and market session time checks (`09:15-15:25 IST`) before order submission.
2. Stage-Gated Execution Pipeline
AITOS Execution Boundary Pipeline
flowchart TD
A[Market Data Feed] --> B[Data Validation Engine]
B --> C[Feature Engineering Pipeline]
C --> D[Sequence Model ONNX Runtime]
D -->|Candidate Score| E[Deterministic Risk Gate]
E -->|Check Capital & Session| F{Approved?}
F -->|Yes| G[Paper Trading Sandbox]
F -->|No| H[Audit Log Rejection]
G --> I[PostgreSQL PnL Ledger]
3. Core Subsystems
- Data Validation Engine: Candle backfilling and tick deduplication.
- Feature Engineering Pipeline: Computes technical indicators (EMA, RSI, ATR).
- Sequence Model Subsystem (ONNX Runtime): Converts PyTorch sequence models to static ONNX graphs for low-latency pre-warmed session inference.
- Deterministic Risk Layer: Hard capital caps, daily drawdown limits, and session time checks (`09:15-15:25 IST`).
- Paper Trading Engine: Dynamic balance ledger, simulated 0.05% slippage, and brokerage/STT fee deduction.
4. Technology Stack by Role
| Layer / Role | Technologies Used |
|---|---|
| Backend Framework | Python 3.11, FastAPI, Pydantic |
| Machine Learning & Inference | PyTorch, ONNX Runtime, NumPy, Pandas |
| Persistence & State | PostgreSQL, Redis Pub/Sub |