Skip to main content

Candlestick above SMA 20 for Amibroker (AFL)

tjhailioe about 16 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 1)
  • Tags:
    amibroker, moving average

Shows signals if candle above sma 20. Buy if candle above sma 20 and sell if bellow sma 20. Be careful about false signals it is safer if you wait for confirmation from the next candle or you wait until the price is going up.

I hope it useful for your trading from your friend tjhailioe@gmail.com

Screenshots

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("scaner if above SMA20 buy");

Buy = Cross( C,MA( Close, 20 ) );
PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-20);
_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", 20);
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

1 comments

almost 6 years ago

Hi Sir,
The sell is not working where as the buy is working perfect. Please look into this at the earliest.

Leave Comment

Please login here to leave a comment.