_SECTION_BEGIN("7D Pivot Range");
Plot( C, "Close", ParamColor("Color", colorLavender ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
snTDC=TimeFrameGetPrice( "C", inDaily, -1);
sndh1=TimeFrameGetPrice( "H", inDaily, -1);
sndh2=TimeFrameGetPrice( "H", inDaily, -2);
sndh3=TimeFrameGetPrice( "H", inDaily, -3);
sndh4=TimeFrameGetPrice( "H", inDaily, -4);
sndh5=TimeFrameGetPrice( "H", inDaily, -5);
sndh6=TimeFrameGetPrice( "H", inDaily, -6);
sndh7=TimeFrameGetPrice( "H", inDaily, -7);
sndh8=TimeFrameGetPrice( "H", inDaily, -7);
sndl1=TimeFrameGetPrice( "l", inDaily, -1);
sndl2=TimeFrameGetPrice( "l", inDaily, -2);
sndl3=TimeFrameGetPrice( "l", inDaily, -3);
sndl4=TimeFrameGetPrice( "l", inDaily, -4);
sndl5=TimeFrameGetPrice( "l", inDaily, -5);
sndl6=TimeFrameGetPrice( "l", inDaily, -6);
sndl7=TimeFrameGetPrice( "l", inDaily, -7);
sndl8=TimeFrameGetPrice( "l", inDaily, -7);
snMaxh1=Max(sndh1,sndh2);
snMaxh2=Max(sndh3,sndh4);
snMaxh3=Max(sndh5,sndh6);
snMaxh4=Max(sndh7,sndh8);
snMaxh=Max(Max(snMaxh1,snMaxh2), Max(snMaxh3,snMaxh4));
snMinl1=Min(sndl1,sndl2);
snMinl2=Min(sndl3,sndl4);
snMinl3=Min(sndl5,sndl6);
snMinl4=Min(sndl7,sndl8);
snMinl=Min(Min(snMinl1,snMinl2), Min(snMinl3,snMinl4));
snTDPP = (snMaxh + snMinl + snTDC)/3;
snPP2 = (snMaxh + snMinl)/2;
snDif = abs(snTDPP-snPP2);
snPPU = snTDPP + snDif;
snPPL = snTDPP - snDif;
Plot (snTDPP,"",colorYellow,1);
Plot(snPPU, "",colorYellow,styleDashed);
Plot(snPPL, "",colorYellow,styleDashed);
Title = EncodeColor(colorWhite)+ "" + "" + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" - " + Date() +" - "+"\n" +EncodeColor(colorBlue) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+
"Cl-"+C+" "+ "Vol= "+ WriteVal(V)+" 3dh= "+WriteVal(snMaxh)+" 3dL= "+WriteVal(snMinl);
_SECTION_END();
_SECTION_BEGIN("Multi Pivots");
//Modified and added extended floor pivots from ("Multi Pivots -StockManiacs") by fxarun;
// modified by trash
SetChartOptions( 0, chartShowDates | chartShowArrows | chartLogarithmic | chartWrapTitle );
Plot( C, "Close", IIf( C > Ref( C, -1 ), colorWhite , IIf( C < Ref( C, -1 ), colorSkyblue , colorYellow ) ), 64 );
RColor = ParamColor( "Resistance Color", colorOrange );//
SColor = ParamColor( "Support Color", colorBrightGreen );//
PColor = ParamColor( "Pivot Color", colorYellow );//
style = ParamStyle( "Style", 0, maskDefault );
T_F = ParamList( "Pivot T_F", "iDay|Hourly|2_Hrs|3_Hrs|4_Hrs|EOD|Weekly|Monthly" );
switch ( T_F )
{
case "iDay":
tmfrm = inDaily;
delay = -1;
break;
case "Hourly":
tmfrm = inHourly;
delay = -1;
break;
case "2_Hrs":
tmfrm = inHourly * 2;
delay = -1;
break;
case "3_Hrs":
tmfrm = inHourly * 3;
delay = -1;
break;
case "4_Hrs":
tmfrm = inHourly * 4;
delay = -1;
break;
case "EOD":
tmfrm = inDaily;
delay = 0;
break;
case "Weekly":
tmfrm = inWeekly;
delay = -1;
break;
case "Monthly":
tmfrm = inMonthly;
delay = -1;
break;
default:
break;
}
H_1 = TimeFrameGetPrice( "H", tmfrm, -delay );
L_1 = TimeFrameGetPrice( "L", tmfrm, -delay );
C_1 = TimeFrameGetPrice( "C", tmfrm, -delay );
O_1 = TimeFrameGetPrice( "O", tmfrm );
// To calculate the Pivot Levels
R = H_1 - L_1; // Range
_N(Pivot =ParamList("Pivot Type ", "Classical|Woodies|Fibonacci|WF|FloorPivots"));
switch ( Pivot )
{
case "Classical":
PP = ( H_1 + L_1 + C_1 ) / 3;
r1 = ( 2 * PP ) - L_1 ;
s1 = ( 2 * PP ) - H_1 ;
r2 = PP - s1 + r1;
s2 = PP - ( r1 - s1 ) ;
r3 = 2 * ( PP - L_1 ) + H_1 ;
s3 = L_1 - ( 2 * ( H_1 - PP ) );
r4 = Null;
s4 = Null;
bc = Null;
tc = Null;
break;
case "Woodies":
PP = ( H_1 + L_1 + C_1 + O_1 ) / 4;
r1 = ( 2 * PP ) - L_1;
r2 = PP + R;
r3 = H_1 + 2 * ( PP - L_1 );
r4 = r3 + R;
s1 = ( 2 * PP ) - H_1;
s2 = PP - R;
s3 = L_1 - 2 * ( H_1 - PP );
s4 = S3 - R;
bc = Null;
tc = Null;
break;
case "Fibonacci":
PP = ( H_1 + L_1 + C_1 ) / 3;
r3 = PP + 1.000 * R;
r2 = PP + 0.618 * R;
r1 = PP + 0.382 * R;
s1 = PP - 0.382 * R;
s2 = PP - 0.618 * R;
s3 = PP - 1.000 * R;
r4 = Null;
s4 = Null;
bc = Null;
tc = Null;
break;
case "WF":
PP = ( H_1 + L_1 + O_1 + O_1 ) / 4;
s1 = PP - ( R * 0.38 );
s2 = PP - ( R * 0.62 );
s3 = PP - ( R * 1.272 );
r1 = PP + ( R * 0.38 );
r2 = PP + ( R * 0.62 );
r3 = PP + ( R * 1.272 );
r4 = Null;
s4 = Null;
bc = Null;
tc = Null;
break;
case "FloorPivots":
PP = ( H_1 + L_1 + C_1 ) / 3;
r1 = ( 2 * PP ) - L_1 ;
s1 = ( 2 * PP ) - H_1;
r2 = PP + R;
s2 = PP - R;
r3 = R1 + R;
s3 = S1 - R;
r4 = R3 + ( R2 - R1 );
s4 = S3 - ( S1 - S2 );
bc = ( H_1 + L_1 ) / 2;
tc = ( PP - bc ) + PP;
break;
default:
break;
}
// Plot Pivot Levels in the charts
Plot ( PP, "PP", Pcolor, style );
Plot ( r1, "R1", Rcolor, style );
Plot ( r2, "R2", Rcolor, style );
Plot ( r3, "R3", Rcolor, style );
Plot ( s1, "S1", Scolor, style );
Plot ( s2, "S2", Scolor, style );
Plot ( s3, "S3", Scolor, style );
Plot ( r4, "R4", Rcolor, style );
Plot ( s4, "S4", Scolor, style );
Plot ( tc, "TC", colorWhite, style );
Plot ( bc, "BC", colorWhite, style );
_SECTION_END();
_SECTION_BEGIN("Multi Pivots");
//Modified and added extended floor pivots from ("Multi Pivots -StockManiacs") by fxarun;
// modified by trash
SetChartOptions( 0, chartShowDates | chartShowArrows | chartLogarithmic | chartWrapTitle );
Plot( C, "Close", IIf( C > Ref( C, -1 ), colorWhite , IIf( C < Ref( C, -1 ), colorSkyblue , colorYellow ) ), 64 );
RColor = ParamColor( "Resistance Color", colorOrange );//
SColor = ParamColor( "Support Color", colorBrightGreen );//
PColor = ParamColor( "Pivot Color", colorYellow );//
style = ParamStyle( "Style", 0, maskDefault );
T_F = ParamList( "Pivot T_F", "iDay|Hourly|2_Hrs|3_Hrs|4_Hrs|EOD|Weekly|Monthly" );
switch ( T_F )
{
case "iDay":
tmfrm = inDaily;
delay = -1;
break;
case "Hourly":
tmfrm = inHourly;
delay = -1;
break;
case "2_Hrs":
tmfrm = inHourly * 2;
delay = -1;
break;
case "3_Hrs":
tmfrm = inHourly * 3;
delay = -1;
break;
case "4_Hrs":
tmfrm = inHourly * 4;
delay = -1;
break;
case "EOD":
tmfrm = inDaily;
delay = 0;
break;
case "Weekly":
tmfrm = inWeekly;
delay = -1;
break;
case "Monthly":
tmfrm = inMonthly;
delay = -1;
break;
default:
break;
}
H_1 = TimeFrameGetPrice( "H", tmfrm, -delay );
L_1 = TimeFrameGetPrice( "L", tmfrm, -delay );
C_1 = TimeFrameGetPrice( "C", tmfrm, -delay );
O_1 = TimeFrameGetPrice( "O", tmfrm );
// To calculate the Pivot Levels
R = H_1 - L_1; // Range
_N(Pivot =ParamList("Pivot Type ", "Classical|Woodies|Fibonacci|WF|FloorPivots"));
switch ( Pivot )
{
case "Classical":
PP = ( H_1 + L_1 + C_1 ) / 3;
r1 = ( 2 * PP ) - L_1 ;
s1 = ( 2 * PP ) - H_1 ;
r2 = PP - s1 + r1;
s2 = PP - ( r1 - s1 ) ;
r3 = 2 * ( PP - L_1 ) + H_1 ;
s3 = L_1 - ( 2 * ( H_1 - PP ) );
r4 = Null;
s4 = Null;
bc = Null;
tc = Null;
break;
case "Woodies":
PP = ( H_1 + L_1 + C_1 + O_1 ) / 4;
r1 = ( 2 * PP ) - L_1;
r2 = PP + R;
r3 = H_1 + 2 * ( PP - L_1 );
r4 = r3 + R;
s1 = ( 2 * PP ) - H_1;
s2 = PP - R;
s3 = L_1 - 2 * ( H_1 - PP );
s4 = S3 - R;
bc = Null;
tc = Null;
break;
case "Fibonacci":
PP = ( H_1 + L_1 + C_1 ) / 3;
r3 = PP + 1.000 * R;
r2 = PP + 0.618 * R;
r1 = PP + 0.382 * R;
s1 = PP - 0.382 * R;
s2 = PP - 0.618 * R;
s3 = PP - 1.000 * R;
r4 = Null;
s4 = Null;
bc = Null;
tc = Null;
break;
case "WF":
PP = ( H_1 + L_1 + O_1 + O_1 ) / 4;
s1 = PP - ( R * 0.38 );
s2 = PP - ( R * 0.62 );
s3 = PP - ( R * 1.272 );
r1 = PP + ( R * 0.38 );
r2 = PP + ( R * 0.62 );
r3 = PP + ( R * 1.272 );
r4 = Null;
s4 = Null;
bc = Null;
tc = Null;
break;
case "FloorPivots":
PP = ( H_1 + L_1 + C_1 ) / 3;
r1 = ( 2 * PP ) - L_1 ;
s1 = ( 2 * PP ) - H_1;
r2 = PP + R;
s2 = PP - R;
r3 = R1 + R;
s3 = S1 - R;
r4 = R3 + ( R2 - R1 );
s4 = S3 - ( S1 - S2 );
bc = ( H_1 + L_1 ) / 2;
tc = ( PP - bc ) + PP;
break;
default:
break;
}
// Plot Pivot Levels in the charts
Plot ( PP, "PP", Pcolor, style );
Plot ( r1, "R1", Rcolor, style );
Plot ( r2, "R2", Rcolor, style );
Plot ( r3, "R3", Rcolor, style );
Plot ( s1, "S1", Scolor, style );
Plot ( s2, "S2", Scolor, style );
Plot ( s3, "S3", Scolor, style );
Plot ( r4, "R4", Rcolor, style );
Plot ( s4, "S4", Scolor, style );
Plot ( tc, "TC", colorWhite, style );
Plot ( bc, "BC", colorWhite, style );
_SECTION_END();