Dynamically Adjustable Moving Average


The Dynamically Adjustable Moving Average (AMA) is an adaptive moving average proposed by Jacinta Chan Phooi M’ng (1) originally provided to forecast Asian Tiger's futures markets. AMA adjust to market condition in order to avoid whipsaw trades as well as entering the trending market earlier. This moving average showed better results than classical methods (SMA20, EMA20, MAC, MACD , KAMA , OptSMA) using a classical crossover/under strategy in Asian Tiger's futures from 2014 to 2015.

Dynamically Adjustable Moving Average

AMA adjust to market condition using a non-exponential method, which in itself is not common, AMA is described as follow :

1/v * sum(close,v)

where v = σ/√σ

σ is the price standard deviation.

v is defined as the Efficacy Ratio (not be confounded with the Efficiency Ratio). As you can see v determine the moving average period, you could resume the formula in pine with sma(close,v) but in pine its not possible to use the function sma with variables for length, however you can derive sma using cumulation.

sma ≈ d/length where d = c - c_length and c = cum(close)

So a moving average can be expressed as the difference of the cumulated price by the cumulated price length period back, this difference is then divided by length. The length period of the indicator should be short since rounded version of v tend to become less variables thus providing less adaptive results.

AMA in Forex Market

In 2014/2015 Major Forex currencies where more persistent than Asian Tiger's Futures (2) , also most traded currency pairs tend to have a strong long-term positive autocorrelation so AMA could have in theory provided good results if we only focus on the long term dependency.AMA has been tested with ASEAN-5 Currencies (3) and still showed good results, however forex is still a tricky market, also there is zero proof that switching to a long term moving average during ranging market avoid whipsaw trades (if you have a paper who prove it please pm me).


An interesting indicator, however the idea behind it is far from being optimal, so far most adaptive methods tend to focus more in adapting themselves to market complexity than volatility . An interesting approach would have been to determine the validity of a signal by checking the efficacy ratio at time t. Backtesting could be a good way to see if the indicator is still performing well.


(1) J.C.P. M’ng, Dynamically adjustable moving average (AMA’) technical
analysis indicator to forecast Asian Tigers’ futures markets, Physica A (2018),


Phát hành các Ghi chú: -Calculation errors fixed

-Two inputs short/long added for the efficacy ratio calculation, long is should always be greater than short, short is the moving average period when market is trending and long the period when market ranging.

If you still have an error try to reduce long or increase short.

-Increased line width.
Phát hành các Ghi chú: - Added the option to change colors based on if price is greater/lower than the moving average.
Gỡ bỏ khỏi Script Ưa thích Thêm vào Script Ưa thích
« Je suis las des cruautés de mes semblables, qui ne sont pas mes pareils.

« Je prendrai l’essor et je m’envolerai vers la mer.

« Je connaîtrai le goût des brises du large. J’entendrai les grands cris de la tempête.

Bình luận

Wow such a great work Alexgrover; appreciated your efforts and generosity contribute to us! =D
+1 Phản hồi
@ICEKI, Thank you very much, let me know if you have some suggestions :)
Phản hồi
Doesn't appear on crypto charts but looks amazing on forex. Nice work!
+1 Phản hồi
alexgrover jaggedsoft
@jaggedsoft, Thank you for your kind words, i updated the indicator, the methodology is similar but various parameters have been added, it should work on crypto right now, let me know if it work for you or if you have any suggestion :)
Phản hồi
GarethSA alexgrover
@jaggedsoft @jaggedsof

It is supposed to change green and red like in this above chart or just stay green?
Trying it on crypto charts
Phản hồi
alexgrover GarethSA
@GarethSA, The indicator i posted don't include color changes at the moment, but you can change the code to apply colors based on a condition. Should i include color change in a new update ?
Phản hồi
GarethSA alexgrover
@alexgrover, yes would be great
Phản hồi
Thanks dude!
Phản hồi
wroclai wroclai
Is this only for certain markets? The indicator doesn't appear to display properly on a couple of crypto charts I looked at.
Phản hồi
alexgrover wroclai
@wroclai, Its certainly because of the round function, will fix this thanks for the feedback and sorry for the inconvenience
Phản hồi
Trang chủ Bộ lọc cổ phiếu Bộ lọc Forex Bộ lọc Tiền điện tử Lịch kinh tế Cách thức hoạt động Tính năng Biểu đồ Trả phí Giới thiệu bạn Quy tắc Áp dụng Trung tâm Trợ giúp Giải pháp cho Website & Nhà môi giới Widget Giải pháp biểu đồ Thư viện Biểu đồ Lightweight Blog & Tin tức Twitter
Hồ sơ Tùy chỉnh Hồ sơ Tài khoản và Thanh toán Giới thiệu bạn Xu Ticket Hỗ trợ của tôi Trung tâm Trợ giúp Các ý tưởng đã đăng Người theo dõi Đang theo dõi Tin nhắn riêng Trò chuyện Đăng xuất