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?

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

  1. Demon • 09/25/2020 #

    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 • 09/25/2020 #

      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 • 09/25/2020 #

    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 • 09/25/2020 #

      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 • 09/25/2020 #

    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 • 09/25/2020 #

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

  4. bearbull • 09/25/2020 #

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

    • Nicolas • 09/25/2020 #

      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 • 09/25/2020 #

    Thank you sir!!

  6. bearbull • 09/25/2020 #

    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 • 09/25/2020 #

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

    • Nicolas • 09/25/2020 #

      email notification are not available for custom indicators.

  8. HappyBunny • 09/25/2020 #

    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 • 09/25/2020 #

      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 • 09/25/2020 #

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

    • Nicolas • 09/25/2020 #

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

  10. DonTony • 09/25/2020 #

    Bonjour Nicolas,
    Très bel indicateur! Bravo!

  11. manafull • 303 days ago #

    Awesome work Nicolas! By any chance, do you have the Screener version for this “RSI and Linear Regression trading signals”. I tried to convert the indicator to screener by replacing the drawing at the end i.e. “SCREENER[Signal](Signal AS “1=↑, 2=↓”)”, where I use the Signal =1 or 2 to replace the two condition of drawing in the codes … but at the end I always get the error “Syntax error: This variable is not used in the {did not show any further info}”. It would complete your indicator perfectly if you can add the screener here for us. Thank you and Best regards.

    • Nicolas • 302 days ago #

      Please open a topic in ProScreener forum with your query, I’ll reply you there. Thank you.

  12. manafull • 300 days ago #

    Thanks Nicolas, I post my question, along with the codes I am trying to convert from your indicator, in the ProScreener Forum… So please review there. Thanks again.

    • Nicolas • 300 days ago #

      I replied to your post here:

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+3 more likes

Related users ' posts
kats j ai fait une copie d'ecran mais je ne sais pas comment l'envoyer sur le site
luiskohnen This indicator re-paint?
Iván Hi, Sorry, but what do you mean?
P. Marlowe Quite an impressive work, Iván. Extremely useful and accurate. Congratulations. Keep it up¡
lkiklkik i love it !!! thanks.
Lean Me parece muy buen indicador, y se complementa muy bien en mi sistema, ¿podrías crear un scr...
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.
Iván sería así //------------------Inputs------------------------------ linreglength = 11//i...
Doddge Muchísimas gracias Iván, está genial.
superfalcio holaaa, have you run some statistics?
Msport71 Thank You very much
6 months 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...
FXtonio Nicolas.... MERCI 1 millions de fois, cet indicateur gagne dans 75% des cas en scalping m1 ...
davy42 bonjour, à quel moment apparait le fleche, à l'ouverture ou la fermeture de la bougie? merci
Freezer Bonjour, est-il possible d'ajouter une alarme sonore sur PRT à l'apparition des flèches ? Br...
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...
10 months ago
Anthony2A Bjr, j ai des erreurs sur la ligne 69, 74, 78 et 80. sur drawcandle drawtext et endif. si ...
Lucas0000 Hello, Congratulations on this programming, it seems incredible to me, I am new to this but ...
plbourse Hello, I am trying to use this singal (in fact I have converted it to an indicateur giving B...
ThaNoizy Yes, you cannot use CFDs on IG for Weekly strats you need to use their Index Futures, they h...
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...
FXtonio @RICOU en 1 minutes avec un filtre de tendance ZLSMA 200 et eventuellement un rsi 7 , 69% de...
JC_Bywan For people interested in the screener:
octum Gracias NJicolas. Las lineas 35 y 36 dan fallo. (¿Es adrede para iniciados?) Puedes co...
1 year ago
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'...
Nicolas Je ne rencontre pas ce problème avec le NASDAQ par exemple, ce serait plus simple d'ouvrir u...
YvesRobert Bonjour Nicolas, en effet ca marche, je me suis trompé, j'ai bien tout le tracé. C'est parce...
oliTR Bonjour, les conditions longCond et shortCond ne contiennent-elles pas une condition qui s'a...
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: