Swiss-Editorial Limit Order Book Matching Engine, Causal Walk-Forward Statistical Arbitrage Backtester & Tail-Risk Terminal built with FastAPI, NumPy/SciPy, and HTML5 Canvas.
-
Price-Time FIFO Limit Order Book (
src/quantpress/orderbook.py)- Deterministic deque-per-price-level matching engine supporting resting
LIMITand sweepingMARKETorders (BUY/SELL). - Computes real-time Best Bid/Ask, Mid Price, Spread (
bps), Depth Imbalance, and Volume-Weighted Microprice.
- Deterministic deque-per-price-level matching engine supporting resting
-
Strictly Causal Walk-Forward Backtester (
src/quantpress/backtester.py)- Enforces zero look-ahead bias: z-score rolling windows use strictly prior bars (
px[t-lookback : t]), signals computed at bartapply to returns earned fromt -> t+1(lag_pos), and round-trip maker/taker fees + half-spread slippage are deducted upon position changes. - Evaluates three distinct stochastic regimes (
mean_revert,volatile_chop,macro_trend) across partitioned 60% In-Sample / 40% Out-of-Sample splits.
- Enforces zero look-ahead bias: z-score rolling windows use strictly prior bars (
-
Institutional Tail-Risk Engine (
src/quantpress/risk.py)- Computes Annualized Return, Volatility, Sharpe Ratio, Sortino Ratio (downside semi-deviation), Calmar Ratio, Maximum Drawdown, Empirical 95% VaR, and 95% Conditional VaR (Expected Shortfall).
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/api/book/snapshot |
Returns L2 bid/ask ladders, spread bps, microprice, imbalance, and recent fills |
POST |
/api/book/order |
Submits LIMIT or MARKET order to the FIFO matching engine |
POST |
/api/book/reset |
Resets L2 order book to realistic seeded depth |
POST |
/api/backtest/run |
Executes causal walk-forward strategy evaluation across regimes |
pip install -e .
quantpress serve --host 127.0.0.1 --port 11470 --openRun JS + Python test suite:
make test