SMA-Support-Line-Buy-Sell-Signals

SMA-Support-Line-Buy-Sell-Signals
SMA-Support-Line-Buy-Sell-Signals

//www.aflcode.com
_SECTION_BEGIN("if candle above SMA5= buy");

Buy = Cross( C,MA( Close, 5 ) );
PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorBlue, 0,Low, Offset=-5);
_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();

_SECTION_BEGIN("MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 5);
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorBlue ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("Volume");
Plot( Volume, _DEFAULT_NAME(), ParamColor("Color", colorLightBlue), ParamStyle( "Style", styleHistogram | styleOwnScale | styleThick, maskHistogram  ), 2 );
_SECTION_END();

GfxSetOverlayMode(0); 
GfxSelectFont("Tahoma", Status("pxheight")/15); 
GfxSetTextAlign( 6 );// center alignment 
GfxSetTextColor( ColorRGB( 200, 200, 200 ) ); 
GfxSetBkMode(3); // transparent 
GfxTextOut( Name(), Status("pxwidth")/6, Status("pxheight")/6 );
Previous
Next Post »