anchor-demo / options trader bot
Options trader bot
It buys a same-day (0DTE) SPY option on Interactive Brokers when SPY breaks out of its first 15 minutes. Safe by default: no orders until you set a stop and a target, and paper only unless you add --live.
What it does
- Takes the high and low of the first 15 minutes.
- CALL when SPY goes $0.30 above that range, PUT when $0.30 below.
- Buys today's option about $1.50 out of the money, sized to its budget ($100 to start).
- Leaves the stop and target at IB, and logs each trade to a CSV.
- Stops for the day after two losses in a row.
Fixed from the original
- Bought a contract it could not afford.
- Read the wrong bar as the opening range.
- Kept trading on a made-up $100 when the balance failed to load.
- Switched to tomorrow's expiry, which is not 0DTE.
- Crashed when no strike was near, and used the PC's clock instead of New York's.
Checked against its spec
The light loop held it to 19 rules from its written spec and proved 3 faults: a wrong strike on a tie, an in-the-money buy, and a log row lost on Ctrl+C. All three are fixed.
Tested
84 tests, and they caught all 30 bugs planted to test them. The trading-day tests run against a fake TWS, so no test can reach a real account.
Replayed on a real week
SPY's real minute bars for November 2 to 6, 2026, with $100 and test exits: it traded on Monday and Wednesday, and the budget ended at $35.40. On the other three days the option cost more than the budget left. Option prices are modeled, not real quotes.
How others do it
- Hugging Face has no model or dataset for this strategy.
- QuantConnect picks same-day expiries and strikes by delta, and trades options through IB.
- Opening-range research trades shares; one 0DTE version sells spreads instead of buying.
- Retail traders lost about $70 million on 0DTE index options in 2021 to 2023.
- One 0DTE study's profits vanished once trading spreads were charged in full.
Open questions
- Is there more of the original script?
- What stop and target?
- What is
TIME_STOP_PCTfor? - Trade again the same day after a trade?
- Is the 15-minute breakout the trend read you mean?
- Option too dear for the budget: go further out, or skip?
- Carry the budget day to day, or reset to $100?