// Price Action Tools | Indicator
// 25.05.2019 (Release 1.0)
// Sharing ProRealTime knowledge
// fibonacci on bollinger bands inside/out – Nicolas
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=BollingerUp[20](close)
bdn=BollingerDown[20](close)
if high > bup then
HiDay = high
starthi=barindex
endif
if low < bdn 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)
fib76 = (fib100–fib0)*.764+fib0 //76.4%
DrawText(“76.4% “,BarIndex–XOffset,fib76,SansSerif,Standard,15) coloured(20,140,0,alpha)
DrawSegment(BarIndex[XOffset–2],fib76,BarIndex,fib76) coloured(0,0,0,alpha)
fib62 = (fib100–fib0)*.618+fib0 //61.8%
DrawText(“61.8% “,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(“50.0% “,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(“38.2% “,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(“23.6% “,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)*.764+fib0 //23.6%
DrawText(“23.6% “,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(“38.2% “,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(“50.0% “,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(“61.8% “,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(“76.4% “,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