Linear Progression Slope code
Forums › ProRealTime English forum › ProBuilder support › Linear Progression Slope code
- This topic has 7 replies, 4 voices, and was last updated 8 months ago by PeterSt.
-
-
03/18/2024 at 7:31 PM #229975
Hello, can someone tell me how the “Linear Regression Slope” indicator is calculated in ProRealTime? I tried following the indicator description instructions, but I am getting different values…
03/19/2024 at 4:35 PM #230049Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.Thanks 🙂
I moved it from the Italian forum.
Which indicator?
03/19/2024 at 4:52 PM #230051Ah, ok, scusatemi… credevo che l’inglese fosse un po’ la lingua “universale” del Forum….Comunque, parlavo della “Pendenza di Regressione Lineare”, io ho provato a ricostruire l’indicatore servendomi della seguente formula:Slope = (N * Sum(xy) – Sum(x) * Sum(y)) / (N * Sum(x^2) – (Sum(x))^2)ma non sono riuscito ad ottenere alcunchè, oppure ottengo valori sballati, per cui volevo sapere qual è il codice applicato su Prorealtime per ottenere il suddetto indicatore.Grazie in anticipo.Ah, ok, sorry… I thought that English was somewhat of the “universal” language of the Forum….
However, I was talking about the “Linear Regression Slope”, I tried to reconstruct the indicator using the following formula:
Slope = (N * Sum(xy) – Sum(x) * Sum(y)) / (N * Sum(x^2) – (Sum(x))^2)
but I wasn’t able to get anything, or I get incorrect values, so I wanted to know what code is applied on Prorealtime to obtain the aforementioned indicator.
Thanks in advance.
03/19/2024 at 6:55 PM #230066Hi Brian,
Try this one:
Linear Regression Slope (JS)12345678910111213141516171819Sumx=0Sumy=0Sumx2=0Sumxy=0N=10For i=1 To Nx=iy=Close[i-1]Sumx=Sumx+xSumy=Sumy+ySumx2=Sumx2+(x*x)Sumxy=Sumxy+(x*y)NextSlope=(N*Sumxy-Sumx*Sumy)/(N*Sumx2-(Square(Sumx)))*-1Return Slope1 user thanked author for this post.
03/20/2024 at 7:35 AM #23007403/20/2024 at 5:39 PM #230140Sorry, but i don’t understand if i must write in italian or english… however, thank’s a lot for your helping.
03/20/2024 at 6:32 PM #230154Read the basic rules highlighted in yellow below.
Choose the correct language forum and stick to it, using only that language.
You chose the Italian forum but you used the English to write your first post. I then switched it to the English forum.
Use only the English language here.
Should you create a new topic you may choose any one of the supported languages, but then stick to it, please 🙂
03/21/2024 at 12:47 AM #230166You chose the Italian forum but you used the English to write your first post. I then switched it to the English forum.
Which is a most unclear thing to do. Please don’t blame the user/customer. Instead blame yourself. Or at least don’t bash the user for it.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on