Droite de régression linéaire plus 1 écart type
Forums › ProRealTime forum Français › Support ProBuilder › Droite de régression linéaire plus 1 écart type
- This topic has 25 replies, 5 voices, and was last updated 1 year ago by
ZeroCafeine.
-
-
06/24/2022 at 3:32 PM #196024
Bonsoir Smn
Sur prix : petit tableau à droite, configurer mettre les prix à l’échelle logarithmique
Merci Supertiti, j’avais bien vu cette possibilité, mais quand je l’active la droite de régression part en sucette 🙂
06/24/2022 at 5:32 PM #19604406/27/2022 at 3:39 PM #196223Bonjour Supertiti,
Alors, tu trouveras ci-joint la capture d’écran de la régression linéaire de Air Liquide.
lorsque je cherche à avoir la même chose avec ton code je n’y arrive pas. Est-ce que tu peux me dire si tu as le même problème et éventuellement pourquoi ?
Merci06/28/2022 at 9:09 AM #196263En effet c’est une échelle logarithmique, donc l’apparence de la régression ne sera pas la même.
1/ j’ai modifié un peu le code pour qu’il soit plus rapide au calcul:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354//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=trueif islastbarupdate then// --- settingslookback= max(1,barindex) //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) / ndrawsegment(barindex[lookback],a+b*lookback,barindex,a+b*0) coloured("red")//channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationelsedat = ste[lookback]*NbDeviationendifdrawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured("gray") style(dottedline2)drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured("gray") style(dottedline2)endifreturn2/ pour obtenir une régression linéaire sur votre graphique, il n’est pas obligatoire d’utiliser un code personnalisé, utilisez simplement l’outil de regression dans la plateforme (fonctionne sur échelle logarithmique) = voir image jointe.
06/28/2022 at 11:09 AM #196284Bonjour Nicolas,
J’ai voulu doubler les lignes de déviation comme je l’avais fais mais cette fois ci le systeme me dit :
“parametre entier avec STD” en place de loockback sur les lignes de “DAT2”
nota : a la ligne 48 il doit y avoir une coquille ?
Où est le bug dans mon code ?
merci de me dire, bonne journée
LINEAR REGRESSION CHANNEL V112345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061defparam drawonlastbaronly=trueif islastbarupdate then// --- settingslookback= max(1,barindex) //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) / ndrawsegment(barindex[lookback],a+b*lookback,barindex,a+b*0) coloured("red")//channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationelsedat = ste[lookback]*NbDeviationendifdrawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured("gray") style(dottedline2)drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured("gray") style(dottedline2)endif//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////lookback= max(1,barindex) //channel periodChannelType2 = 1 //1= Standard Deviation ; 2= Standard ErroNbDeviation2 = 2 //Deviation multiplier//channelif ChannelType2 = 1 then //Standard Deviationdat2 = std[lookback]*NbDeviation2elsedat2 = std[lookback]*NbDeviation2endifdrawsegment(barindex[lookback],(a+b*lookback)+dat2,barindex,a+b*0+dat2) coloured("gray") style(dottedline2)drawsegment(barindex[lookback],(a+b*lookback)-dat2,barindex,a+b*0-dat2) coloured("gray") style(dottedline2)return06/28/2022 at 11:33 AM #19628806/28/2022 at 11:46 AM #196289Trop complexe de reprendre ton code, voici le mien modifié avec 2 lignes de canal haute et basse.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859//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=trueif islastbarupdate then// --- settingslookback= max(1,barindex) //channel periodChannelType = 1 //1= Standard Deviation ; 2= Standard ErroNbDeviation = 1 //Deviation multiplierNbDeviation2 = 0.5 //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) / ndrawsegment(barindex[lookback],a+b*lookback,barindex,a+b*0) coloured("red")//channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationdat2 = std[lookback]*NbDeviation2elsedat = ste[lookback]*NbDeviationdat2 = ste[lookback]*NbDeviation2endifdrawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured("gray") style(dottedline2)drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured("gray") style(dottedline2)drawsegment(barindex[lookback],(a+b*lookback)+dat2,barindex,a+b*0+dat2) coloured("gray") style(dottedline2)drawsegment(barindex[lookback],(a+b*lookback)-dat2,barindex,a+b*0-dat2) coloured("gray") style(dottedline2)endifreturn06/28/2022 at 11:48 AM #196291Et voilà :
Linear Regression Channel V11234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768// LINEAR REGRESSION CHANNEL V1 by Nicolas 28 juin 2022// LINEAR REGRESSION CHANNEL V1 by Nicolas 28 juin 2022// graphe style LINEAIREdefparam drawonlastbaronly=trueif islastbarupdate then// --- settingslookback= max(1,barindex) //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) / ndrawsegment(barindex[lookback],a+b*lookback,barindex,a+b*0) coloured("white")style(line,5)//channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationelsedat = ste[lookback]*NbDeviationendifdrawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured("yellow") style(line,2)drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured("yellow") style(line,2)endif/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////drawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured(colorRed,colorGreen,colorBlue)style(line,3)lookback2= max(1,barindex) //channel periodChannelType = 1 //1= Standard Deviation ; 2= Standard ErroNbDeviation2 = 2 //Deviation multiplier//channel 2if ChannelType = 1 then //Standard Deviationdat2 = std[lookback2]*NbDeviation2elsedat2 = ste[lookback2]*NbDeviation2endifdrawsegment(barindex[lookback2],(a+b*lookback2)-dat2,barindex,a+b*0-dat2) coloured (0,255,8)//(colorRed,colorGreen,colorBlue)drawsegment(barindex[lookback2],(a+b*lookback2)+dat2,barindex,a+b*0+dat2) coloured (255,9,0)//////////////////////////////////////////////////////////////////////////////////////////////////////////return customclose as " Linear regression channel V1 "06/28/2022 at 3:56 PM #19632206/29/2022 at 8:27 AM #19635303/23/2023 at 10:47 AM #211981Bonjour tout le monde,
Je suis tombé sur ce sujet par hasard, je n’ai pas eu le temps de tout lire mais j’ai cliqué sur le lien de la vidéo et regarder un petit peu en accéléré,
Je dirais encore un vendeur de formation, j’ai lu pas mal de bouquins de bourse et je continue toujours mon apprentissage et mon petit retour d’expérience c’est que les prix ne suivent pas une loi normale donc on ne peut pas utiliser une courbe gaussienne et donc tous les gens qui rabâche que le prix est à 95 % inclus dans deux écart-types et ben ils disent n’importe quoi c’est plutôt environ 86 % pour deux écarts (j’ai trouvé cette information dans le livre de Bollinger et de Philippe Cayenne)
Je respecte bien toute personne qui donne du savoir, dans certaines cultures on dit : un professeur a presque la même place qu’un prophète, et bien d’autres citations de personnes célèbres comme Einstein
Moi la dernière que j’ai apprise d’un très très bon ami très rigolo c’est : quand on sait pas faire et ben on l’enseigne 🤣
Attention je ne vise personne c’est juste pour rigoler un petit peu
-
AuthorPosts
Find exclusive trading pro-tools on