Skip to main content

Weighted MA Crossover for Amibroker (AFL)

vishalsbharati about 15 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 1)
  • Tags:
    trading system, amibroker

Weighted MA Crossover indicator best suited for low risk traders. It gives very good result for swing trading.

enjoy!!!!!!!!!!!!!

Screenshots

Indicator / Formula

Copy & Paste Friendly
_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("WMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( WMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("WMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( WMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("WMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( WMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();


P = ParamField("Price field",-1);

Buy = (EMA( P , 25) > EMA ( P , 35)) AND (EMA( P , 35) > EMA ( P , 45)) AND (EMA( P , 25)>EMA ( P , 45));
Short = (EMA( P , 25) < EMA ( P , 35)) AND (EMA( P , 35) < EMA ( P , 45)) AND (EMA( P , 25)<EMA ( P , 45));

Buy = ExRem( Buy, Short);
Short = ExRem (Short, Buy);
PlotShapes(IIf(Buy, shapeUpArrow , shapeNone), colorGreen);
PlotShapes(IIf(Short, shapeDownArrow , shapeNone), colorRed);

4 comments

about 15 years ago

Hi,

Thanks for the AFL code.

Please suggest the time frame for which it is to be applied.

Best Regards,
SKFC

2. Ricardo
about 15 years ago

Hi,

You can insert the formula the option to optimize and backtest?

huges

over 14 years ago

Interesting. The chart and the buy/sell condition do not have any relationship.

Leave Comment

Please login here to leave a comment.