# AegisTrade AI — User Manual & Operating Guide

## 1. Introduction

**AegisTrade AI** is an intelligent trading and capital protection terminal designed for cryptocurrency markets on the Bybit V5 platform. It pairs predictive probabilistic machine learning with an uncompromised, independent financial risk engine.

---

## 2. Navigating the Financial Terminal

### 2.1 Overview Dashboard
- **Top KPIs**: Displays real-time account equity, daily loss consumption percentage against the 1.0% circuit breaker, peak portfolio drawdown against the 5.0% limit, and position risk fraction (0.25%).
- **Market Candlestick Widget**: Live 15-minute candlesticks with high/low/close metrics.
- **AI Recommendation Card**: Real-time signal summary (LONG, SHORT, NO-TRADE) with win probability, expected value, and trade rationale.

### 2.2 Market Intelligence
- **Symbol Selection**: Toggle between supported markets (`BTCUSDT`, `ETHUSDT`, `SOLUSDT`).
- **Orderbook Depth**: Real-time bid/ask spreads, mid-market pricing, and liquidity health.
- **Regime Identification**: Automated classification (`TRENDING_BULL`, `TRENDING_BEAR`, `RANGING_LOW_VOL`, `RANGING_HIGH_VOL`, `LIQUIDITY_STRESS`, `UNCERTAIN`).

### 2.3 AI Signals & Statistical Expectancy
- **Probabilistic Calibration**: Shows Platt-scaled win probabilities and Brier reliability scores.
- **Cost-Adjusted Expected Value (EV)**: Displays net expected edge after taker fees ($0.055\%$), slippage ($0.020\%$), spread, and uncertainty buffer.
- **NO-TRADE Explanations**: Explains why capital is preserved in cash when expected edge is below $15.0\text{ bps}$.

### 2.4 Positions & Execution Ledger
- **Open Positions**: Live mark-to-market valuations, entry prices, protective stop loss, and take profit targets.
- **Manual Order Entry**: Submit orders that are automatically sized and validated by the Independent Risk Engine.
- **Emergency Flatten**: One-click action to close all open positions immediately.

### 2.5 Historical Backtesting Workbench
- **Parameter Setup**: Select test symbols, historical candle count, and initial capital.
- **Scorecard**: Institutional metrics including Net PnL, Win Rate, Profit Factor, Sharpe Ratio, Sortino Ratio, and Max Drawdown.
- **Benchmark Overlay**: Strategy vs. Buy & Hold benchmark vs. Cash floor.
- **Walk-Forward Validation**: Multi-window out-of-sample evaluations with strict purging and embargo.

### 2.6 AI Model Center
- **Model Registry**: Champion/Challenger tracking with Brier scores and validation accuracies.
- **Model Training**: Retrain candidate models on updated historical data.
- **Governance**: Explicit human promotion to Champion and instant rollback.

### 2.7 Risk Control Center
- **Circuit Breakers**: Monitor intraday loss consumption and peak drawdowns.
- **Small Account Protection**: Inspect lot sizes and sub-minimum rejections.
- **Audit History**: Log of all pre-trade risk engine decisions.

### 2.8 System Monitor & Settings
- **Diagnostics**: Health check statuses, WebSocket liveness, feed telemetry lag.
- **Emergency Kill Switch**: Persistently halt or reset trading system.
- **Operational Mode Switcher**: Safely switch between `BACKTEST`, `PAPER`, `BYBIT_DEMO`, and `LIVE`.

---

## 3. Emergency Kill Switch Operations

The Kill Switch immediately prevents new order submissions and halts automated execution.
1. Click the red **KILL SWITCH** button in the top navigation.
2. Enter an audited reason (e.g., "Exchange latency spike").
3. Confirm the halt.
4. To disengage, open the modal and confirm reset with administrator credentials.
