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提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。