Adaptive average using AMA()

Hi Tomasz,

In the manual the AMA() entry gives an example of an adaptive moving average.

The central piece of the code recalls Dreiss's work, The Ink, and I get that. Distance travelled versus distance as the crow flies. What I don't get is this line.
sc =( ER*(fast-slow)+slow)^2;
Could you explain what you are doing there?



@BBands I believe that he was using the Perry Kaufman Adaptive Moving Average as an example of how to use the AMA() function. I believe Kaufman first wrote about this idea in his 1995 book "Smarter Trading". Kaufman explains the concept well in his book (and I am sure there must be some articles since then where he also discuss' it? - the June 1995 issue of Technical Analysis of Stocks and Commodities magazine)

Some basic info available on the internet, Kaufman’s Adaptive Moving Average (KAMA) - Overview, How to Calculate


Thanks for the trail head, I have that book.


That work is indeed discussed in Chapter 8 of "Smarter Trading", but I think that the core concept dates back the Australian commodity analyst E. W. Driess's work on the Choppiness Index. Here is a link to a 1993 write up by Gibbons Burke.

Tip o' de hat,


The concept is super simple:

  1. you measure volatility
  2. you adjust smoothing factor (or "length" of average or cutoff frequency of the filter) so it is "shorter" when volatility is high

The AMA example uses very simple sum of one-bar differences, but @BBands may prefer to use StDev( C, 10 ) as a measure of volatility (since StDev is used for Bollinger Bands :slight_smile: ) and call it "Bollinger Adaptive MA" :slight_smile:

Bill Dreiss about the Choppiness Index (and how he uses it):

1 Like

Thanks alligator, I really enjoyed that.