Autonomous Recursive Moving Average


People often ask me what is my best indicators, i can't really respond to this question with a straight answer but i would say you to check this indicator. The Autonomous Recursive Moving Average (ARMA) is an adaptive moving average that try to minimize the sum of squares thanks to a ternary operator, this choice can seem surprising since most of the adaptive moving averages adapt to a smoothing variable thanks to exponential averaging, but there are lot of downsides to this method, i really wanted to have a flat filter during flat markets and this is what i achieved.

The Indicator

length control the amount of smoothing during trending periods, gamma is the trend sensitivity threshold, higher values of gamma will make an overall flat filter, adjust gamma to skip ranging markets.

gamma = 2, we can adjust to 3 while preserving smoothing reactivity with trading periods.

gamma = 3

low length and higher gamma create more boxy result, the filter add overshoots directly in the output, its unfortunate.

The Zero-Lag option can reduce the lag as well as getting additional flat results without changing gamma.


The indicator need work, but i can't leave without publishing it, the overshoots are a big problems, changing sma for another stable filter can help. I hope you find an use to it, i really like this indicator.

Thanks for reading


Become a Patreon and get access to exclusive technical indicators!

You can also check out some of the indicators I made for luxalgo :

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。