RSI and Linear Regression trading signals

RSI and Linear Regression trading signals

Trading signals based upon a linear regression channel applied to a classic RSI indicator.

If the RSI exceeds the upper band, the price should reverse to its mean and therefore a sell signals is announced.

If the RSI breaks the lower band, the price should reverse to its mean and a buy signals is plotted on the indicator.

You can adjust the RSI period of calculation (with variable ‘len’) and the linear regression channel period with “period”. The upper and lower band spread can be adjusted with the “deviations” setting (default is a 2 times multiplier from the mean).


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?

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

  1. Demon • 61 days ago #

    On this way of exploiting the RSI, read the article by Samuel Rondot:
    Thanks .
    How can I made a difference betteen the high and low deviation?

    • Nicolas • 60 days ago #

      In this article, the author uses the standard deviation from the mean of the RSI, in this case this indicator is not the same, use this one instead:

  2. Abz • 58 days ago #

    Hello ,
    is it possible to use this in a MTF screener without getting this fault?

    This ProScreener market scan cannot be executed because there is an infinite loop within the program code.
    An infinite loop is a sequence of instructions which repeats itself endlessly when the code is executed. This may happen if:
    – the loop doesn’t have a termination condition
    – the termination condition can never be met
    – the termination causes the loop to start over
    To run the scan, modify the code of your ProScreener.

    • Nicolas • 58 days ago #

      Sure, please open a new topic in the ProScreener section of the forum for that specific query. Please respect the posting rules also. Thanks.

  3. Sofitech • 52 days ago #

    I try to ad this indicator on DAX or EurUSD on M5 and on tick chart but nothing appears on the price chart. What can be the problem ?

    • Nicolas • 52 days ago #

      Try to expand the units displayed on your chart. Or use this simplified code which is the same:

  4. bearbull • 45 days ago #

    how would one incorporate an alarm at the buy/sell signal?

    • Nicolas • 45 days ago #

      Change the last line with: return irsi, a coloured(r,0,b) style(line,3) as “curve low”,c1 coloured(r,0,b) style(line,3) as “curve”, b coloured(r,0,b) style(line,3) as “curve high”,up,down
      and use the alert tool from the platform with “up” and “down” returned signals.

  5. bearbull • 45 days ago #

    Thank you sir!!

  6. bearbull • 45 days ago #

    Nicolas…….does this mean that I will now automatically have an alarm on every buy/sell signal? or will I have to manually reset it for every buy/ sell signal?

  7. bearbull • 45 days ago #

    ….also note in the alarm settings that for this indicator you cannot get an email email notification?

    • Nicolas • 44 days ago #

      email notification are not available for custom indicators.

  8. HappyBunny • 45 days ago #

    You are using variables “r” abd “b” for the color red and blue but unfortunately after setting r or b to 255, you reset b with
    b = startingPointY+deviation
    Do you rely on prorealcode knowing difference between integer b (255) and floating point b (deviation), or was this a mistake?

    • Nicolas • 44 days ago #

      good spot! indeed, that’s a mistake. Change the variable name for the b color, while I don’t think it would change the calculation result of the indicator itself.

  9. DIOS • 17 days ago #

    Bonjour Nicolas, comment coder un indicateur de rsi de Divergence? Merci pour ta réponse

    • Nicolas • 17 days ago #

      En apprenant la programmation 🙂 Plus sĂ©rieusement, il y a quantitĂ© d’exemples dans la library et dans les forums.

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Nicolas Oui, il peut être appliqué sur toutes les unités de temps et fonctionne sur prorealtime v11.
superprof salut merci pour ton indicateur. Pour bien comprendre , si suis acheteur Ă  quelle comment j...
Nicolas A discrétion, bon courage dans ton apprentissage du trading.
juanj Possible interpretation: Indicator tags 80 = Start of bullish trend, tags 20 = Start of bear...
Yann LB Bonjour, Ajout de as "level 95" en toute fin de code. ;-)
Madrosat I Have not see a fully functioning automated strategy on your site?? Really have you???
juanj Hi Madrosat, why would it be on my site? I have developed it for my personal use and also to...
Madrosat ok I understood you are using prorealcode to hack the fish
imonix Have been trying this on demo since Monday before deciding whether to go live with it. Using...
Roberto Blázquez I'm sorry, I've tried it since November 2012 and it's bad results.
Nicolas Code compatible only with version 11, as it is written in bold in the text of this post: Thi...
Albaran Ah I had hoped it was a problem unrelated to the version of prorealtime! We'll keep waiting ...
woktrade Superbe !
Vinks_o_7 Vonasi you're a beast !!! ;-)))
pableitor Amazing indicator , you are pushing PRT to the limit! But looking at the scatter its not c...
max-trading Bonjour, C'est bizarre, quand j'installe cet indicateur mon graphique des prix se resserr...
Nicolas Dans les paramètres du prix, il faut choisir la mise à l'échelle basée sur le prix uniquement.
Nick FX Junkie Good evening all, Is there any way this indicator can be transferred into a strategy code?
10 months ago
Wolf Compilation by sinusoid concept is very interesting. Thanks
groen200 Hi Zigo can you make backtest from this indicator
rosario Good evening I would like to understand why it doesn't work for me. Rosary
Denis Hello Nicolas, Thank you and congratulations for your work. The entry signals seem interes...
mia Bonjour j'arrive pas a integrer l'indicateur sur mt4 comment faire svp mercii
Nicolas Il ne s'agit pas d'un indicateur MT4, je vous suggère d'utiliser ProRealTime qui est une mei...
Dong Kobe THANK YOU Nicolas
leoulve Hello. I placed it on the price chart and nothing appear. Did I make a typical mistake? Merci
Nicolas No mistake, few signals.
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...
scarphace38 Bonsoir, je découvre PRT et je n'arrive pas a afficher le meme résultat pour l'indicateur de...
Dom Hello, commence le trading et découvre par la même occasion le ce n...
Nicolas Merci, ça fait plaisir !
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.
swapping Excellent Nicolas ;)
Violet Hi Nicolas, There seems to be a small error in the code, which causes the channel not to...
Nicolas Hmm, I don't think so, otherwise the channel will have a moving start and not anchored anymo...
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 -
1 year ago
Marcot18 Alex ti sei superato
AlexF Esagerato!
jobswaps Sube como trazar lineas de tendencias a tantas barras
mauro1966 BRAVO....
JackD I am getting a Syntex error when entering the code
MadBat How do you get this to work in PRT v11 ?
Nicolas Es ist in prorealtime v10.3 nicht möglich, sorry :) Wenn Sie v11 verwenden, können Sie mögli...
Gianluca Hello, is it possible to use this channel in a strategy? i tried to apply in a code but the ...
Nicolas Because this is indeed nothing more of what you describe. A mean with +/- standard deviation...