Fibonacci Support and Resistance
Fibonacci Support and Resistance AFL in Amibroker highlight key support and resistance levels using Fibonacci ratios. Utilizing Amibroker data feed, this indicator identifies crucial price levels where trends might reverse or consolidate. Traders leverage these levels to fine-tune their strategies, improving trade entries, and managing risk more effectively.
///Weekly Price Range Calculation Mc1 = BarsSince(DayOfWeek()==1); Fc1 = BarsSince(DayOfWeek()==5); Fc2 = Ref(BarsSince(DayOfWeek()==5),-1)-1; WRC = IIf(Mc1==0 AND Fc1>2,Ref(HHV(H,LastValue(mc1)),-1)-Ref(LLV(L,LastValue(Mc1)),-1),IIf(Fc1=0 AND Mc1>5,HHV(H,LastValue(Fc2))-LLV(L,LastValue(Fc2)),IIf(Fc1==0,HHV(H,LastValue(Mc1))-LLV(L,LastValue(Mc1)),0))); WRP = ValueWhen(WRC>0,WRC,1); //Balance Point dt = DayOfWeek(); DBC =(HighestSince(DayOfWeek()==dt,H,5)+ LowestSince(DayOfWeek()==dt,L,5)+Close)/3; //Resistance Range RR1 = dbc +(WRP*0.5); RR2 = dbc +(WRP*0.618); //Support Range SR1 = dbc -(WRP*0.5); SR2 = dbc -(WRP*0.618); Plot(RR1, "", colorLime); Plot(RR2, "", colorLime, styleDashed); Plot(SR1, "", colorRed); Plot(SR2,"", colorRed, styleDashed); GraphXSpace = 5; _SECTION_BEGIN( "Price" ); SetChartOptions( 0, chartShowDates | chartShowArrows | chartLogarithmic | chartWrapTitle ); _N( Title = StrFormat( "{{NAME}} - " + SectorID( 1 ) + " - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " + WriteVal( V, 1.0 ) + " {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) ); Plot( C, "Close", colorRose, styleCandle | styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() ); if ( ParamToggle( "Tooltip shows", "All Values|Only Prices" ) ) { ToolTip = StrFormat( "Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: " + NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 ) ) ); } _SECTION_END();