Here it for Pivot levels. Worked like charm.
_SECTION_BEGIN("PIVOTS");
// Pivot Levels //
PP = (DayL + DayH + DayC)/3; PPI = LastValue (PP,1); // Pivot
R1 = (PP * 2) - DayL; R1I = LastValue (R1,1); // Resistance 1
S1 = (PP * 2) - DayH; S1I = LastValue (S1,1); // Support 1
R2 = PP + R1 - S1; R2I = LastValue (R2,1); // Resistance 2
S2 = PP - R1 + S1; S2I = LastValue (S2,1); // Support 2
R3 = PP + R2 - S1; R3I = LastValue (R3,1); // Resistance 3
S3 = PP - R2 + S1; S3I = LastValue (S3,1); // Support 3
Today = LastValue(Day());
ppl = ParamToggle("Pivot Levels","Show|Hide",1);
if(ppl==1) {
Plot(IIf(Today == Day(),PP,Null), "PP",colorGold,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),R1,Null), "R1",colorLightGrey,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),S1,Null), "S1",colorPaleGreen,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),R2,Null), "R2",colorLightGrey,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),S2,Null), "S2",colorPaleGreen,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),R3,Null), "R3",colorLightGrey,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),S3,Null), "S3",colorPaleGreen,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
PlotText(" Pivot ", LastValue(BarIndex())-(numbars/Hts), PPI, colorGold);
PlotText(" R1 " , LastValue(BarIndex())-(numbars/Hts), R1I, colorLightGrey);
PlotText(" S1 " , LastValue(BarIndex())-(numbars/Hts), S1I, colorPaleGreen);
PlotText(" R2 " , LastValue(BarIndex())-(numbars/Hts), R2I, colorLightGrey);
PlotText(" S2 " , LastValue(BarIndex())-(numbars/Hts), S2I, colorPaleGreen);
PlotText(" R3 " , LastValue(BarIndex())-(numbars/Hts), R3I, colorLightGrey);
PlotText(" S3 " , LastValue(BarIndex())-(numbars/Hts), S3I, colorPaleGreen);
}
_SECTION_END();