Inspiration
Quant funds test every idea against years of data before risking a dollar, and they have people watching every headline that could move a position. Retail traders mostly have a hunch, a chart and a broker app. Most lose money, not because their ideas are always bad, but because they never get tested and nobody is watching the news while they trade.
We asked: what if anyone could describe a trading idea in plain English and get what a quant desk gets? A strategy written as code, an honest backtest on a decade of market data, and a risk manager that never sleeps.
What it does
TradeMind turns a trading idea into a tested, monitored trading bot.
- Describe it. "Buy when price breaks above the 20-day high on 2× average volume, exit on a 2% trailing stop." The AI Strategy Builder turns that into executable Python strategy code.
- Prove it. Backtest on 10 years of 1-minute data (2016–2026) for all 503 S&P 500 stocks, or on 2,800+ Indian (NSE) stocks. Results stream live: trades, win rate, profit factor, max drawdown, Sharpe ratio and the buy-and-hold benchmark, with realistic costs built in.
- Deploy it. One click turns the strategy into a paper-trading bot with its own wallet ($100k US / ₹10L India), its own positions and a live activity feed.
- Guard it. Risk Watch, our AI risk guard, reads SEC filings (8-Ks, insider sales), trading halts, earnings calendars, exchange announcements and market news in real time. It classifies each event and can block new entries or flag open positions before the bot walks into a disaster.
- Learn from it. Bot Review writes a plain-English report on each bot after every session: what it did, what went wrong and whether it's drifting from its backtest.
There's also a full exchange simulator: it replays a real past trading day minute by minute through the exact APIs and wire formats of our live data providers. You can demo the whole loop on a Sunday and inject breaking news to watch the risk guard react.
How we built it
- Backend: Python and FastAPI, with Server-Sent Events streaming backtest progress to the browser.
- Frontend: React and Vite, with one UI for both markets and a single India ⇄ US switch in the top bar.
- Data:
- 1-minute bars stored as Parquet in Google Cloud Storage: about 1 million bars per US stock, downloaded from Alpaca with a rate-limited (190 calls/min), resumable downloader.
- Fyers WebSockets for live Indian prices; Alpaca for US quotes.
- Engine: vectorised signal computation made backtests about 1,900× faster. A full year of the S&P 500 on 5-minute candles (9.6 million bars, 5,000+ trades) runs in about 2½ minutes.
- AI: LLMs write the strategy code and power the Risk Watch classifier and Bot Review narratives.
- Infrastructure:
- Docker on a Google Compute Engine VM, with Cloud SQL (Postgres), Secret Manager and Cloud Build deploying automatically on merge.
- Per-user, per-market isolation down to the database primary key.
- 479 automated tests.
One of our favourite tricks: most strategies people write are timed to Indian market hours. To run them unchanged on Wall Street, every US bar is mapped onto the "NSE clock", the same number of minutes after the open.
So 09:30 New York becomes 09:15 Mumbai. It holds across daylight-saving changes because we convert through the real New York time zone, and trades are mapped back to real US time afterwards.
Challenges we ran into
- Time zones and daylight saving. Our first US backtests returned zero trades. Strategies were reading Indian session times, and the US open moves between 13:30 and 14:30 UTC with DST. That led to the NSE-clock design above.
- Honest costs. Indian round trips cost about \(0.084\%\) (brokerage, STT, exchange fees, GST); US trades cost about \(0.003\%\) (SEC and FINRA fees on sells). Getting these wrong makes every strategy look great.
- Data at scale. 503 stocks × 10 years × 390 minutes a day hit API rate limits, network drops and an out-of-memory crash on our first VM. We made the download resumable and split-aware, and checksummed all 2,844 existing Indian files before and after to prove nothing was touched.
- Keeping production safe. Development moved fast, so we ran a separate dev database, a simulator mode that refuses to start against the production database, and secrets that live only in Secret Manager.
- Regulation changes mid-build. Our Indian broker disabled automatic token refresh to comply with SEBI rules, so daily re-authentication became part of the design.
Accomplishments that we're proud of
- One codebase, two markets. The same strategy backtests on Indian or US stocks with one switch, and the Indian results stayed identical to the trade after we added the US.
- A risk guard that reads the news. It ships in shadow mode by default, so it logs what it would have blocked before anyone trusts it with real decisions.
- An exchange simulator realistic enough that the platform can't tell it apart from the real providers.
- Honest backtests. In one of our own AI strategies on the S&P 500 in 2025, the bot made +3.7% while buy-and-hold made +15%. TradeMind tells you that before you risk money, and that's the point.
What we learned
- A backtest is only as good as its assumptions: time zones, costs, splits and data gaps matter more than the indicator.
- LLMs are excellent at turning intent into code, but the engine around them (validation, isolation, realistic simulation) is what makes the output trustworthy.
- Risk management belongs inside the trading loop, not in a report afterwards.
- Building a simulator early pays off: it gave us repeatable demos, safer testing and a way to rehearse rare events like trading halts.
What's next for TradeMind
- Live money: connect paper bots to real brokerage accounts (Alpaca for the US, Fyers for India), with the risk guard in enforce mode.
- More markets and data: ETFs, options and fundamentals for US stocks.
- Portfolio-level risk: exposure limits across all of a user's bots, not just one at a time.
- Strategy marketplace: share tested strategies, with their full backtest record attached.