_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("pivots mw");
SetChartBkColor(2) ;
k=IIf(ParamList("select type","daily|next day")=="daily",-1,0);
k1=-1;
TimeFrameSet(inDaily);
day_h= LastValue(Ref(H,K));
day_l= LastValue(Ref(L,K));
day_c= LastValue(Ref(C,K));
TimeFrameRestore();
TimeFrameSet(inWeekly);
Week_h= LastValue(Ref(H,K1));
Week_l= LastValue(Ref(L,K1));;
Week_c= LastValue(Ref(C,K1));;
TimeFrameRestore();
TimeFrameSet(inMonthly);
month_h= LastValue(Ref(H,K1));
month_l= LastValue(Ref(L,K1));
month_c= LastValue(Ref(C,K1));
TimeFrameRestore();
/*--------------------------------------*/
// day
DH=Day_h;
DL=Day_L;
DC=Day_C;
// DAY PIVOT Calculation
pd = ( DH+ DL + DC )/3;
sd1 = (2*pd)-DH;
sd2 = pd -(DH - DL);
sd3 = Sd1 - (DH-DL);
sd4 = Sd2 - (DH-DL);
sd5 = Sd3 - (DH-DL);
rd1 = (2*pd)-DL;
rd2 = pd +(DH -DL);
rd3 = rd1 +(DH-DL);
rd4 = rd2 +(DH-DL);
rd5 = rd3 +(DH-DL);
dp=pd;
// week
WH=Week_h;
WL=Week_l;
WC=Week_c;
// WEEK PIVOT Calculation
pw = ( WH+ WL + WC )/3;
sw1 = (2*pw)-WH;
sw2 = pw -(WH - WL);
sw3 = Sw1 - (WH-WL);
sw4 = Sw2 - (WH-WL);
rw1 = (2*pw)-WL;
rw2 = pw +(WH -WL);
rw3 = rw1 +(WH-WL);
rw4 = rw2 +(WH-WL);
// month
MH=month_h;
ML=month_l;
MC=month_c;
// MONTH PIVOT Calculation
pm = ( MH+ ML + MC )/3;
sm1 = (2*pm)-MH;
sm2 = pm -(MH - ML);
sm3 = Sm1 - (MH-ML);
rm1 = (2*pm)-ML;
rm2 = pm +(MH -ML);
rm3 = rm1 +(MH-ML);
ppl = ParamToggle("Plot Pivot Levels","Off|On",1);
numbars = LastValue(Cum(Status("barvisible")));
fraction= IIf(StrRight(Name(),3) == "", 3.2, 3.2);
hts = Param("slide all",33,-1000,1000,1);
{
if(ppl==1) {
Plot(pd,"",colorPink,styleLine|styleDots|styleThick|styleNoRescale);
Plot(sd1,"",colorPink,styleDashed|styleNoRescale);
Plot(sd2,"",colorPink, styleDashed|styleNoRescale);
Plot(sd3,"",colorPink, styleDashed|styleNoRescale);
Plot(sd4,"",colorPink, styleDashed|styleNoRescale);
Plot(sd5,"",colorPink, styleDashed|styleNoRescale);
Plot(rd1,"",colorPink, styleDashed|styleNoRescale);
Plot(rd2,"",colorPink, styleDashed|styleNoRescale);
Plot(rd3,"",colorPink, styleDashed|styleNoRescale);
Plot(rd4,"",colorPink, styleDashed|styleNoRescale);
Plot(rd5,"",colorPink, styleDashed|styleNoRescale);
Plot(pw,"",colorGreen,styleLine|styleDots|styleThick|styleNoRescale);
Plot(sw1,"",colorDarkGreen, styleDashed|styleNoRescale);
Plot(sw2,"",colorDarkGreen, styleDashed|styleNoRescale);
Plot(sw3,"",colorDarkGreen, styleDashed|styleNoRescale);
Plot(sw4,"",colorDarkGreen, styleDashed|styleNoRescale);
Plot(rw1,"",colorDarkGreen, styleDashed|styleNoRescale);
Plot(rw2,"",colorDarkGreen, styleDashed|styleNoRescale);
Plot(rw3,"",colorDarkGreen, styleDashed|styleNoRescale);
Plot(rw4,"",colorDarkGreen, styleDashed|styleNoRescale);
/*Plot(pm,"",colorViolet,styleLine|styleDots|styleThick|styleNoRescale);
Plot(sm1,"",colorViolet, styleDashed|styleNoRescale);
Plot(sm2,"",colorViolet, styleDashed|styleNoRescale);
Plot(sm3,"",colorViolet, styleDashed|styleNoRescale);
Plot(rm1,"",colorViolet, styleDashed|styleNoRescale);
Plot(rm2,"",colorViolet, styleDashed|styleNoRescale);
Plot(rm3,"",colorViolet, styleDashed|styleNoRescale);
*/
i=1;
PlotText(" D-PVT = " + WriteVal(pd,fraction), LastValue(BarIndex())-(numbars/Hts), dp, colorPink);
PlotText(" DR1 = " + WriteVal(rd1,fraction), LastValue(BarIndex())-(numbars/Hts), rd1 , colorPink);
PlotText(" DS1 = " + WriteVal(sd1,fraction), LastValue(BarIndex())-(numbars/Hts), sd1 , colorPink);
PlotText(" DR2 = " + WriteVal(rd2,fraction), LastValue(BarIndex())-(numbars/Hts), rd2 , colorPink);
PlotText(" DS2 = " + WriteVal(sd2,fraction), LastValue(BarIndex())-(numbars/Hts), sd2 , colorPink);
PlotText(" DR3 = " + WriteVal(rd3,fraction), LastValue(BarIndex())-(numbars/Hts), rd3 , colorPink);
PlotText(" DS3 = " + WriteVal(sd3,fraction), LastValue(BarIndex())-(numbars/Hts), sd3 , colorPink);
PlotText(" DR4 = " + WriteVal(rd4,fraction), LastValue(BarIndex())-(numbars/Hts), rd4 , colorPink);
PlotText(" DS4 = " + WriteVal(sd4,fraction), LastValue(BarIndex())-(numbars/Hts), sd4 , colorPink);
PlotText(" DR5 = " + WriteVal(rd4,fraction), LastValue(BarIndex())-(numbars/Hts), rd5 , colorPink);
PlotText(" DS5 = " + WriteVal(sd4,fraction), LastValue(BarIndex())-(numbars/Hts), sd5 , colorPink);
PlotText(" W-PVT = " + WriteVal(pw,fraction), LastValue(BarIndex())-(numbars/Hts), pw , colorGreen);
PlotText(" WR1 = " + WriteVal(rw1,fraction), LastValue(BarIndex())-(numbars/Hts), rw1 , colorGreen);
PlotText(" WS1 = " + WriteVal(sw1,fraction), LastValue(BarIndex())-(numbars/Hts), sw1 , colorGreen);
PlotText(" WR2 = " + WriteVal(rw2,fraction), LastValue(BarIndex())-(numbars/Hts), rw2 , colorGreen);
PlotText(" WS2 = " + WriteVal(sw2,fraction), LastValue(BarIndex())-(numbars/Hts), sw2 , colorGreen);
PlotText(" WR3 = " + WriteVal(rw3,fraction), LastValue(BarIndex())-(numbars/Hts), rw3 , colorGreen);
PlotText(" WS3 = " + WriteVal(sw3,fraction), LastValue(BarIndex())-(numbars/Hts), sw3 , colorGreen);
PlotText(" WR4 = " + WriteVal(rw4,fraction), LastValue(BarIndex())-(numbars/Hts), rw4 , colorGreen);
PlotText(" WS4 = " + WriteVal(sw4,fraction), LastValue(BarIndex())-(numbars/Hts), sw4 , colorGreen);
/*
PlotText(" M-PVT = " + WriteVal(pm,fraction), LastValue(BarIndex())-(numbars/Hts), pm , colorViolet);
PlotText(" MR1 = " + WriteVal(rm1,fraction), LastValue(BarIndex())-(numbars/Hts), rm1 ,colorViolet );
PlotText(" MS1 = " + WriteVal(sm1,fraction), LastValue(BarIndex())-(numbars/Hts), sm1 ,colorViolet );
PlotText(" MR2 = " + WriteVal(rm2,fraction), LastValue(BarIndex())-(numbars/Hts), rm2 ,colorViolet);
PlotText(" MS2 = " + WriteVal(sm2,fraction), LastValue(BarIndex())-(numbars/Hts), sm2 , colorViolet);
PlotText(" MR3 = " + WriteVal(rm3,fraction), LastValue(BarIndex())-(numbars/Hts), rm3 , colorViolet);
PlotText(" MS3 = " + WriteVal(sm3,fraction), LastValue(BarIndex())-(numbars/Hts), sm3 , colorViolet);
*/
}}
//--end----------------------------------------------------------------------------
_SECTION_END();