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が提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。