▶ 전체 게시글 텍스트
I used ChatGPT and Codex to develop and refine these strategies, then used Codex to build the automated bot in Python. I launch, configure and manage it through PowerShell.
My broker is **Interactive Brokers**, and the bot connects to **Trader Workstation (TWS)** running on my desktop to receive market data and place/manage orders.
I downloaded 5-minute SPY/QQQ data from TradingView and backtested Jan 1–Jun 25, 2026: 120 trading days. Targets and stops measure movement in the underlying, not the option premium.
**SPY**
* 9:30–10:30 ET opening range using 5-minute candles.
* Trigger: $1 above or below the range.
* Enter a same-day expiry call/put after a completed 5-minute candle closes beyond the trigger.
* Max 20% available cash; one setup per day.
* Exit 25% at +$1.50, 25% at +$2.25 and 25% at +$3.00.
* The final 25% is the runner, targeting +$5.50.
* Hard stop: −$3.
* If TP1 has not hit within 60 minutes and SPY is below +$0.50, exit.
* Force-close at 3:30 ET.
The SPY runner is only allocated if the opening range is at least $4.50 wide and at least four contracts were filled. At TP2, it must pass three of four conditions: TP2 within 30 minutes; SPY moved at least +$1.50 within 30 minutes; pullback before TP2 was no more than $0.50; and no completed 5-minute candle closed back through the trigger. Pass = keep the runner open for +$5.50. Fail = sell the runner around TP2. The SPY runner does not move to breakeven.
**QQQ**
* 9:30–10:00 ET opening range.
* Only trade if the range is $4.28–$5.14 wide.
* Trigger: $0.75 above or below the range; no confirmation candle.
* Max 20% available cash; one setup per day.
* Exit 40% at +$1, 40% at +$2 and keep 20% as a runner targeting +$5.50.
* Hard stop: −$5.
* After TP2, move the runner stop to breakeven.
* Force-close at 4:00 ET.
**Entry execution**
The bot submits a buy limit order at the current option ask, then raises it by $0.02 every 0.5 seconds for up to three seconds. It cancels the unfilled quantity if the underlying moves more than $0.25 beyond the trigger. Partial fills are kept and there is no retry.
**IBKR/TWS pacing protection**
Interactive Brokers counts new orders, modifications and cancellations as order operations. Before every place/change/cancel action through Trader Workstation, the bot checks its pacing limiter and stays below six operations per two seconds and 60 per ten minutes. If it is near the limit, it waits rather than spamming TWS. This protects entries, profit targets, hard stops, stale exits and forced closes.
**Backtest results**
SPY: 38 trades, 32 wins/6 losses, +57.37 points, +1.51 average.
QQQ: 27 trades, 25 wins/2 losses, +34.10 points, +1.26 average.
Combined: active on 58/120 days (48%), 50 winning days/8 losing days, **+91.47 points and +1.58 per active day**.
SPY only: 31 days. QQQ only: 20 days. Both: seven days.
Whenever both triggered, they were always in the same direction, so QQQ is not a hedge—it mainly adds more opportunities. Running both at full size produced +91.47 points. Splitting allocation when both triggered would have produced approximately +79.01 points with less correlated exposure.
Monthly combined: Jan +7.99, Feb +16.60, Mar +22.06, Apr +13.34, May +11.46, Jun +20.02.
This is a six-month chart-data backtest, not proof of future profitability. The next step is paper trading through Interactive Brokers TWS and measuring real fills, spreads, slippage and live option execution.