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).
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。