Ema Crossover 2.afl

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

_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();

/*Buy or Sell Condition*/


Buy = Cross(EMA( Close , 5 ),EMA( Close , 13 ));
Sell = Cross(EMA( Close , 13 ),EMA( Close , 5 ));

/*Plot Buy or Sell Arrows*/


PlotShapes(IIf(Sell==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-
20);
PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-
20);

/*Plot EMA*/
Plot( EMA( Close,13), "13 EMA",ParamColor("Color", colorRed ),styleNoRescale);
Plot( EMA( Close,5), "5 EMA",ParamColor("Color", colorBlue ),styleNoRescale);

/*Plot Ribbon */
Ribbon1=IIf( EMA( Close , 5 )>EMA( Close , 13 ) ,colorGreen, IIf(EMA( Close ,
13 )>EMA( Close , 5 ), colorRed,colorYellow));
Plot(6, "Ribbon", Ribbon1, styleOwnScale| styleArea| styleNoLabel,-0.5,100);
_SECTION_END();

You might also like