Following the Trend With the Adaptive Moving Average.

Creating a New Strategy on the Adaptive Moving Average.

Sofien Kaabar, CFA
8 min readMar 10, 2022


Adaptive moving averages offer the opportunity to take into account multiple variables in order to reflect better the current conditions and to avoid whipsaws. This article discusses a certain type of strategies to be applied on adaptive moving averages.

I have just released a new book after the success of my previous one “The Book of Trading Strategies”. It features advanced trend-following indicators and strategies with a GitHub page dedicated to the continuously updated code. Also, this book features the original colors after having optimized for printing costs. If you feel that this interests you, feel free to visit the below Amazon link, or if you prefer to buy the PDF version, you could contact me on LinkedIn.

The Adaptive Moving Average

Moving averages help us confirm and ride the trend. They are the most known technical indicator and this is because of their simplicity and their proven track record of adding value to the analyses. We can use them to find support and resistance levels, stops and targets, and to understand the underlying trend. This versatility makes them an indispensable tool in our trading arsenal.

As the name suggests, this is your plain simple mean that is used everywhere in statistics and basically any other part in our lives. It is simply the total values of the observations divided by the number of observations. Mathematically speaking, it can be written down as:

We can see that the moving average is providing decent dynamic support and resistance levels from where we can place our orders in case the market goes down there. The code for the moving average can be written down as the following:

def ma(Data, lookback, what, where):

for i in range(len(Data)):
try:Data[i, where] = (Data[i - lookback + 1:i + 1, what].mean())…



Sofien Kaabar, CFA

Top writer in Finance, Investing, Business | Trader & Author

Recommended from Medium


See more recommendations