Bonjour à tous , je viens en appel à l’aide ^^
J’ai mis un indicateur de changement de tendance court terme, au moment du switch j’aimerais que le fibo detect automatiquement les précédents plus haut et plus bas.
J’ai tester avec le code des fibo auto avec bollinguer et fait quelque modif. je veux retirer les sorties de boll et y instaurer juste le haut et bas de precedente periode.
je vous joint la photo.
// Price Action Tools | Indicator
DefParam DrawOnLastBarOnly = true
// --- Property settings
XOffset = 10 // Text XOffset
Alpha = 255 // Text Transparency
SetBar = 0 // Width adjustment rectangle
// --- end
// --- init
XOffset = max(2,XOffset)
alpha = max(alpha,0) // Limited input "Alpha"
alpha = min(alpha,255) // (0 min, 255 max)
// --- end
bup=Average[15](close)+2.21*std[15](close)
bdn=Average[15](close)-2.21*std[15](close)
//achat
indicator3 = CALL "3"
c2 = (close > indicator3)
ignored, indicator4, ignored = CALL "2.0"
c3 = (indicator4 > 0.50)
SignalA = c2 and c3
//vente
indicator3 = CALL "3"
c4 = (close < indicator3)
ignored, indicator4, ignored = CALL "2.0"
c5 = (indicator4 < 0.50)
SignalV = c4 and c5
if high > bup and c2 and c3 then
HiDay = high
starthi=barindex
endif
if low < bdn and c4 and c5 then
LowDay = low
startlo=barindex
endif
// Bullish
if starthi > startlo then
fib100 = lowday //0%
fib0 = hiday //100%
//DrawText("Top",BarIndex-XOffset-3,fib100,SansSerif,Bold,16) coloured(20,140,0,alpha)
//DrawSegment(BarIndex[XOffset-2],fib100,BarIndex,fib100) coloured(0,0,0,alpha)
Fibo76 = (fib100-fib0)*.72+fib0 //76.6%
DrawText("Stop",BarIndex-XOffset,Fibo76,SansSerif,Standard,15) coloured(190,10,10,alpha)
DrawSegment(BarIndex[XOffset-2],Fib76,BarIndex,Fib76) coloured(0,0,0,alpha)
fib62 = (fib100-fib0)*.618+fib0 //61.8%
DrawText("Achat 3",BarIndex-XOffset,fib62,SansSerif,Standard,15) coloured(20,140,0,alpha)
DrawSegment(BarIndex[XOffset-2],fib62,BarIndex,fib62) coloured(0,0,0,alpha)
fib50 = (fib100-fib0)/2+fib0 //50%
DrawText("Achat 2 ",BarIndex-XOffset,fib50,SansSerif,Standard,15) coloured(20,140,0,alpha)
DrawSegment(BarIndex[XOffset-2],fib50,BarIndex,fib50) coloured(0,0,0,alpha)
fib38 = (fib100-fib0)*.382+fib0 //38.2%
DrawText("Achat 1 ",BarIndex-XOffset,fib38,SansSerif,Standard,15) coloured(20,140,0,alpha)
DrawSegment(BarIndex[XOffset-2],fib38,BarIndex,fib38) coloured(0,0,0,alpha)
fib24 = (fib100-fib0)*.236+fib0 //23.6%
DrawText("Achat ",BarIndex-XOffset,fib24,SansSerif,Standard,15) coloured(20,140,0,alpha)
DrawSegment(BarIndex[XOffset-2],fib24,BarIndex,fib24) coloured(0,0,0,alpha)
//DrawText("0% ",BarIndex-XOffset,fib0,SansSerif,Standard,15) coloured(20,140,0,alpha)
//DrawSegment(BarIndex[XOffset-2],fib0,BarIndex,fib0) coloured(0,0,0,alpha)
else // Bearish
fib100 = hiday //100%
fib0 = lowday //0%
//DrawText("Bottom",BarIndex-XOffset-3,fib0,SansSerif,Bold,16) coloured(190,10,10,alpha)
//DrawSegment(BarIndex[XOffset-2],fib0,BarIndex,fib0) coloured(0,0,0,alpha)
fib76 = (fib100-fib0)*.72+fib0 //23.6%
DrawText("STOP",BarIndex-XOffset,fib76,SansSerif,Standard,15) coloured(190,10,10,alpha)
DrawSegment(BarIndex[XOffset-2],fib76,BarIndex,fib76) coloured(0,0,0,alpha)
fib62 = (fib100-fib0)*.618+fib0 //38.2%
DrawText("V3",BarIndex-XOffset,fib62,SansSerif,Standard,15) coloured(190,10,10,alpha)
DrawSegment(BarIndex[XOffset-2],fib62,BarIndex,fib62) coloured(0,0,0,alpha)
fib50 = (fib100-fib0)*.5+fib0 //50%
DrawText("V2 ",BarIndex-XOffset,fib50,SansSerif,Standard,15) coloured(190,10,10,alpha)
DrawSegment(BarIndex[XOffset-2],fib50,BarIndex,fib50) coloured(0,0,0,alpha)
fib38 = (fib100-fib0)*.382+fib0 //61.8%
DrawText("V1 ",BarIndex-XOffset,fib38,SansSerif,Standard,15) coloured(190,10,10,alpha)
DrawSegment(BarIndex[XOffset-2],fib38,BarIndex,fib38) coloured(0,0,0,alpha)
fib24 = (fib100-fib0)*.236+fib0 //76.4%
DrawText("V ",BarIndex-XOffset,fib24,SansSerif,Standard,15) coloured(190,10,10,alpha)
DrawSegment(BarIndex[XOffset-2],fib24,BarIndex,fib24) coloured(0,0,0,alpha)
//DrawText("0% ",BarIndex-XOffset,fib100,SansSerif,Standard,15) coloured(190,10,10,alpha)
//DrawSegment(BarIndex[XOffset-2],fib100,BarIndex,fib100) coloured(0,0,0,alpha)
endif
return