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
Related users ' posts
Iván
2 weeks ago
2 Fast Two things stand out to me: I see a lot of horizontal blocks in the chart instead of vertica...
lkiklkik thanks for the hard work and sharing
sam00075 Accuracy is on point.
Mubin1308 Bonjour à tous, J'ai importé le fichier mais ça ne marche pas, rien qui s'affiche. Pourriez...
hdb1 Thank you so much Ivan..Been using this on 30min timeframe with excellent results. Now my ma...
Iván
3 months ago
NicoGB67 Hola Iván, en primer lugar agradecerte el trabajo que haces, y comentarte algo sobre este in...
okeus ok fatto avevi ragione, grazie
DLVx Hola Iván, unas de las limitaciones que identificas es la combinación del OBB con otros indi...
Iván
9 months ago
Madrosat Bonjour Ivan je ne sais pas si je dois écrire en Français ,anglais ,espagnol ,il y a les 3 ...
Iván Bonjour, la vérité est que ce n'est pas aussi facile qu'il n'y paraît.... Un indicateur peut...
Madrosat Merci Ivan j'espère que ce jour viendra bientôt , je sais que ce n'est pas facile car les in...
Patriot1972 Ciao Ivan, avevo bisogno di chiarimenti sul funzionamento del tuo indicatore: cosa segnala q...
luxrun grazie Ivàn!
lee Thank you. Is it possible to convert this to a screener that displays instruments when bulli...
Iván //---------------------------------------------------------------// //PRC_Pollan Indicator /...
Faisalx ChatGPT Hola Iván. Gracias por tu excelente trabajo. Te agradecería si pudieras echarle un...
Iván ok, perfecto! me pongo con ello
sam00075 Tried it the last two days, accuracy is impressive.
Razz Hello, thank you for your indicator. Can you please tell me how I can change the text size,...
Iván Hi! you have all information about it here (https://www.prorealcode.com/documentation/drawte...
Miro Mis felicitaciones por este indicador. Funciona muy bien en el corto plazo. Gracias gracias ...
marcov66 Holá Ivan! Complimenti per l´indicatore! Secondo te con la nuova V12 avendo ora a disposizio...
Iván Grazie! In realtà, anche se gli indicatori di cui parli sono presenti nella nuova versione, ...
marcov66 Infatti, il Volume profile, il POC, le VA il CVD sono finalmente disponibili su PRT V12. Sec...
Iván Hi, Sorry, but what do you mean?
luiskohnen Hola, queria saber si el indicador repinta, porque a mi me parecio que si. Saludos y gracias...
Diamant Bonsoir, L'un d'entre vous peut-il me donner les définissions de LL-HH-LH et HL. Merci d'av...

Top