Bonjour
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 * 50
condition1 = 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)
endif
Return customclose as “Regression Linéaire+Fibonacci “