OPEN-SOURCE SCRIPT
Put Option Profits inspired by Travis Wilkerson; SPX Backtester

Put Option Profits โ Travis Wilkerson inspired. This tester evaluates a simple monthly SPX at-the-money credit-spread timing idea: enter on a fixed calendar rule (e.g., 1st Friday or 8th day with business-day shifting) at Open or Close, then exit exactly N calendar days later (first tradable day >= target, at Close). A trade is marked WIN if price at exit is above the entry price (1:1 risk proxy).
The book suggests forward testing 60-day and 180-day expirations to prove the concept. This tool lets you backtest both (and more) to see what actually works best. In the book, profits are taken when the spread reaches ~80% of max credit; losers are left to expire and cash-settle. This backtester does not model early profit-takingโevery trade is held to the configured hold period and evaluated on price vs entry at the exit close. Think of it as a pure โset it and forget itโ stress test. In live trading, you can still follow Travisโs 80% take-profit rule; TradingView just doesnโt simulate that here. Happy trading!
Features:
How to use:
Notes:
Keep DOM shift in same month: when a DOM falls on a weekend/holiday, PrevBizDay/NextBizDay shift will stay inside the month if enabled; otherwise it can spill into the prior/next month. (Ignored for NthWeekday.)
Credits: Concept sparked by โPut Option Profits โ How to turn ten minutes of free time into consistent cash flow each monthโ by Travis Wilkerson; this script is a neutral research tool (not financial advice).
The book suggests forward testing 60-day and 180-day expirations to prove the concept. This tool lets you backtest both (and more) to see what actually works best. In the book, profits are taken when the spread reaches ~80% of max credit; losers are left to expire and cash-settle. This backtester does not model early profit-takingโevery trade is held to the configured hold period and evaluated on price vs entry at the exit close. Think of it as a pure โset it and forget itโ stress test. In live trading, you can still follow Travisโs 80% take-profit rule; TradingView just doesnโt simulate that here. Happy trading!
Features:
- Schedule: Day-of-Month (with Prev/Next business-day shift, optional โstay in monthโ) or Nth Weekday (e.g., 1st Friday).
- Entry timing: Open or Close.
- Exit: N calendar days later at Close (holiday/weekend aware).
- Filters: Optional EMA-200 โrisk-onโ filter.
- Scope: Date range limiter.
- Visuals: Entry/exit bubbles (paired colors) or simple win/loss dots.
- Table: Overall Win% and N (within range).
- Alerts: Entry alert (static condition + dynamic alert() message).
How to use:
- [*]Choose Start Mode (NthWeekday or DayOfMonth) and parameters (e.g., 1st Friday or DOM=8, PrevBizDay).
- Pick Entry Timing (Open or Close).
- Set Days In Trade (e.g., 150).
- (Optional) Enable EMA filter and set Date Range.
- Turn Bubbles on/off and/or Dots on/off.
- Create alert:
- Simple ping: Condition = this indicator -> Monthly Entry Signal -> โOnce per barโ (Open) or โOnce per bar closeโ (Close).
- Rich message: Condition = this indicator -> Any alert() function call.
Notes:
Keep DOM shift in same month: when a DOM falls on a weekend/holiday, PrevBizDay/NextBizDay shift will stay inside the month if enabled; otherwise it can spill into the prior/next month. (Ignored for NthWeekday.)
Credits: Concept sparked by โPut Option Profits โ How to turn ten minutes of free time into consistent cash flow each monthโ by Travis Wilkerson; this script is a neutral research tool (not financial advice).
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.