logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
MS Support  
#1 Posted : Tuesday, November 7, 2023 6:05:19 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,926

Thanks: 85 times
Was thanked: 154 time(s) in 150 post(s)

Scott Cong’s article “An Adaptive Moving Average For Swing Trading” introduced a new way to calculate the Adaptive Moving Average. The MetaStock version of the indicator is below: 

Scott Cong's Adaptive Moving Average:

Formula:

Code:
m:= Input("Method <1= Price Displacement / 2= Max Range>", 1, 2, 1);
tp:= Input("Periods", 1, 500, 20);
m1:= Abs(C - Ref(C, -tp));
m2:= HHV(H, tp) - LLV(L, tp);
denom:= Sum(ATR(1), tp);
a:= If(m=1, m1, m2)/denom;
(a * C) + ((1-a) * If(Cum(1)=tp, Ref(C, -1), PREV))

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.