RSI and Linear Regression trading signals

v10.3
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:
    https://www.abcbourse.com/analyses/chronique-80_de_taux_de_reussite_sur_le_cac_40_en_15_ans-203.
    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: https://www.prorealcode.com/prorealtime-indicators/rsi-self-adjusting-bands/

  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: https://www.prorealcode.com/topic/infinite-loop-issue/#post-146094

  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 • 299 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 • 298 days ago #

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

  12. manafull • 296 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 • 296 days ago #

      I replied to your post here: https://www.prorealcode.com/topic/screener-for-rsi-and-linear-regression-trading-signals/#post-218189

avatar
Register or

Likes

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

+3 more likes

Related users ' posts
Kosuda76 Thanks for your reply! But I do not really understand what the opposite of them the values ​...
AdriTrade Good job Louis!! How could do this for the Williams indicator? Thank you very much.
imorandin Hi!, Nice code. I'm tryng to port it to another language, but I don't understand this part:...
luxrun Thanks, bolsatrilera, for a very good and solid screener!
luxrun sorry... indicator!
Lily Rios Gracias por el indicador, tengo una pregunta necesito programar un screener de valores que e...
Nicolas S11 variable is not a loop but a ratio calculation. In real time the codes is processed on e...
Stephan_V Nicolas, This regression delivers damn good results, especially for trends ! I'm wonde...
Nicolas Least square method is used here in order to get the perfect y = ax2 + bx + c
Bebbo Grazie del prezioso contributo Nicolas, scusa la mia inesperienza, sono alle prime armi e s...
Nicolas To avoid recalculation, you should use the one from this post.
Bebbo Ok Grazie Nicolas.
bolsatrilera
6 years ago
jissey Bonjour Bolsatrilera, je trouve le cm rsi interessant, merci de l'avoir mis à disposition ! ...
bolsatrilera bonjour jissey, je n'ai aucune information sur ce que tu dis, je suis désolé.
ALE Hi the color is given by a numerical value derived from the oscillator in use. If you comp...
efahmy Thanks mate
Jo-01-R Hello, it is possible to have this indicator but instead of colors rather have numbers rangi...
Canale di Fill By Filippo si si... farò un video a breve
AngelPujalt ok. Gracias.
Stenozar Hi Filippo, any news about your video to explain how to use this indicator? thanks
Domenec Claro Juanjo de todas maneras en deinversoratrader.com tienes estsos osciladores evolucionad...
Dron Hola Domenec, en la descripción hablas del indicador velas de colores, no lo encuentro en la...
Domenec Hola Dron mira en el blog deinversoratrader.com en formacion indicadores ahi hay varios grat...
Marcot18 Buonasera Maurinho, interessante l'indicatore che ha i proposto ma ancora di più interessant...
maurinho ciao marcot18 l'indicatore pubblico /proffessional lo puoi scaricare si chiama progo di will...
james effiong This strategy looks good
Nicolas
6 years ago
enricot Scusa nn riesco.
SoloContado If you smooth the signal using a "summation" function, you get a nice "crossing of 0" graph....
ShaunG Greatly appreciated Nicolas!
Geronima Ortiz okay bien estaré pendiente en esta pagina gracias
Domenec Aqui dejo colgado link del video para ver como funciona el indicador https://www.youtube....
Geronima Ortiz Gracias Domenec
Etienne Hi, thanks for proving this code. I would like to contribute by adding a computation speed...
Etienne //Compute Super Smoother coefficients once if barindex = 1 then a1 = exp( -1.414 * 3.14159...
Nicolas Thanks a lot!
ak5hay2 Works like crazy on bitcoin. Use different timeframes. Thanks a lot Doc!!!
richyowen Hi, great code thanks. Very new to this forum. Is there a way to add a 100point target on an...
lisamitch50 Morning all, Just backtested on quite a few instruments, worked well on backtesting, but tel...
Matriciel
6 years ago
Alai-n Thanks...
Bard Thanks for sharing this Verdi55. More instructions from Larry Williams website (and a fea...

Top