Linear Regression Statistics

Linear Regression Statistics

Regression channel: this ProRealTime script is designed to generate a linear regression channel and perform several analytical determinations based on this regression.

Here’s a complete analysis and explanation of the code:

  1. **Parameter definition** : The script begins by defining the parameters of the regression channel, such as channel type, deviation multiplier and drawing colors.
  2. **Regression calculations**: it uses a “for” loop to calculate the sums of price (sumy), time (sumx) and their respective products and squares needed to compute the slope (b ) and y-intercept (a) of the linear regression line.
  3. **Draw the regression line**: Once “a” and “b” have been determined, a segment is drawn to represent the regression line.
  4. **Calculate channel width** : The channel width is determined by the standard deviation or standard error multiplied by a deviation factor “NbDeviation”.
  5. **Draw channel**: The script draws the upper and lower limits of the channel, as well as the median line. Green triangles suggest bullish zones and red bearish zones, indicating buy and sell zones.

 

 

 

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 avatar avatar avatar
Related users ' posts
kats Bonjour, J'ai une question etes vous trader? Je m'explique , j'ai téléchargé tous les indi...
kats BONSOIR c bon merci j ai trouve ce weekend merci de votre reponse cdlt
the_giorgio Hi, nice work I would like to understand something about prorealtime code. With your ...
Iván Hello. When you use the drawcandle() instruction then in the configuration window you add ...
Iván sería así //------------------Inputs------------------------------ linreglength = 11//i...
Doddge Muchísimas gracias Iván, está genial.
superfalcio holaaa, have you run some statistics?
jacquesgermain sì da aggiungere
Maik2404 auf welchen Wert muss ich die Kompresionsperiode stellen?
jacquesgermain — Période de compression : ce paramètre détermine la période de rétrospection utilisée pour ...
Msport71 Thank You very much
luxrun A question: what are the initial (or default) values ​​of maximum and minimum in the executi...
Quino
12 months ago
Alai-n I really like it when you develop ideas around price movement! I am much less a fan of all t...
elcortijoverde Muy buen trabajo.Intuitivo y claro.Gracias por tu dedicación y aportación.
Nicolas change the last line with: return v coloured(r,g,b) style(line,2), v+band coloured(168,168,1...
Paolo.B Thanks ... works as i wanted.
Kanamax Bonjour Nicolas, comme Paolo.B je souhaiterais utiliser cette indicateur au sein d'un code. ...
Daniele Maddaluno Écrivez-moi où vous préférez you can easily find me on LinkedIn
AK27 C'est payant visiblement sur linkdin je peux pas vous envoyer, discord vous avez ?
Nicolas Please open a topic in ProScreener forum with your query, I'll reply you there. Thank you.
manafull Thanks Nicolas, I post my question, along with the codes I am trying to convert from your in...
Nicolas I replied to your post here: https://www.prorealcode.com/topic/screener-for-rsi-and-linear-r...
Fabian Hi IV Mcm, have you drawn the rectangles (Dinamic, Range) by yourself in the chart or are...
IV Mcm Myself to illustrate ;)

Top