Can anybody modify this afl.

#1
As seen in the image it is full of fib.levels in the screen. how to remove these keeping only the last one.

here is the code:

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
SetBarFillColor(IIf(C>O,ParamColor("Candle Up Color",colorBrightGreen),IIf(C<=O,ParamColor("Candle Down Color",colorRed),colorLightGrey)));//Up=Lime/Down=Red
Plot(C,"Price",IIf(C>O,ParamColor("Shadow Up Color",colorBlack),IIf(C<=O,ParamColor("Shadow Down Color",colorBlack),colorLightGrey)),64,0,0,0,0);//Up=DarkGreen/Down=DarkRed/64=Candle/128=Bar
SetChartBkColor(ParamColor("Panel Color",colorPaleGreen));
SetChartBkGradientFill(ParamColor("Upper Chart",colorLightGrey),ParamColor("Lower Chart",colorLightGrey));
dec=(Param("Decimals",2,0,7,1)/10)+1;
GraphXSpace=Param("GraphXSpace",20,-10,25,1);
_SECTION_END();

_SECTION_BEGIN("Fibonacci Fractals");
/*Fractals and Fib Levels
by Ipeleng Molete
30 October 2011
*/
fral= Param("Fractal Periods",13,1,50,1);

PHigh = H > Ref(HHV(H,fral),-1) AND Ref(HHV(H,fral),fral) <= H;
PHighPrice = ValueWhen(PHigh,H);
PLow = L < Ref(LLV(L,fral),-1) AND Ref(LLV(L,fral),fral) >= L;
PLowPrice = ValueWhen(PLow,L);

Bear = ValueWhen(PHigh, DateTime());
Bull = ValueWhen(PLow, DateTime());

PlotShapes(shapeSmallCircle*PLow,colorGreen,0,L,-10);
PlotShapes(shapeSmallCircle*PHigh,colorRed,0,H,10);

//Plot(PLowPrice, "Fractal Low", colorGreen, styleDots | styleNoLine);
//Plot(PHighPrice, "Fractal High", colorRed, styleDots | styleNoLine);

phase = IIf(bull > bear, 0, 1);

//Fib Level Calculation
//If previous fractal was down fractal, then Fib Level is worked out
//by subtracting the down fractal from the up fractal and vice versa

HiLoDifference = IIf(phase == 0, PLowPrice - PHighPrice, PHighPrice - PLowPrice);

Level1 = abs(HiLoDifference)*0.236;
Level2 = abs(HiLoDifference)*0.382;
Level3 = abs(HiLoDifference)*0.618;
Level4 = abs(HiLoDifference)*0.784;
Level5 = abs(HiLoDifference)*1.0;
Level6 = abs(HiLoDifference)*1.272;
Level7 = abs(HiLoDifference)*1.618;
Level8 = abs(HiLoDifference)*2.618;

Level0236 = IIf(phase == 0, PLowPrice + Level1, PHighPrice - Level1);
Level0382 = IIf(phase == 0, PLowPrice + Level2, PHighPrice - Level2);
Level0618 = IIf(phase == 0, PLowPrice + Level3, PHighPrice - Level3);
Level0784 = IIf(phase == 0, PLowPrice + Level4, PHighPrice - Level4);
Level10 = IIf(phase == 0, PLowPrice + Level5, PHighPrice - Level5);
Level1272 = IIf(phase == 0, PLowPrice + Level6, PHighPrice - Level6);
Level1618 = IIf(phase == 0, PLowPrice + Level7, PHighPrice - Level7);
Level2618 = IIf(phase == 0, PLowPrice + Level8, PHighPrice - Level8);

//Graph
Plot(Level0236,"23.6%=",colorLightYellow, styleDots | styleNoLine|styleNoRescale );
Plot(Level0382,"38.2%=",colorGold, styleDots | styleNoLine|styleNoRescale );
Plot(Level0618,"61.8%=",colorRed, styleDots | styleNoLine|styleNoRescale );
Plot(Level0784,"78.4%=",colorRed, styleDots | styleNoLine|styleNoRescale );
Plot(Level10,"1.0%=",colorBlack, styleDots | styleNoLine|styleNoRescale );
Plot(Level1272,"127.2%=",colorBlue, styleDots | styleNoLine|styleNoRescale );
Plot(Level1618,"161.8%=",colorSkyblue, styleDots | styleNoLine|styleNoRescale );
Plot(Level2618,"261.8%=",colorPink, styleDots | styleNoLine|styleNoRescale );


BarTime1=LastValue(TimeNum() - Now(4));
DataError=IIf(Now(4) > TimeNum(),True,False);
TimeBase=IIf(Interval(1)>0,1,0);
_N(StrBarTime=NumToStr(BarTime1,1.0,False));
BT_Length=StrLen(StrBarTime);
_N(TimeLeft_=
WriteIf(BT_Length==1,"0:0"+StrBarTime,WriteIf(BT_Length==2,"0:"+StrBarTime,
WriteIf(BT_Length==3,StrLeft(StrBarTime,1)+":"+StrRight(StrBarTime,2),
StrLeft(StrBarTime,2)+":"+StrRight(StrBarTime,2)))));
TimeLeft=WriteIf(TimeBase==1,TimeLeft_,"N/A");
Title =

EncodeColor(colorRed) + "\nLast Up Fractal: " + NumToStr(PHighPrice, 1.4) +
EncodeColor(colorGreen) + "\nLast Down Fractal: " + NumToStr(PLowPrice, 1.4);
_SECTION_END();
 

jagankris

Well-Known Member
#2
As seen in the image it is full of fib.levels in the screen. how to remove these keeping only the last one.

here is the code:

_SECTION_BEGIN("Price");
//Graph
Plot(Level0236,"23.6%=",colorLightYellow, styleDots | styleNoLine|styleNoRescale );
Plot(Level0382,"38.2%=",colorGold, styleDots | styleNoLine|styleNoRescale );
Plot(Level0618,"61.8%=",colorRed, styleDots | styleNoLine|styleNoRescale );
Plot(Level0784,"78.4%=",colorRed, styleDots | styleNoLine|styleNoRescale );
Plot(Level10,"1.0%=",colorBlack, styleDots | styleNoLine|styleNoRescale );
Plot(Level1272,"127.2%=",colorBlue, styleDots | styleNoLine|styleNoRescale );
Plot(Level1618,"161.8%=",colorSkyblue, styleDots | styleNoLine|styleNoRescale );
Plot(Level2618,"261.8%=",colorPink, styleDots | styleNoLine|styleNoRescale );

_SECTION_END();
// -- will comment out the code.
For example in the above plot - is used to plot the levels.
Plot(Level0382,"38.2%=",colorGold, styleDots | styleNoLine|styleNoRescale );

// Plot(Level0382,"38.2%=",colorGold, styleDots | styleNoLine|styleNoRescale); - means the code will be commented out.

So just use // and comment out which ever plot levels you want to comment out.
And if you remove the // to uncomment.
 
#3
Thank you JK. But my problem is different.i dont want the previous fib.levels which are normally of no use. I want only the latest plotted one on the screen.
 

Similar threads