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
Zigo
5 years ago
fifi743 Good morning, there is no mistake about the shorts c11=SMI[14,3,5](close)>-40
Zigo has to be c11=SMI[14,3,5] < -40 (indeed)
xar3 Thank you ;-) Zigo
Sapo Thank you very much. as always your indicators are extremely effective. kind regards Vonasi.
mitsu21 Hi, it looks nice. I'll try it tomorrow thank you for your share kind regards bruno
kj1988 Thank you Vonasi for sharing this indicator. Very useful as a comfirmation to the price act...
Bard Very interesting approach Vonasi! I'm getting a 404 error when trying to download though?
Vonasi I just tested and I was able to download with no error.
Psari Hi Vonasi, I am a newbie and was wondering whether you could possibly help me with this pro...
Vinks_o_7 Thanks again Vonasi !
Bard Thank you, this is a great tool @Vonasi, especially for those that used to like shorting Ind...
Aragorna Hi Vonasi, is there a reason why it does not work anymore in new version ePRT Platform? tha...
sycomore Ça ne fonctionne sur aucune valeur, je dois être trop con...
Nicolas il faut appliquer l'indicateur sur le prix.
AntoGH Je crains de ne pas comprendre... Cela indique la probabilité de la prochaine bougie ou donn...
ggolfet Thanks Nicolas, I imported the itf file and solved the problem.
Hasardeur Hallo Nicolas, i tried to code the multi period heat map in combination with the Ehler’s ...
Nicolas Please open a new topic with the code in forum.
Marie-Eve Vergoz lorsque je copie les codes, le système me signale des erreurs à la ligne 12 et suivantes
Marie-Eve Vergoz sorry - tout est ok -
AlgoAlex
6 years ago
Marcot18 Alex ti sei superato
AlexF Esagerato!
jobswaps Sube como trazar lineas de tendencias a tantas barras
Frankiesc interesting indicator !! Thanks for sharing!!!
robertogozzi Thank you :)
Vonasi Yes that was the issue. I have posted an updated ITF file here: https://www.prorealcode.com/...
crolakstrading @vonasi Thank you for fixing the issue! This is a great indicator.
gregoire good evening vonasi , I had made the request to create this indicator a few years ago and I ...
tobytarczy Hi Vonasi, Sounds lovely, I race yachts around europe myself. Most regattas cancelled unfor...
mlouys Hello Vonasi thank for your work ! A question how can we do it for minutes ( or 15 min or x ...
Vonasi I think that would be possible but probably in a whole new indicator as detecting when a new...
JJ Tec Hola Las condiciones de entrada / salida vienen en el libro de J. Carter Mastering the trad...
Pixeldd Ich bekomme beim einfügen des Indikators einen Fehler angezeigt. Was bitte muss ich genau än...
HarryPro Hello, Firtly there appears to be a typo on line 6 "lenghkc=20" should this be "lengthkc=...
sir_i Bonjour à tous, Je suis nouveau sur le forum et sur la plateforme, pourriez-vous me dire com...
Nicolas Il faut simplement l'appliquer sur le prix.
sir_i Merci pour la réponse, je ne suis pas familier avec l'application de cette procédure simple,...
Nicolas Il s'agit d'un indicateur compatible avec PRT v11 uniquement. Pour éviter les erreurs de cop...
Sébi Intéressant. Merci pour ce partage Nicolas. L'indicateur ne considère pas les divergences ...
Nicolas ok, pour les divergences chacun voit midi à sa porte je dirai :) Vu qu'il n'y a pas de formu...
mcha merci bien et félicitations pour la réactivité avec laquelle il a été mis dans la bibliothèq...
soulintact Great indicator Nicolas, thanks!
cdc.andersson Hello, when trying to include this wonderful Dynamic RSI on my trading system i get the erro...
Rafyone Bonjour Nicolas et bonne année lol J'ai une erreur qui apparait concernant drawbarchart une...
Nicolas Je pense que tu n'utilises pas le bon éditeur de code, cette instruction est compatible uniq...
Exalaxe Hey, i just noticed you optimized this strategy. Could i see your new version, please?
Andrea.1981 sorry i add my code but it not enter why i dont know
Andrea.1981 this is code simply stop , and you can see another version for stop / Codice principale...
AntoGH how did you backtest it ?
PastaPesto @AntoGH , I dont know if you are asking me, but my backtest was made in an IS of 4 years bet...
Ridder @PastaPesto Do you still running this and how is the results? Thanks

Top