OPEN-SOURCE SCRIPT

Put Option Profits inspired by Travis Wilkerson; SPX Backtester

121
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:

  • 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:

  1. [*]Choose Start Mode (NthWeekday or DayOfMonth) and parameters (e.g., 1st Friday or DOM=8, PrevBizDay).
  2. Pick Entry Timing (Open or Close).
  3. Set Days In Trade (e.g., 150).
  4. (Optional) Enable EMA filter and set Date Range.
  5. Turn Bubbles on/off and/or Dots on/off.
  6. 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).

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.