REGRESSION LINEAIRE + FIBONACCI
Forums › ProRealTime forum Français › Support ProBuilder › REGRESSION LINEAIRE + FIBONACCI
- This topic has 9 replies, 3 voices, and was last updated 6 months ago by Msport71.
-
-
05/20/2024 at 10:44 AM #232803Regression Lineaire Nico1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556//PRC_Std and Ste LinRegChannel | indicator//Standard Deviation and Standard Error//Linear Regression Channel//12.03.2019//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledgedefparam drawonlastbaronly=truedefparam calculateonlastbars=1000// --- settings//lookback= 200 //channel period//ChannelType = 1 //1= Standard Deviation ; 2= Standard Erro//NbDeviation = 1 //Deviation multiplier//colorRed = 255//colorGreen = 255//colorBlue = 0// --- end of settingssumx = 0sumy = 0sumxy = 0sumx2 = 0for cmpt = lookback downto 0 dotmpx = cmpttmpy = close[cmpt]sumy = sumy+tmpysumx = sumx+tmpxsumx2 = sumx2 + (tmpx*tmpx)sumxy = sumxy + (tmpy*tmpx)nextn = lookback+1if (sumx2 = sumx * sumx) then // protection to avoid infinite valuesb = sumxy - sumx * sumyelseb = (n * sumxy - sumx * sumy) / (n * sumx2 - sumx * sumx)endifa = (sumy - b * sumx) / ndrawsegment(barindex[lookback],a+b*lookback,barindex,a+b*0) coloured(colorRed,colorGreen,colorBlue)///////////////////////////////////////////channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationelsedat = ste[lookback]*NbDeviationendif///////////////////////////////////////////////////drawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured(colorRed,colorGreen,colorBlue)drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured(colorRed,colorGreen,colorBlue)return customclose as "customclose"
Bonjour à tous,
Après recherche sur le site j’ai trouvé ce code crée par Nicolas sur un canal de régression linéaire, j’aimerai le transformer à partir de la ligne principale
et y ajouter les ratios de Fibonacci au dessus et en dessous (23.6-50-61.8-76.4) en place des lignes existantes.
Merci à qui voudra bien aider.
Bonne journée
05/20/2024 at 2:07 PM #232817Hola, tu réponds à cela ?
1234567891011121314151617181920212223defparam drawonlastbaronly=truedefparam calculateonlastbars=1000// --- settingslookback= 200// --- end of settingsx1=barindex[lookback]y1=lowest[lookback](low)x2=barindexy2=highest[lookback](high)drawsegment(x1,y1,x2,y1) coloured("black")drawsegment(x1,y2,x2,y2) coloured("black")//------------fibTotal=y2-y1lev236=y2-(fibTotal*0.236)lev382=y2-(fibTotal*0.382)lev50=y2-(fibTotal*0.500)lev618=y2-(fibTotal*0.618)//-------------drawsegment(x1,lev236,x2,lev236) coloured("black")style(dottedline2)drawsegment(x1,lev382,x2,lev382) coloured("black")style(dottedline2)drawsegment(x1,lev50,x2,lev50) coloured("blue")style(dottedline2)drawsegment(x1,lev618,x2,lev618) coloured("red")style(dottedline2)return05/20/2024 at 5:14 PM #232833Bonsoir Ivan,
Merci pour le code mais il ne correspond pas du tout à ce que je souhaite , j’aimerais avoir des lignes parallèles à la RL principale à 23.6%,38.2% etc au dessus et en dessous de cette Regression Linéaire principale.
je joins une photo du code fourni
hasta pronto amigo !
05/21/2024 at 8:12 AM #232846D'accord. Donc, si nous pouvons faire le niveau 0% de la ligne supérieure du canal et le niveau 100% de la ligne inférieure, le code tendra à être le suivant :
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657//PRC_Std and Ste LinRegChannel | indicator//Standard Deviation and Standard Error//Linear Regression Channel//12.03.2019//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledgedefparam drawonlastbaronly=truedefparam calculateonlastbars=1000// --- settingslookback= 200 //channel periodChannelType = 1 //1= Standard Deviation ; 2= Standard ErroNbDeviation = 1 //Deviation multipliercolorRed = 255colorGreen = 255colorBlue = 0// --- end of settingssumx = 0sumy = 0sumxy = 0sumx2 = 0for cmpt = lookback downto 0 dotmpx = cmpttmpy = close[cmpt]sumy = sumy+tmpysumx = sumx+tmpxsumx2 = sumx2 + (tmpx*tmpx)sumxy = sumxy + (tmpy*tmpx)nextn = lookback+1if (sumx2 = sumx * sumx) then // protection to avoid infinite valuesb = sumxy - sumx * sumyelseb = (n * sumxy - sumx * sumy) / (n * sumx2 - sumx * sumx)endifa = (sumy - b * sumx) / n///////////////////////////////////////////channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationelsedat = ste[lookback]*NbDeviationendif///////////////////////////////////////////////////drawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured(colorRed,colorGreen,colorBlue)//0%drawsegment(barindex[lookback],(a+b*lookback)+0.528*dat,barindex,a+b*0+0.528*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("orange")//23.6%drawsegment(barindex[lookback],(a+b*lookback)+0.236*dat,barindex,a+b*0+0.236*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("green")//38.2%drawsegment(barindex[lookback],a+b*lookback,barindex,a+b*0) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("blue")//50%drawsegment(barindex[lookback],(a+b*lookback)-0.236*dat,barindex,a+b*0-0.236*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("red")//61.8%drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured(colorRed,colorGreen,colorBlue)//100%return customclose as "customclose"05/21/2024 at 3:14 PM #232875Hola Ivan,
Eso no es el codigo que quiero , lo siento.
Je te joins l’image de ton dernier code et l’image de ce que je souhaite, j’ai du mal m’exprimer.
Voyons cette fois çi
merci pour ta patience.
Te adjunto la imagen de tu último código y la imagen de lo que quiero, tengo problemas para expresarme. Veamos esta vez gracias por su paciencia.
05/29/2024 at 10:11 AM #233199Bonjour Ivan,
Je crois que tu m’a oublié au milieu de ta masse de travail importante.
J’ai vu que tu as créer récemment un code pour Gustavobp avec une moyenne et des Fibonacci au dessus et en dessous, c’est ce que je souhaiterais
en partant d’une droite de régression linéaire, vu de ma fenêtre cela semble possible?
merci de me dire si c’est jouable ou pas.
je joins un graphe pour illustrer ma demande.
bonne journée.
05/29/2024 at 11:15 AM #233208Holà. Je ne m'en suis pas rendu compte… Simplement, je demande aux intentions de changer les multiplicateurs de suffire.
1234567891011drawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured(colorRed,colorGreen,colorBlue)drawsegment(barindex[lookback],(a+b*lookback)+0.618*dat,barindex,a+b*0+0.618*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("green")drawsegment(barindex[lookback],(a+b*lookback)+0.5*dat,barindex,a+b*0+0.5*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("green")drawsegment(barindex[lookback],(a+b*lookback)+0.382*dat,barindex,a+b*0+0.382*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("green")drawsegment(barindex[lookback],(a+b*lookback)+0.382*dat,barindex,a+b*0+0.236*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("green")drawsegment(barindex[lookback],a+b*lookback,barindex,a+b*0) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("blue")drawsegment(barindex[lookback],(a+b*lookback)-0.236*dat,barindex,a+b*0-0.236*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("red")drawsegment(barindex[lookback],(a+b*lookback)-0.382*dat,barindex,a+b*0-0.382*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("red")drawsegment(barindex[lookback],(a+b*lookback)-0.5*dat,barindex,a+b*0-0.5*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("red")drawsegment(barindex[lookback],(a+b*lookback)-0.618*dat,barindex,a+b*0-0.618*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("red")drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured(colorRed,colorGreen,colorBlue)05/30/2024 at 10:15 AM #233270Hola Ivan,
Muchas gracias por el codigo, il y a une petite faute dans ton dernier post ligne 54 : on doit remplacer 0.382 par 0.236, sinon le code est top
ce que je souhaitais, j’espère qu’ils profitera à la communauté.
bonne journée à tous.
Droite de Regression Lineaire + Fibonacci1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162//PRC_Std and Ste LinRegChannel indicator//Standard Deviation and Standard Error//Linear Regression Channel //12.03.2019//Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge// Modifié par IVAN le 30.05.2024 (Fibo)defparam drawonlastbaronly=truedefparam calculateonlastbars=1000// --- settingslookback= 200 //channel periodChannelType = 1 //1= Standard Deviation ; 2= Standard ErroNbDeviation = 1 //Deviation multipliercolorRed = 255colorGreen = 255colorBlue = 0// --- end of settingssumx = 0sumy = 0sumxy = 0sumx2 = 0for cmpt = lookback downto 0 dotmpx = cmpttmpy = close[cmpt]sumy = sumy+tmpysumx = sumx+tmpxsumx2 = sumx2 + (tmpx*tmpx)sumxy = sumxy + (tmpy*tmpx)nextn = lookback+1if (sumx2 = sumx * sumx) then // protection to avoid infinite valuesb = sumxy - sumx * sumyelseb = (n * sumxy - sumx * sumy) / (n * sumx2 - sumx * sumx)endifa = (sumy - b * sumx) / n///////////////////////////////////////////channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationelsedat = ste[lookback]*NbDeviationendifdrawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured(colorRed,colorGreen,colorBlue)drawsegment(barindex[lookback],(a+b*lookback)+0.618*dat,barindex,a+b*0+0.618*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("green")drawsegment(barindex[lookback],(a+b*lookback)+0.5*dat,barindex,a+b*0+0.5*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("green")drawsegment(barindex[lookback],(a+b*lookback)+0.382*dat,barindex,a+b*0+0.382*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("green")drawsegment(barindex[lookback],(a+b*lookback)+0.236*dat,barindex,a+b*0+0.236*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("green")drawsegment(barindex[lookback],a+b*lookback,barindex,a+b*0) coloured(colorRed,colorGreen,colorBlue)style(dottedline,5)coloured("blue")drawsegment(barindex[lookback],(a+b*lookback)-0.236*dat,barindex,a+b*0-0.236*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("red")drawsegment(barindex[lookback],(a+b*lookback)-0.382*dat,barindex,a+b*0-0.382*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("red")drawsegment(barindex[lookback],(a+b*lookback)-0.5*dat,barindex,a+b*0-0.5*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("red")drawsegment(barindex[lookback],(a+b*lookback)-0.618*dat,barindex,a+b*0-0.618*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,2)coloured("red")drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured(colorRed,colorGreen,colorBlue)Return05/30/2024 at 11:03 AM #23327606/03/2024 at 2:56 PM #233450 -
AuthorPosts
Find exclusive trading pro-tools on