Need help to modify fra.fib.code

#1
when i change" style dots" to style "line" all the lines get linked. i want seperate lines. Also ,i want to get removed the old fibanocci series when new one is formed. thanks in advance.



This the code :

_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(shapeUpArrow*PLow,colorGreen,0,L,-10);
PlotShapes(shapeDownArrow*PHigh,colorRed,0,H,-9);

//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%=",colorWhite, styleDots | styleNoLine|styleNoRescale );
Plot(Level0382,"38.2%=",colorGreen, styleDots | styleNoLine|styleNoRescale );
Plot(Level0618,"61.8%=",colorRed, styleDots | styleNoLine|styleNoRescale );
Plot(Level0784,"78.4%=",colorRed, 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");




_SECTION_END();
 

Attachments

Similar threads