Screener Regression Linéaire plus Fibonacci
Forums › ProRealTime forum Français › Support ProScreener › Screener Regression Linéaire plus Fibonacci
- This topic has 13 replies, 5 voices, and was last updated 1 month ago by
supertiti.
-
-
07/23/2024 at 3:57 PM #235666RL + FIBO Ivan12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364// REGRESSION LINEAIRE DROITE + FIBONACCI by Ivan le 30.05.2024//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)style(line,4)coloured("yellow")drawsegment(barindex[lookback],(a+b*lookback)+0.618*dat,barindex,a+b*0+0.618*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,4)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,4)coloured("red")drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured(colorRed,colorGreen,colorBlue)style(line,4)coloured("yellow")Return customclose as " REGRESSION LINEAIRE + FIBO "
Bonjour à tous
J’aimerai à partir de ce code avoir un screener qui me renvoie :
condition 1 = la ligne de régression linéaire est supérieure à la ligne d’il y a 50 jours (canal haussier)
condition 2 = le prix du jour croise à la hausse la ligne basse du canal de régression linéaire
J’ai bien essayé mais je tourne en rond !
merci pour votre aide
07/23/2024 at 5:25 PM #235682Ici vous avez le code
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748// --- settingslookback= 200 //channel periodChannelType = 1 //1= Standard Deviation ; 2= Standard ErroNbDeviation = 1 //Deviation multiplier// --- 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// Conditions// Condition 1: Linear regression line above the line from 50 days agoregressiontoday = a + b * 0regression50daysago = a + b * 50condition1 = regressiontoday > regression50daysago// Condition 2: Price crosses above the lower channel linelowerchannelline = a + b * 0 - datcondition2 = close crosses over lowerchannellinescreener[condition1 and condition2]07/23/2024 at 5:44 PM #23568507/24/2024 at 12:38 PM #23571807/26/2024 at 5:49 PM #235815Bonjour à tous,
Le screener fonctionne bien mais j’aimerai réduire le nombre d’occurences , le système ne montrant que les 50 premiers résultats .
Comment faire pour avoir que les valeurs qui sont dans la moitié basse du canal.
Je joins une image de BNP, la zone voulue est celle de l’élipse verte claire.
bons trades.
07/26/2024 at 6:36 PM #235818Bonjour
changer la condition2 ainsi
condition2= close crosses over lowerchannelline remplacée par :
condition2 = close<(a + b * 0) et low>= ligne de canal inférieure
07/26/2024 at 10:38 PM #235823Bonjour, Supertiti, j’ai personnellement et humblement testé l’indicateur en rajoutant une flèche… et je pense que ça repeint car par exemple “ENPH” le 24/07/24 a donné un signal et aujourd’hui le 26/07/24 la flèche n’est plus apparaît… …
07/27/2024 at 10:24 AM #235829Bonjour
Non il ne repeint pas si votre flêche n’apparait plus c’est à cause de “defparam DRAWONLASTBARONLY=true”
voici ce que cela donne en modifiant l’indicateur
// REGRESSION LINEAIRE DROITE + FIBONACCI by Ivan le 30.05.2024
//PRC_Std and Ste LinRegChannel indicator
//Standard Deviation and Standard Error
//Linear Regression Channel //12.03.2019
//Nicolas @ http://www.prorealcode.com //Sharing ProRealTime knowledge
// Modifié par IVAN le 30.05.2024 (Fibo)
defparam calculateonlastbars=1000
//defparam DRAWONLASTBARONLY=true
// — settings
lookback= lookback//200 //channel period
ChannelType = 1 //1= Standard Deviation ; 2= Standard Erro
NbDeviation = 1 //Deviation multiplier
colorRed = 255
colorGreen = 255
colorBlue = 0
// — end of settings
sumx = 0
sumy = 0
sumxy = 0
sumx2 = 0
for cmpt = lookback downto 0 do
tmpx = cmpt
tmpy = close[cmpt]
sumy = sumy+tmpy
sumx = sumx+tmpx
sumx2 = sumx2 + (tmpx*tmpx)
sumxy = sumxy + (tmpy*tmpx)
next
n = lookback+1
if (sumx2 = sumx * sumx) then // protection to avoid infinite values
b = sumxy – sumx * sumy
else
b = (n * sumxy – sumx * sumy) / (n * sumx2 – sumx * sumx)
endif
a = (sumy – b * sumx) / n
/////////////////////////////////////////
//channel
if ChannelType = 1 then //Standard Deviation
dat = std[lookback]*NbDeviation
else
dat = ste[lookback]*NbDeviation
endif
if islastbarupdate then
drawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured(colorRed,colorGreen,colorBlue)style(line,1)coloured(0,0,155)
drawsegment(barindex[lookback],a+b*lookback,barindex,a+b*0) coloured(colorRed,colorGreen,colorBlue)style(dottedline,1)coloured(“blue”)
drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured(colorRed,colorGreen,colorBlue)style(line,1)coloured(0,0,155)
if fibo=1 then
drawsegment(barindex[lookback],(a+b*lookback)+0.618*dat,barindex,a+b*0+0.618*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,1)coloured(“green”)
drawsegment(barindex[lookback],(a+b*lookback)+0.5*dat,barindex,a+b*0+0.5*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,1)coloured(“green”)
drawsegment(barindex[lookback],(a+b*lookback)+0.382*dat,barindex,a+b*0+0.382*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,1)coloured(“green”)
drawsegment(barindex[lookback],(a+b*lookback)+0.236*dat,barindex,a+b*0+0.236*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,1)coloured(“green”)
drawsegment(barindex[lookback],(a+b*lookback)-0.236*dat,barindex,a+b*0-0.236*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,1)coloured(“red”)
drawsegment(barindex[lookback],(a+b*lookback)-0.382*dat,barindex,a+b*0-0.382*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,1)coloured(“red”)
drawsegment(barindex[lookback],(a+b*lookback)-0.5*dat,barindex,a+b*0-0.5*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,1)coloured(“red”)
drawsegment(barindex[lookback],(a+b*lookback)-0.618*dat,barindex,a+b*0-0.618*dat) coloured(colorRed,colorGreen,colorBlue)style(dottedline,1)coloured(“red”)
endif
endif
// Conditions
// Condition 1: Linear regression line above the line from 50 days ago
regressiontoday = a + b * 0
regression50daysago = a + b * 50condition1 = regressiontoday > regression50daysago
// Condition 2: Price crosses above the lower channel line
lowerchannelline = a + b * 0 – dat
condition2 = close crosses over lowerchannelline
if condition2 then
DRAWARROWUP(barindex,lowerchannelline)
endifReturn customclose as “Regression Linéaire+Fibonacci ”
07/27/2024 at 10:49 AM #2358311regressiontoday = a + b * 0je ne comprend pas ce calcul
regressiontoday = a suffit
je m’explique priorité a la multiplication b*0=0
donc a +0 =a1 user thanked author for this post.
07/27/2024 at 10:49 AM #235832Bonjour à tous,
merci Jacques pour ton aide le code fonctionne bien, je met la ligne en clair ci-dessous pour ceux qui comme moi on du mal avec le code
condition2 = close<(a + b * 0) and low>= lowerchannelline
@ FR7 je vais faire une photo et la regarder dans 8 jours , c’est ma façon de voir si un code repeint ou pas ? merci por l’avoir signalé
Bons trades à tous dans ces moments si délicats.
1 user thanked author for this post.
07/27/2024 at 11:04 AM #235833bonjour
c’est exact et confirmé car avec regressiontoday = a l’indicateur se comporte pareillement …
1 user thanked author for this post.
07/27/2024 at 5:39 PM #235835@ Jacques
J’ai copier/coller le dernier code : il me demande Fibo, j’ai mis fibo en variable =1
maintenant il veut un chiffre entier avec STD , j’ai mis 200 mais il me sort un graphe sans aucun retracement ni flêche.
Il est où le lezard ?
07/27/2024 at 7:33 PM #235837Hello
le lézard :
mettre aussi lookback en variable …
07/28/2024 at 3:00 PM #235849 -
AuthorPosts
Find exclusive trading pro-tools on