Skip to main content

Smoothed Sensitive MA for Amibroker (AFL)

augubhai almost 6 years ago Amibroker (AFL)

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

This moving average is sensitive and reacts quickly to significant price movements, while remaining indifferent to small price moves.

Smoothed Sensitive MA is triple weighted for price changes.

The parameter "Periods"is used as both
1. the lookback period for price change,
zCC=abs(P-Ref(P,-Periods));

and also as
2. the number of periods to be averaged
zSSMA=Sum(zCC*zCC*zCC*P,Periods)/Sum(zCC*zCC*zCC,Periods);

Alternatively, you could modify the script to use two separate parameters for values for 1 and 2.

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Smoothed Sensitive MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 125, 2, 300, 1);
zCC=abs(P-Ref(P,-Periods));
zSSMA=Sum(zCC*zCC*zCC*P,Periods)/Sum(zCC*zCC*zCC,Periods);
Plot( zSSMA, "SSMA", ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

1 comments

1. TN2023
over 3 years ago

Hello,

Thanks for the code! Is there a way to create a buy/sell signal filter using Analysis when the price line crosses with SSMA?

Leave Comment

Please login here to leave a comment.