Would my trading bot survive a crash?

About this video
A momentum bot written in Python holds the 5 stocks with the best 20-day return, at 1.5 times its net worth. tfrun runs it on tradefloor in a market of 17 Nasdaq-100 tech stocks, built from their SEC filings, with simulated prices.
After day 40, Claude branches the market into a rate shock of +200 bp across the curve and a liquidity crisis, where order books are 40% as deep and the VIX is 3.5 times higher. Days 1 to 40 are the same on all three lines, and the same bot trades each one from the terminal for days 41 to 100.
Claude explains the loss from tradefloor's own tools, changes one line of the bot and runs it on a new branch with the same crisis.
Chapters
- The bot
- Branch
- Run
- Why
- Fix
- Result
Figures on screen
Every figure here is on screen in the video and was checked against the product's own data.
- On day 40 the bot was down 2.1% and the index was down 4.3%.
- By day 100 the bot was down 1.0% with no shock, 17.7% in the rate shock and 37.2% in the liquidity crisis. The index fell 25.8% in the crisis.
- In the crisis the bot held 1.52 times leverage while the VIX was at 53.1.
- The fix scales leverage down as the VIX rises:
gross = GROSS * min(1.0, 20 / market.vix) - With the fix the bot lost 22.3% in the same crisis instead of 37.2%, and its worst drawdown was 28.7% instead of 43.1%. It finished 2.35 points ahead of buy-and-hold instead of 12.51 behind.
The guide
The written version is Stress testing a trading bot against a market crash. It puts a momentum bot through a liquidity crisis, a rate shock and a recession in Python, with the script on the page for you to run.
More demos
2:07Can Claude out-trade a bot?Claude, a momentum bot and a buy-and-hold bot trade one shared market for 25 days, straight through a liquidity crisis.
2:20Does my trading bot pass CI?A pull request raises a bot's leverage and tradefloor's stress suite fails it in CI. Claude fixes the bot from the CI log without loosening the check, and CI passes.
3:02Skill or luck?Claude tunes a trading bot on 8 public markets and none of its changes beats the original. On fresh hidden markets the unchanged bot scores anywhere from 33 to 51.
3:18A trading classA teacher sets a credit crisis from a template. One student's AI agent trades it, another trades by hand and hands in, and the teacher watches live and marks.
3:47No installA new account writes a trading bot in the browser, tests it against three crises in the same tab and asks Claude which one hurt, with nothing installed.