RSI Trendlines with Breakouts

RSI Trendlines with Breakouts

1. Introduction

The RSI Trendlines with Breakouts (HoanGhetti) indicator combines classic RSI analysis with dynamic trendline detection to highlight potential reversal and continuation points directly on the RSI pane. By plotting trendlines through successive RSI pivots and marking clear breakouts with arrows, it helps traders spot momentum shifts earlier and more objectively.

2. Description & Fundamentals

  • Relative Strength Index (RSI): A momentum oscillator measuring speed and change of price movements on a scale of 0–100. Traditionally, readings above 70 indicate overbought conditions; below 30, oversold.

  • Pivot Points in RSI: Local highs and lows in the RSI series, detected over a configurable look-back period. These serve as anchors for drawing trendlines.

  • RSI Trendlines: Lines connecting two consecutive pivot highs (for a downtrend) or pivot lows (for an uptrend). A breakout of these lines often precedes notable price moves.

3. How It Works

  1. Pivot Detection:

    • The script scans the RSI (14) values over the last BarLookBack = 8 bars.

    • When the current RSI equals the highest (or lowest) value over the look-back window, it registers a pivot high (or low).

  2. Trendline Construction:

    • Maintains two arrays ($plx/$ply for lows, $phx/$phy for highs) storing the bar indices and RSI values of the last two pivots.

    • Calculates the slope-intercept form:

      y=y1+(x−x1) y2−y1x2−x1

    • Draws the segment only if it confirms a valid uptrend (pivot low2 > low1) or downtrend (pivot high2 < high1).

  3. Breakout Signals:

    • Bearish Breakout (Red): When RSI crosses below the up-trendline minus RSIdiff = 2, it drops a red down-arrow above the RSI pane.

    • Bullish Breakout (Green): When RSI crosses above the down-trendline plus RSIdiff, it plots a green up-arrow below the RSI pane.

    • After signaling, the trendline is extended in dotted style to the breakout bar.

4. Signal Interpretation

  • Red Down-Arrow (Sell Signal):

    • RSI has failed to maintain its uptrend and closed beneath the trendline by at least RSIdiff points.

    • Suggests weakening momentum—consider tightening stops or initiating short positions.

  • Green Up-Arrow (Buy Signal):

    • RSI recovers above its down-trendline by at least RSIdiff points.

    • Indicates renewed buying pressure—potential long entries or add-on opportunities.

  • Notes & Caveats:

    • Trendline breakouts can give false signals in choppy markets; combine with price action or volume filters.

    • Best used on well-defined trending instruments or timeframes where RSI reliably oscillates.

5. Configuration & Parameters

Parameter Default Description
BarLookBack 8 Number of bars to look back for pivot detection. Smaller values detect tighter swings, more noise.
repaint 0 When set to 1, pivots are identified with a delay of BarLookBack bars (not recommended).
RSIdiff 2 Minimum distance (in RSI points) beyond the trendline required to trigger a breakout arrow.
  • Adjusting BarLookBack:

    • Increase (e.g. 10–14) on higher timeframes to smooth trendlines.

    • Decrease (e.g. 5–6) on intraday charts for quicker signals.

  • Tweaking RSIdiff:

    • Larger values (3–4) reduce false breakouts but may lag.

    • Smaller values (1–1.5) catch earlier moves at the expense of more noise.

6. ProBuilder Code

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

avatar
Register or

Likes

avatar avatar avatar avatar
Related users ' posts
Gaspare Ciao Ivan si puo' inserire una strategia su questo indicatore per ottimizzare le variabil...
Regisnew Bonjour Ivan serait il possible de proposer un screener pour détecter les zones de support v...
bembel242 Hello Ivan ! A belated HNY ! I know late ! Quick question on theis great indicator plse. I u...
gp38super Wow! This is GOLD! Great job!
Bernard13 (Je réécris mon commentaire -français- en français car certains mots ne correspondaient pas ...
Iván 1000 indicateurs !!! brutaux
Iván Gracias! Para el screener sólo tienes que copiar el indicador y poner como condición de búsq...
Lean Muchas gracias Iván, ya lo he podido crear.
bertoluce Hello Ivan, thank you very much for the indicator. An observation: would it be possible (and...
lee Thank you!
Iván Hi We could find stocks with sweep on: //PRC_Sweep Institucional //version = 0 //28.0...
inverse Like the way you think Ivan ... :)
ar Bonjour Ivan et merci pour ton partage, Est-il possible d'avoir ce code en ITF
jacquesgermain sì da aggiungere
Maik2404 auf welchen Wert muss ich die Kompresionsperiode stellen?
jacquesgermain — Période de compression : ce paramètre détermine la période de rétrospection utilisée pour ...
Bateson
2 years ago
Matriciel Very nice job ! Is it possible to do the opposite because what interests me is to have the ...
YvesRobert Hi Matriciel, how can we do this, because stochastic is limited between 0 and 100 but price ...
Traderfox06 Dear zeiiermantrading, I really like your approach combining adaptive averages with MACD in...
jacquesgermain Hello IASD it's normal , when this occurs, uncheck RSI and MFI line and click then the MAC...
emiliobercial Thank you very much for sharing!
Carlose estoy de acuerdo con IASD Esta muy bien el MAD y el indicador en el precio no se ven bien...
bousalahane merci pour le partage de cet l'indicateur, j'ai rajouté un autre indicateur pour faire une s...
joaoarcher Hi, thank you for the this. Is it possible to create a screener from this indicator, so that...
KumoNoJuzza Thanks. I did not know IG had Futures. I am always missing an info or a detail. I used to th...
joaoarcher Hi, thank you for the this. Is it possible to create a screener from this indicator, so that...
superfalcio Last very good gain of the system: positions on Eurostoxx50 closed yesterday friday 06/12/2024.
Nicolas
2 years ago
3 RSI
3 RSI
2
Indicators
Violet Nicolas, you calculate iRSI, but don't use it. You show RSI in the returned values, which, a...
Nicolas Yes, that's an error. RSI instruction is set by default to 14 if you don't indicate it that'...
DELBERT Bonjour , Nicolas , je voudrais installer cet indicateur sur ma PRT , version 10.3 , mais je...
Nicolas En effet, il faut à minima une version 11. La 10.3 est tellement ancienne maintenant.. Je pe...
DELBERT Bonjour , Nicolas , merci pour ta réponse , je fais un essai et je verrais . Salutations .
Khaled Thank you Nicolas! Looks like TDI (Trader Dynamic Index). Interesting to give Exit Signal as...
Nicolas ColorBetween is an instruction added last year: https://www.prorealcode.com/documentation/co...
finplus Bonjour, serait-il possible de remplacer l'écart formé par les bandes de Bollinger par l'ATR...
YvesRobert Hi smp, how should I configure this indicator because everything is at zero -> High, Clos...
smp Hi, this is an end of day pivots indicator, so you need to find the end of day pivot info; t...
YvesRobert Thank you smp.
smp I also have an End Of Day (EOD) cash pivot indicator for use on cash markets; this indicator...
cdc.andersson Hej! Jag försöker lära mig att koda PRT. Jag vill testa en strategi med RSI-värde, ATR-värde...
Swingforfortune Du kan väl jämföra om open > close (röd) eller open < close (grön)

Top