Here Is the Pivot with line break.
YupcANDlebackColor= Colorrgb(0,177, 88);
YdowncANDlebackColor= Colorrgb(246,70, 65);
YwickColorbackColor= Colorrgb(88, 97, 100);
Setchartoptions(0,ChartShowarrows|chartShowDates);
SetbarfillColor(Iif( C > O, YupcANDlebackColor,YdowncANDlebackColor ));
Plot( C, "Price", Iif( C > O, YupcANDlebackColor,YdowncANDlebackColor ), styleCandle|styleNoTitle);
_N(Title = EncodeColor(colorOrange)+ StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open = %g, Hi = %g, Lo = %g, Close = %g, Volume = %g Change = (%.1f%%) {{VALUES}}", O, H, L, C, V, SelectedValue( ROC( C, 1 ) ) ));
// The Standard Pivot Formula for One Timeframe
SetBarsRequired(sbrAll,sbrAll);
RequestTimedRefresh(5);
_SECTION_BEGIN("Standard Pivot(Akmeheta@gmail.com");
Timeframe = ParamList("Pivot Interval",List = "Hourly,Daily,Monthly,Yearly",1);
Type=IIf(ParamList("Select Type","Today|Tomorrow")=="Today",-1,0);
DisplaShow = ParamList("Show Pivots", "Selected only|All|Hide" );
Hslide = Param("Slide Pivot Text HorizontAlly",150,1,500,1);
PivotR4 = ParamList("R4", "Hide|Show");
PivotR3 = ParamList("R3", "Hide|Show");
PivotR2 = ParamList("R2", "Hide|Show");
PivotR1 = ParamList("R1", "Show|Hide");
PivotTC = ParamList("TC", "Hide|Show");
PivotP = ParamList("Pivot","Show|Hide");
PivotBC = ParamList("BC", "Hide|Show");
PivotS1 = ParamList("S1", "Show|Hide");
PivotS2 = ParamList("S2", "Hide|Show");
PivotS3 = ParamList("S3", "Hide|Show");
PivotS4 = ParamList("S4", "Hide|Show");
Rcolor = ParamColor("Resistance Color", colorOrange);
Pcolor = ParamColor("Central Color", colorDarkYellow);
Scolor = ParamColor("Support Color", colorBrightGreen);
_SECTION_END();
Vslide = 50;
GraphLabelDecimals = 2;
dn1= IIf(Timeframe == "Hourly",inHourly, IIf(Timeframe == "Daily",inDaily, IIf(Timeframe == "Monthly",inMonthly, IIf(Timeframe == "Yearly",inYearly, 0))));
separator = IIf(Timeframe == "Hourly",Hour()!= Ref( Hour() , -1 ), IIf(Timeframe == "Daily",Day()!= Ref(Day() , -1 ), IIf(Timeframe == "Monthly",Month()!= Ref( Month() , -1 ), IIf(Timeframe == "Yearly",Year()!= Ref(Year() , -1 ), 0))));
separatornext = IIf(Timeframe == "Hourly",Hour()!= Ref( Hour() , 1 ), IIf(Timeframe == "Daily",Day()!= Ref(Day() , 1 ), IIf(Timeframe == "Monthly",Month()!= Ref( Month() , 1 ), IIf(Timeframe == "Yearly",Year()!= Ref(Year() , 1 ), 0))));
Inbetween = Flip(separator, separatornext);
// Get Prices
Previoushigh = TimeFrameGetPrice( "H", dn1, Type );
PreviousLow = TimeFrameGetPrice( "L", dn1, Type );
Previousclose = TimeFrameGetPrice( "C", dn1, Type );
if(Timeframe == "Hourly")
{
Nextseparator = Ref(separator, 1);
Previoushigh = HighestSince(separator, High);
PreviousLow = LowestSince(separator, Low);
Previoushigh = ValueWhen( Nextseparator, Previoushigh);
PreviousLow = ValueWhen( Nextseparator, PreviousLow);
Previousclose = ValueWhen( Nextseparator, Close);
}
Plot(Previoushigh , WriteIf(Previoushigh >0, "\n"+Timeframe+" High",""), colorGreen, styleNoDraw|styleOwnScale|styleNoLabel|styleNoLine);
Plot(PreviousLow , WriteIf(PreviousLow >0, "\n"+Timeframe+" Low",""), colorGreen, styleNoDraw|styleOwnScale|styleNoLabel|styleNoLine);
if (Interval() < dn1)Plot( separator, "", Colorlightgrey, Stylehistogram |Styledashed| Styleownscale|Stylenolabel |styleNoTitle, Null, Null, 0,-256, 1);
// Standard Pivot Formula
Pivot = ( Previoushigh+ PreviousLow + Previousclose )/3;
BC = ( Previoushigh+ PreviousLow )/2;
TC = (Pivot - BC) + Pivot;
R1 = (2*Pivot)-PreviousLow;
R2 = Pivot +(Previoushigh -PreviousLow);
R3 = R1 +(Previoushigh-PreviousLow);
R4 = R3 + (R2 - R1);
S1 = (2*Pivot)-Previoushigh;
S2 = Pivot -(Previoushigh - PreviousLow);
S3 = S1 - (Previoushigh-PreviousLow);
S4 = S3 - (S1 - S2);
Pivot = IIf(Inbetween, Pivot, Null);
BC = IIf(Inbetween, BC, Null);
TC = IIf(Inbetween, TC, Null);
R1 =IIf(Inbetween, R1, Null);
R2 = IIf(Inbetween, R2, Null);
R3 = IIf(Inbetween, R3, Null);
R4 = IIf(Inbetween, R4, Null);
S1 =IIf(Inbetween, S1, Null);
S2 = IIf(Inbetween, S2, Null);
S3 = IIf(Inbetween, S3, Null);
S4 = IIf(Inbetween, S4, Null);
if ((PivotP=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide" AND Interval() < dn1) Plot (Pivot,"\nPivot ",Pcolor,styleLine);
if ((PivotTC=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide" AND Interval() < dn1) Plot (TC,"\nTC ",Pcolor,styleDashed);
if ((PivotBC=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide" AND Interval() < dn1) Plot (BC,"\nBC ",Pcolor,styleDashed);
if ((PivotR1=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide" AND Interval() < dn1) Plot(R1,"\nR1 ",Rcolor,styleDashed);
if ((PivotR2=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide" AND Interval() < dn1) Plot(R2,"\nR2 ",Rcolor,styleDashed);
if ((PivotR3=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide" AND Interval() < dn1) Plot(R3,"\nR3 ",Rcolor,styleDashed);
if ((PivotR4=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide" AND Interval() < dn1) Plot(R4,"\nR4 ",Rcolor,styleDashed);
if ((PivotS1=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide" AND Interval() < dn1) Plot (S1,"\nS1 ",Scolor,styleDashed);
if ((PivotS2=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide" AND Interval() < dn1) Plot (S2,"\nS2 ",Scolor,styleDashed);
if ((PivotS3=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide" AND Interval() < dn1) Plot (S3,"\nS3 ",Scolor,styleDashed);
if ((PivotS4=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide" AND Interval() < dn1) Plot (S4,"\nS4 ",Scolor,styleDashed);
Timeframe = StrLeft(Timeframe, 1);
for( i = 0; i < BarCount; i++ )
{
if(i+Hslide== BarCount AND (PivotR1=="Show" OR DisplaShow=="All")AND DisplaShow!="Hide") PlotText( ""+Timeframe+" R1 :"+Prec(SelectedValue(R1), 2) ,i+Vslide,SelectedValue(R1) ,Rcolor );
if(i+Hslide== BarCount AND (PivotR2=="Show" OR DisplaShow=="All")AND DisplaShow!="Hide") PlotText( ""+Timeframe+" R2 :"+Prec(SelectedValue(R2), 2) ,i+Vslide,SelectedValue(R2) ,Rcolor );
if(i+Hslide== BarCount AND (PivotR3=="Show" OR DisplaShow=="All")AND DisplaShow!="Hide") PlotText( ""+Timeframe+" R3 :"+Prec(SelectedValue(R3), 2) ,i+Vslide,SelectedValue(R3) ,Rcolor );
if(i+Hslide== BarCount AND (PivotR4=="Show" OR DisplaShow=="All")AND DisplaShow!="Hide") PlotText( ""+Timeframe+" R4 :"+Prec(SelectedValue(R4), 2) ,i+Vslide,SelectedValue(R4) ,Rcolor );
if(i+Hslide== BarCount AND (PivotTC=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide") PlotText( ""+Timeframe+" TC :"+Prec(SelectedValue(TC), 2) ,i+Vslide,SelectedValue(TC) ,Pcolor);
if(i+Hslide== BarCount AND (PivotP=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide") PlotText( ""+Timeframe+" Pivot :"+Prec(SelectedValue(Pivot), 2) ,i+Vslide,SelectedValue(Pivot) ,Pcolor);
if(i+Hslide== BarCount AND (PivotBC=="Show" OR DisplaShow=="All") AND DisplaShow!="Hide") PlotText( ""+Timeframe+" BC :"+Prec(SelectedValue(BC), 2) ,i+Vslide,SelectedValue(BC) ,Pcolor);
if(i+Hslide== BarCount AND (PivotS1=="Show" OR DisplaShow=="All")AND DisplaShow!="Hide") PlotText( ""+Timeframe+" S1 :"+Prec(SelectedValue(S1), 2) ,i+Vslide,SelectedValue(S1) ,Scolor );
if(i+Hslide== BarCount AND (PivotS2=="Show" OR DisplaShow=="All")AND DisplaShow!="Hide") PlotText( ""+Timeframe+" S2 :"+Prec(SelectedValue(S2), 2) ,i+Vslide,SelectedValue(S2) ,Scolor );
if(i+Hslide== BarCount AND (PivotS3=="Show" OR DisplaShow=="All")AND DisplaShow!="Hide") PlotText( ""+Timeframe+" S3 :"+Prec(SelectedValue(S3), 2) ,i+Vslide,SelectedValue(S3) ,Scolor );
if(i+Hslide== BarCount AND (PivotS4=="Show" OR DisplaShow=="All")AND DisplaShow!="Hide") PlotText( ""+Timeframe+" S4 :"+Prec(SelectedValue(S4), 2) ,i+Vslide,SelectedValue(S4) ,Scolor );
}