OPEN-SOURCE SCRIPT

TRAPPER TRENDLINES — RSI

99
Builds dynamic RSI trendlines by connecting the two most recent confirmed RSI swing points (highs→highs for resistance, lows→lows for support). Includes optional channel shading for the 30–70 zone, an RSI moving average, clean break alerts, and simple bullish/bearish divergence alerts versus price.

How it works

RSI pivots: A point on RSI is a swing high/low only if it is the most extreme value compared with a set number of bars on the left and the right (the Pivot Lookback).

RSI trendlines:

Resistance connects the last two confirmed RSI swing highs.

Support connects the last two confirmed RSI swing lows.

Lines can be Full Extend (update into the future) or Pivot Only.

Channel block: Optional fill of the 30–70 range for fast visual context.

Alerts:

Breaks of RSI support/resistance trendlines.

Basic bullish/bearish RSI divergences versus price pivots.

Inputs

RSI

RSI Length: Default 14 (standard).

Pivot Lookback: Bars to the left/right required to confirm an RSI swing.

Overbought / Oversold: 70 / 30 by default.

Line Extension: Full Extend or Pivot Only.

Visuals

Show RSI Moving Average / Signal Length: Optional smoothing line on RSI.

RSI/Signal colors: Customize plot colors.

Show 30–70 Channel Block: Toggle the middle-zone fill.

Tint pane background when RSI in channel: Optional subtle background when RSI is between OB/OS.

Divergences & Alerts

Enable RSI TL Break Alerts: Alert conditions for RSI line breaks.

Enable Divergence Alerts: Bullish/Bearish divergence alerts versus price.

Pairing with price for confluence/divergence

For accurate confluence and clearer divergences, align this RSI tool with your price trendline tool (for example, TRAPPER TRENDLINES — PRICE):

Set RSI Pivot Lookback equal to the Pivot Left/Right size used on price.

Example: Price uses Pivot Left = 50 and Pivot Right = 50 → set RSI Pivot Lookback = 50.

Keep RSI Length = 14 and OB/OS = 70/30 unless you have a specific edge.

Interpretation:

Confluence: Price reacts at its trendline while RSI reacts at its own line in the same direction.

Divergence: Price makes a higher high while RSI makes a lower high (bearish), or price makes a lower low while RSI makes a higher low (bullish), using matched pivot windows.

Suggested settings

Higher timeframes (4H / 1D / 1W): Pivot Lookback = 50; optional RSI MA length 14; channel block ON.

Intraday (15m / 30m / 1H): Pivot Lookback = 30; optional RSI MA length 14.

Always mirror your price pivot size to this RSI Pivot Lookback for consistent swings.

Reading the signals

RSI trendline touch/hold: Momentum reacting at structure; look for confluence with price levels.

RSI Trendline Break Up / Down: Momentum shift; consider price structure and retests.

Bullish/Bearish Divergence: Confirm only when pivots are matched and the new swing is confirmed.

Notes & limitations

Pivots require future bars to confirm by design; trendlines update as new swings confirm.

Divergence logic compares RSI pivots to price pivots with the same lookback; mismatched windows can produce false positives.

No strategy entries/exits or performance claims are provided. This is an analytical tool.

Alerts (titles/messages)

RSI: Trendline Break Up — “RSI broke falling resistance line.”

RSI: Trendline Break Down — “RSI broke rising support line.”

RSI: Bullish Divergence — “Bullish RSI divergence confirmed.”

RSI: Bearish Divergence — “Bearish RSI divergence confirmed.”

Quick start

Add the indicator to a separate pane.

Set Pivot Lookback to match your price tool’s pivot size (e.g., 50).

Optionally toggle the RSI MA and Channel Block for clarity.

Enable alerts if you want notifications on RSI line breaks and divergences.

Use with TRAPPER TRENDLINES — PRICE or any price-based trendline tool for confluence/divergence analysis.

Compliance

This script is for educational purposes only and does not constitute financial advice. Trading involves risk. Past performance does not guarantee future results. No performance claims are made.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.