PulseHub
OPEN-SOURCE SCRIPT
Updated

Cash Secured Put (CSP) Options Entry Screener

382
CSP Options Entry Screener

This indicator screens stocks for a confirmed bullish DMI/ADX setup and flags them as candidates for **selling cash-secured puts (CSP)**. It is built to be used as a scanning column inside PulseWire's Pine Screener, across an entire watchlist.

WHY DMI/ADX FOR CSP ENTRIES

Selling a cash-secured put works best when you're comfortable owning the underlying at the strike price, and ideally you enter the trade right as the stock stops falling and starts to turn bullish again — rather than while it's still in a strong downtrend. Selling into an ongoing downtrend means a higher chance of assignment at a price that keeps falling further after you own the shares.

This screener uses the ADX/DMI crossover as a "trend is turning and starting to hold" signal:
  • ADX (trend strength) rising and holding above the -DI line for 2+ candles signals that downside momentum is fading and a new directional move is taking hold.
  • +DI above -DI at the same time confirms the emerging move is bullish, not another leg down.


In other words, the signal is not "buy the stock now," but "this stock just showed the first confirmed sign of turning bullish — a reasonable moment to consider selling a put" (at or below the current price, at a strike/expiry you're comfortable with). If the stock keeps rising, the put expires worthless and you keep the premium; if it pulls back and you get assigned, you're buying into a stock that had just shown a bullish trend reversal, at your chosen strike, rather than into an uninterrupted decline.

This does not replace your own judgment on strike selection, premium, or position sizing — it's a way to narrow a large watchlist down to symbols worth a closer look.

SIGNAL LOGIC

A signal fires when all of the following are true on a daily candle:
  • ADX is rising compared to the previous candle
  • ADX has been above the -DI line for at least 2 consecutive candles (confirms the trend is holding, not reacting to a single-bar spike)
  • +DI is above -DI at the same time (directional confirmation the move is bullish)


The signal fires only once, on the candle where the 2-day confirmation is met — it does not stay "on" for every following candle.

Note: all calculations are locked to the Daily timeframe internally (via `request.security` with `"D"`), regardless of the resolution the chart or the Pine Screener is currently displaying. This guarantees consistent daily-candle logic even when scanning on an intraday or weekly chart.

OUTPUT COLUMNS
  • Days since last Buy-Signal — candles since the last confirmed signal (0 = today, blank/na = never occurred). Main column to filter/sort on.
  • Price change today (%) — daily % change of the close vs. previous close (Data Window / Screener only, not plotted on the chart pane).
  • Price change since Buy-Signal (%) — % change of the close from the day of the last signal to today (Data Window / Screener only).
  • Buy Signal (today) — 1 if today is a signal candle, 0 otherwise.
  • ADX / +DI / -DI — current indicator values, for context.


On the price chart, a green "Sell CSP" label is plotted directly on the signal candle. In the DMI/ADX pane, a small green triangle ("Buy (day)") marks the same candle.

HOW TO SCAN THE LAST 5 DAYS IN THE PINE SCREENER
  1. Add this script to any chart once (Pine Editor → Add to Chart) so it appears under "My Scripts."
  2. Important: the Pine Screener only lists indicators that are in your Favorites — adding it to a chart alone is not enough. Open the Indicators dialog (or the script/column picker inside the Screener), find "CSP Options Entry Screener" under "My Scripts," and click the star icon to add it to your Favorites.
  3. Open the Pine Screener (pulsewire.com/pine-screener/, or Products → Screeners in the web app — not yet available in the Desktop app).
  4. Choose the watchlist you want to scan as your symbol source.
  5. Click "Choose indicator" and select this script, "CSP Options Entry Screener," from your Favorites.
  6. Open the "Days since last Buy-Signal" field and click "Manual setup...".
  7. Filter it: less than or equal to 5 (≤ 5).
  8. Sort ascending to see the newest signals first (0 = signal today, 1 = yesterday, etc.).
  9. Optionally add "Price change today (%)" and "Price change since Buy-Signal (%)" as extra columns for context on how far the stock has already moved since the signal — useful for judging whether there's still room for a CSP entry or whether the move has largely played out.


This filter shows every symbol in your watchlist that had a confirmed bullish DMI/ADX reversal within the last 5 trading days — a shortlist of candidates worth evaluating for a cash-secured put.
Release Notes
The entry signal is unchanged. Everything in this update is about planning the trade that follows a signal: where to place the strike, and whether the premium is worth collecting today.

PERFORMANCE BOX

Each signal now draws a box across the following 20 candles (configurable). One edge is the daily close on the signal day, the other tracks the current price, with the percentage between them shown alongside — green if the stock rose, red if it fell. It answers at a glance how the last signal actually worked out.

snapshot

STRIKE LINES

Below each box, up to four dashed lines mark candidate strikes at -10%, -12%, -15% and -20% from the signal price by default, each with its own on/off switch and freely configurable. Labels read like `191 (-10%, ~18.4% ITM)`.

Levels are rounded to tradable strikes — options do not trade at 191.16. The grid adapts to the price level (0.50 below 25 USD, 1.00 up to 200, 5.00 above) and can be overridden manually.

The ITM figure estimates the chance of assignment, modelling price as lognormal without drift. It comes close to what a pricing model reports as delta: roughly 18% ITM corresponds to about a 0.18 delta put, the region most put sellers target. It lets you choose a strike by risk instead of guessing what "10% below" means for a particular stock.

Only the newest signal carries lines, and they never move once drawn — so reviewing an old signal shows the strike you would actually have sold that day.

VOLATILITY CONTEXT

Two new measures, both derived from historical volatility, because HV on its own tells you nothing: 24% is enormous for a utility and quiet for a biotech.

  • HV percentile — of this symbol's last 252 daily HV readings, what share were at or below today's? P78 means the stock is swinging harder than on 78% of days in the past year. The scale is normalised, so it compares directly across symbols. Volatility mean-reverts, so selling when it is unusually elevated collects a rich premium and benefits as the option cheapens while things calm down.
  • Expected move — HV scaled to your planned holding period. 24% over 30 days is about ±6.9%, or ±14.63 USD on a 212.40 USD stock. Hold it against the strike lines to see how many standard deviations away each one sits.


Both appear on the signal label as `±6.9% (14.63) · P78`, and as screener columns together with annualized HV.

ALERTS

Previously there were none. Pick CSP Entry Signal for a plain notification, or Any alert() function call to receive the volatility context in the message itself, so a low-percentile signal can be skipped from your phone without opening a chart.

REFERENCE PRICE FIX

All levels now reference the daily close on the signal day rather than the close of whatever chart candle you happen to be viewing. Box and strike lines therefore sit at identical prices on a daily and on an intraday chart.

LIMITATIONS

This uses historical, not implied volatility — Pine cannot read option chains. Ahead of an earnings report IV rises while HV stays calm, so the percentile will look low even though premiums are already fat. The ITM figures are a rough delta proxy: shortlist a strike with them, then confirm against real quotes before selling.

There is no earnings filter — check the calendar yourself. And signals are computed on daily data, so on an intraday chart one can appear during the session and vanish before the close; treat a signal as final only after the daily bar has closed.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.