ero = Param("ATR multiple", 2.8, 0.5, 10, 0.1 )*Param("ATR period", 10, 3, 50 );
ero_col=ParamColor( "Color", colorCycle );
ero_col=ParamCo
r=HHV(H,ero);
s=LLV(L,ero);
ab=IIf(H>Ref(r,-1),1,IIf(L<Ref(s,-1),-1,0));
ac=ValueWhen(ab!=0,ab,1);
sl=IIf(ac==1,s,r);
s=LLV(L,ero);
ab=IIf(H>Ref(r,
ac=ValueWhen(ab
sl=IIf(ac==1,s,
Plot(sl, _DEFAULT_NAME(), ero_col, styleStaircase); // or styleaArea
Buy=Cross(H,sl);
Sell=Cross(sl,L);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
_SECTION_END();
Sell=Cross(sl,L
PlotShapes(IIf(
PlotShapes(IIf(
PlotShapes(IIf(
PlotShapes(IIf(
PlotShapes(IIf(
PlotShapes(IIf(
_SECTION_END();
_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();
SetChartOptions
_N(Title = StrFormat("{{NA
Plot( C, "Close", ParamColor("Col
_SECTION_END();
_SECTION_BEGIN ("Chart Setup");
SetChartBkColor(ParamColor("Outer panel",colorBlack));
SetChartBkGradientFill(
ParamColor("Upper Inner panel",colorBlack),
ParamColor("Lower Inner panel",colorBlack));
SetChartBkColor
SetChartBkGradi
ParamColor("Upp
ParamColor("Low
SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle);
xH=BarsSince(Day()!=Ref(Day(),-1));
yH=HHV(H,xH+1);
Hightoday=IIf(xH==0,yH,Ref(yH,0));
yH=HHV(H,xH+1);
Hightoday=IIf(x
xL=BarsSince(Day()!=Ref(Day(),-1));
yL=LLV(L,xL+1);
LowTODAY=IIf(xL==0,yL,Ref(yL,0));
yL=LLV(L,xL+1);
LowTODAY=IIf(xL
//basic price plotting
_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 ();
_N(Title = StrFormat("{{NA
Plot( C, "Close", ParamColor("Col
_SECTION_END ();
_SECTION_BEGIN ("Pivot Levels");
//--- Created by : KelvinHand -------
T_F =ParamList("TF Multiplier","Day|Min|Hour|Week|Month");
iInterval = Param("Interval", 1, 1);
T_F =ParamList("TF Multiplier","Da
iInterval = Param("Interval
Note1=ParamStr("-- Colors --", "PP, S1..S3, R1..R3");
PP_Color=ParamColor("PP Color",colorYellow);
Rn_Color=ParamColor("Rn Color",colorRed);
Sn_Color=ParamColor("Sn Color",colorBrightGreen);
PP_Color=ParamC
Rn_Color=ParamC
Sn_Color=ParamC
Note1=ParamStr("-- Styles --", "PP, R1S1, R2S2, R3S3");
PP_Style=ParamStyle("PP", styleLine, maskAll);
R1S1_Style=ParamStyle("R1S1 Style", styleLine, maskAll);
R2S2_Style=ParamStyle("R2S2 Style", styleLine, maskAll);
R3S3_Style=ParamStyle("R3S3 Style", styleLine, maskAll);
PP_Style=ParamS
R1S1_Style=Para
R2S2_Style=Para
R3S3_Style=Para
_SECTION_END ();
shift=-1;
switch (T_F)
{
case "Day": iPeriod = inDaily; break;
case "Hour": iPeriod = inHourly; break;
case "Min": iPeriod = in1Minute; break;
}
{
case "Day": iPeriod = inDaily; break;
case "Hour": iPeriod = inHourly; break;
case "Min": iPeriod = in1Minute; break;
}
xTF = iInterval*iPeri
H1 = TimeFrameGetPri
L1 = TimeFrameGetPri
C1 = TimeFrameGetPri
// To calculate the Pivot Levels
PP = (H1 + L1 + C1) / 3;
R1 = (2 * PP) - L1 ;
S1 = (2 * PP) - H1 ;
R2 = PP - s1 + r1;
S2 = PP - (r1 - s1) ;
R3 = 2 * (PP - L1) + H1 ;
S3 = L1 - (2 * (H1 - PP));
PP = (H1 + L1 + C1) / 3;
R1 = (2 * PP) - L1 ;
S1 = (2 * PP) - H1 ;
R2 = PP - s1 + r1;
S2 = PP - (r1 - s1) ;
R3 = 2 * (PP - L1) + H1 ;
S3 = L1 - (2 * (H1 - PP));
// Plot Pivot Levels in the charts
Plot (PP,"",PP_Color,PP_Style);
Plot (R1,"",Rn_Color,R1S1_Style);
Plot (S1,"",Sn_Color,R1S1_Style);
Plot (S1,"",Sn_Color
Plot (R2,"",Rn_Color,R2S2_Style);
Plot (S2,"",Sn_Color,R2S2_Style);
Plot (S2,"",Sn_Color
Plot (R3,"",Rn_Color,R3S3_Style);
Plot (S3,"",Sn_Color,R3S3_Style);
Plot (S3,"",Sn_Color
// Add Pivot levels on charts as text
Title = Title + EncodeColor(colorDarkTeal)+
"\nPivot T_F = "+NumToStr(iInterval,1.0)+" "+T_F + "\n" +
EncodeColor(Rn_Color)+"R3 = "+ r3 +"\n"+
EncodeColor(Rn_Color)+"R2 = "+ r2 + "\n"+
EncodeColor(Rn_Color)+"R1 = "+ r1 + "\n"+ "\n"+
EncodeColor(PP_Color)+"PP = "+ PP + "\n"+ "\n" +
EncodeColor(Sn_Color)+"S1 = "+ s1 + "\n"+
EncodeColor(Sn_Color)+"S2 = "+ s2 + "\n"+
EncodeColor(Sn_Color)+"S3 = "+ s3 + "\n";
Title = Title + EncodeColor(col
"\nPivot T_F = "+NumToStr(iInt
EncodeColor(Rn_
EncodeColor(Rn_
EncodeColor(Rn_
EncodeColor(PP_
EncodeColor(Sn_
EncodeColor(Sn_
EncodeColor(Sn_
_SECTION_END ();
_SECTION_BEGIN("Magnified Market Price");
//by Vidyasagar, vkunisetty@yahoo.com//
FS=Param("Font Size",30,11,100,1);
GfxSelectFont("Times New Roman", FS, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorGreen) );
Hor=Param("Horizontal Position",750,1,1200,1);
Ver=Param("Vertical Position",1,1,830,1);
GfxTextOut(""+C, Hor , Ver );
//by Vidyasagar, vkunisetty@yahoo.com//
FS=Param("Font Size",30,11,100
GfxSelectFont("
GfxSetBkMode( colorWhite );
GfxSetTextColor
Hor=Param("Hori
Ver=Param("Vert
GfxTextOut(""+C
GfxSetTextColor(ParamColor("ColorY",colorYellow) );
GfxTextOut(""+V, Hor , Ver+45 );
GfxTextOut(""+V
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Times New Roman", 20, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor(ParamColor("Color",colorRed) );
GfxTextOut(""+DD+" ("+xx+"%)", Hor , Ver+90);
DD=Prec(C-YC,2)
xx=Prec((DD/
GfxSelectFont("
GfxSetBkMode( colorWhite );
GfxSetTextColor
GfxTextOut(""+D
_SECTION_END();
Comments
Post a Comment