MAHIMN PATEL.

Math & Economics at the University of Toronto. Builds quantitative trading systems.

Pricing the priceless & proving the obvious.

How the trading code is set up five things I do every time
i.

Half-Kelly only.

Full-Kelly assumes zero estimation error. The realized edge is always noisier than the backtest. Every adapter in trading-algo sizes at half.

ii.

Backtests report a p-value.

Deflated Sharpe (Bailey & López de Prado), not a point Sharpe. PBO and White's Reality Check on every config before it leaves research. The 12 documented limitations are in the repo.

iii.

Five gates before a live order.

TRADING_ALLOW_LIVE in env. --allow-live on the command line. Paper-only enforcement explicitly disabled. Per-order YES at the terminal. Confirmation callback wired through the CLI. Missing any of them blocks the call.

iv.

The CLI is the audit log.

ibkr_tool, flex_tool, kite_tool. Structured envelopes, stable exit codes, idempotency keys. SEBI-compliant jsonl for kite-algo. An agent action that isn't in the log can't have happened.

v.

Document what didn't work.

The shelved Gemini trader is still in the repo. The crypto book lags BTC buy-and-hold and the README says so. Trailing stops hurt Sharpe on every config; off in V11.

Projects click any row to expand
Writing 1 published · more in draft
ESSAY · 01 · 8 MIN APR 2026

Why I shelved the LLM trader.

Notes on removing the Gemini trader from trading-algo's production loop. The literature on LLM market alpha, what I read, what I built, what would change my mind.

quantphil

Get in touch.

© MMXXVI · MP