ero = Param("ATR multiple", 2.8, 0.5, 10, 0.1 )*Param("ATR period", 10, 3, 50 );
ero_col=ParamCo lor( "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),colo rGreen, 0, L, Offset=-40);
PlotShapes(IIf( Buy, shapeSquare, shapeNone),colo rLime, 0,L, Offset=-50);
PlotShapes(IIf( Buy, shapeUpArrow, shapeNone),colo rWhite, 0,L, Offset=-45);
PlotShapes(IIf( Sell, shapeSquare, shapeNone),colo rRed, 0, H, Offset=40);
PlotShapes(IIf( Sell, shapeSquare, shapeNone),colo rOrange, 0,H, Offset=50);
PlotShapes(IIf( Sell, shapeDownArrow, shapeNone),colo rWhite, 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,chartShowArr ows|chartShowDa tes);
_N(Title = StrFormat("{{NA ME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Col or", colorBlack ), styleNoTitle | ParamStyle("Sty le") | GetPriceStyle() );
_SECTION_END();
SetChartOptions
_N(Title = StrFormat("{{NA
Plot( C, "Close", ParamColor("Col
_SECTION_END();
_SECTION_BEGIN ("Chart Setup");
SetChartBkColor (ParamColor("Ou ter panel",colorBla ck));
SetChartBkGradi entFill(
ParamColor("Upp er Inner panel",colorBla ck),
ParamColor("Low er Inner panel",colorBla ck));
SetChartBkColor
SetChartBkGradi
ParamColor("Upp
ParamColor("Low
SetChartOptions (0,chartShowDat es|chartShowArr ows|chartLogari thmic|chartWrap Title);
xH=BarsSince(Da y()!=Ref(Day(), -1));
yH=HHV(H,xH+1);
Hightoday=IIf(x H==0,yH,Ref(yH, 0));
yH=HHV(H,xH+1);
Hightoday=IIf(x
xL=BarsSince(Da y()!=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("{{NA ME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Col or", colorBlack ), styleNoTitle | ParamStyle("Sty le") | 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","Da y|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=ParamC olor("PP Color",colorYel low);
Rn_Color=ParamC olor("Rn Color",colorRed );
Sn_Color=ParamC olor("Sn Color",colorBri ghtGreen);
PP_Color=ParamC
Rn_Color=ParamC
Sn_Color=ParamC
Note1=ParamStr( "-- Styles --", "PP, R1S1, R2S2, R3S3");
PP_Style=ParamS tyle("PP", styleLine, maskAll);
R1S1_Style=Para mStyle("R1S1 Style", styleLine, maskAll);
R2S2_Style=Para mStyle("R2S2 Style", styleLine, maskAll);
R3S3_Style=Para mStyle("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(col orDarkTeal)+
"\nPivot T_F = "+NumToStr(iInt erval,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("Col or",colorGreen) );
Hor=Param("Hori zontal Position",750,1 ,1200,1);
Ver=Param("Vert ical Position",1,1,8 30,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("Co lorY",colorYell ow) );
GfxTextOut(""+V , Hor , Ver+45 );
GfxTextOut(""+V
YC=TimeFrameGet Price("C",inDai ly,-1);
DD=Prec(C-YC,2) ;
xx=Prec((DD/ YC)*100,2);
GfxSelectFont(" Times New Roman", 20, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor (ParamColor("Co lor",colorRed) );
GfxTextOut(""+D D+" ("+xx+"%)", Hor , Ver+90);
DD=Prec(C-YC,2)
xx=Prec((DD/
GfxSelectFont("
GfxSetBkMode( colorWhite );
GfxSetTextColor
GfxTextOut(""+D
_SECTION_END();
Comments
Post a Comment