Ci-dessous le code en question avec les modifications sur les performances affichées. Félicitations Pierre pour ton travail, je te suit sur twitter, tu penses incorporer cela dans ton LTS-Evoluzione ?
//"Little trend Box v5"
//DAILY : variables entier par défaut
// p1=1,2,3
//p2=15,..20 // entier défaut
//HEBDO:variables entier par défaut
// p1 =2
//p2= 15
once lastpoint = 0
offset = average[50,0](range) * 2
hs= (high-low)
hh= highest[p1](hs)
ll= lowest[p1](hs)
hi10=highest[p2](high)
lo10=lowest[p2](low)
median= ( hi10+lo10)/2
if high>= hi10 and hs>= hh then
trendown=( lo10+median+close)/3
endif
if low<= lo10 and hs<=ll then
trendown=( hi10+median+close)/3
endif
if low<= lo10 and hs<=ll then
trendup=( low+median+close)/3
endif
if high>= hi10 and hs >= hh then
trendup= ( high+median+close)/3
endif
trend = (trendup+trendown)/2
if TRENDUP crosses over TRENDOWN then//>
drawarrowup(barindex,TRENDOWN-10*PipSize) coloured(0,255,0)
r=0
g=255
b=0
ELSif TRENDUP crosses under TRENDOWN then//<
drawarrowdown(barindex,TRENDUP+10*PipSize) coloured(255,0,0)
r=255
g=0
b=0
endif
////////////////
if TRENDUP crosses over TRENDOWN then//>
ihh = high
iclose=close
BOTy = TRENDUP//low//close
BOTx = barindex
lastX = BOTx
lastY = BOTy
xx = BOTy
//diff = round((xx - yy)*100 / yy,2)
drawsegment(illbar,ill,illbar-10,ill) coloured(255,0,0)
DrawText("#diff#%",illbar-12,ill,Dialog,Bold,16) coloured(255,0,0)
ELSif TRENDUP crosses under TRENDOWN and (lastpoint=-1 or lastpoint=0) then//<
ill = low
iclose=close
TOPy = trendown//high//close
TOPx = barindex
lastX = TOPx
lastY = TOPy
yy = TOPy
//diff = round((yy - xx)*100 / xx,2)
drawsegment(ihhbar,ihh,ihhbar-10,ihh) coloured(0,255,0)
DrawText("#diff#%",ihhbar-12,ihh,Dialog,Bold,16) coloured(0,255,0)
endif
if trendup>trendown then
ihh=max(ihh,high)
diff=round((ihh-iclose)*100/iclose,2)
if ihh<>ihh[1] then
ihhbar=barindex
endif
else
ill=min(ill,low)
diff=round((iclose-ill)*100/iclose,2)
if ill<>ill[1] then
illbar=barindex
endif
endif
///////////////////
drawcandle(TRENDUP,TRENDOWN, TRENDUP,TRENDOWN)coloured (r,g,b,50)
RETURN trendup coloured (0,255,0)as "trendup ", trendown coloured (255,0,0)as " trendown", trend coloured (255,255,255)as "trend"