transform a spy ODTE trading strategy into a bot for use on option alpha

Job ID: 40241485

Budget: $1,500 – $3,000 USD

ALGORITHM STRUCTURE: SPY WARRIOR v5.1
PHASE 1: THE SCANNER (Runs Every 1 Minute)
This loop constantly filters the market for the "Goldilocks" conditions.
1. Global Time Check:
o IF Current Time is between 10:00 AM EST and 3:00 PM EST
o OR IF Open_Gap_Percent > 1.5% AND Time is 9:31 AM EST (Gap-and-Go Override)
o THEN Proceed to Step 2.
o ELSE End Loop (Wait for next minute).
2. VIX Regime Filter (The Gatekeeper):
o IF VIX is between 15.00 and 30.00
o THEN Proceed to Step 3.
o ELSE End Loop (Market too boring or too dangerous).
3. Compression Filter (The "Narrow State"):
o IF Bollinger_Bandwidth(20, 2) < 0.10% (v4.20 Elite Setting)
o OR IF Bollinger_Bandwidth_Percentile < 5th Percentile
o THEN Proceed to Step 4.
o ELSE End Loop (No stored energy).
________________________________________
PHASE 2: THE TRIGGER (Signal Detection)
This logic validates if the specific candle matches the "Institutional Ignition" profile.
4. Trend Direction Filter:
o IF Price > SMA(20) -> Set Mode to BULLISH.
o IF Price < SMA(20) -> Set Mode to BEARISH.
5. Candle Geometry (Elephant Bar) Check:
o Calculate Bar_Range = (High - Low).
o Calculate Prev_Bar_Range = (Previous High - Previous Low).
o Check 1 (Relative Size): Is Bar_Range > (2.0 * Prev_Bar_Range)?
o Check 2 (Absolute Size): Is Bar_Range > (1.5 * ATR(14))? (Noise Filter)
o Check 3 (Volume): Is Current_Volume > (1.5 * Volume_SMA(10))?
o IF ALL TRUE -> SIGNAL VALIDATED. Proceed to Step 6.
________________________________________
PHASE 3: THE CALCULATOR (Position Sizing)
Before firing, the bot calculates exact risk based on account size and location.
6. Base Risk Calculation:
o Account_Risk = Net_Liquidity * 0.006 (0.6%).
+1
7. "Gamma Flip" Safety Check:
o IF Price is within 0.5% of Yesterday_High OR Yesterday_Low
o THEN Trade_Risk = Account_Risk / 2 (Half Size).
o ELSE Trade_Risk = Account_Risk (Full Size).
8. Instrument Selection (VAV):
o IF VIX is 15 - 18 -> Select Debit Spread ($5 wide).
o IF VIX is 18 - 30 -> Select Long Option (Delta 0.45).
________________________________________
PHASE 4: THE MANAGER (Post-Trade Logic)
This runs continuously on every open position to manage the exit.
9. Hard Time Exit:
o IF Time > 3:45 PM EST -> CLOSE IMMEDIATELY (Market Order).
10. The "Elite" 60% Win Rate Breakeven Logic:
o IF Position_ROI > +10%
o THEN Update Stop Loss to Entry_Price (Break-even). Do not wait.
11. Profit Taking (The "Warrior Shield"):
o Condition A (Home Run): IF Total_Profit > $2,000 -> Trail Stop at 50% of Peak Profit.
o Condition B (Base Hit): IF Position_ROI > +20% -> Trail Stop at 10% Trailing.
12. Stop Loss (The Guardrail):
o IF Position_ROI < -20% (or derived from 0.6% risk math) -> CLOSE IMMEDIATELY.
________________________________________
Variable Data Dictionary (For Misha)
Variable Name Value/Formula Source Ref
ATR_Period 14
RVOL_SMA 10
Risk_Percent 0.6%
Elephant_Mult 2.0x
Breakeven_Trigger +10% ROI v4.20 Spec
Audit_Slippage $0.10