alexgrover

Adaptive Autonomous Recursive Moving Average

Introduction

Using conditions in filters is a way to make them adapt to those, i already used this methodology in one of my proposed indicators ARMA which gave a really promising adaptive filter, ARMA tried to have a flat response when dealing with ranging market while following the price when the market where trending or exhibiting volatile movements, the filter was terribly simple which is one of its plus points but its down points where clearly affecting its performance thus making it almost impractical.

Today i propose a new filter A2ARMA which aim to correct all the bad behaviours of ARMA while having a good performance on various markets thanks to the added adaptivity.


Fixes And Changes

ARMA was dealing with terribles over/under-shoots which affected its performance, adding a zero-lag option made the thing even worse, in order to fix those mistakes i first cleaned the code, then i removed the offset for src in d, this choice is optional but the filter is sometimes more accurate this way.

The major change is the use of an adaptive moving average instead of the triangular moving average that smoothed the output, this adaptive moving average is calculated using exponential averaging while using the efficiency ratio as smoothing variable, this choice surprisingly removed the majority of overshoots while adding more adaptivity to the filter.


The Indicator

The Indicator work the same way as ARMA, not reacting during flat market periods while following the price when this one is volatile or trending. length control the smoothing amount while gamma determine how the filter is affected during flat market periods, gamma = 0 is just a double smoothed adaptive moving average , higher values of gamma will filter flat markets with a certain degree.


On Intel Corp with gamma = 0, i want to filter the flat period starting at July 10, gamma = 3 will certainly help us on this task.


Hooray, the problem appear to be solved ! Lower values of gamma also produce desirable effect as shown below :


gamma = 2

So far so good, but gamma or length might have different optimal values depending on the market, also problems still exists as shown here :


Seagate is tricky, gamma at 2.4 might help


The relationship between length and gamma is somewhat complicated.


On Different Markets

While some filters will process market price the same way no matter the market they are affected, A2ARMA will change drastically depending of the market.


On AMD


On EURUSD


On BTCUSD


Comparison With ARMA


ARMA with parameters roughly matching A2RMA, overall most of the problems i wanted to fix where indeed fixed.


Conclusion

A huge thanks for the support i received during this "Blank Page" period i'am suffering, ARMA was an indicator i really wanted to further develop without giving up on the code simplicity and i think this version might provide useful results, we can also notice that the decision making is easier with this version of the indicator thanks to the added coloring (which would have been impossible with ARMA).

My work don't have license attached to it, feel free to modify and share your findings, mentioning is appreciated :)

Thanks for reading !











إزالة من البرامج النصية المفضلة أضف إلى البرامج النصية المفضلة
You can check my indicator papers here : https://figshare.com/authors/Alex_Pierrefeu/7339466
Looks lovely, thank you :)
رد
Cool script name ...
رد
@Damians, well thx but my goal is not to provide cool names but rather cool indicators
رد
Amazing works Alex; I can see your efforts and keep enhanced; also thank you for Alishak suggestion if adding alerts that could be more powerful. Thank you All =D
+1 رد
@ICEKI, Thanks for the support ICEKI :) After reading about it i don't think it possible to set alerts on pinescript, the createalert function only help to set up the alert more easily, i will still work on it.
رد
Great script! Anyway to add alerts?
+2 رد
@AlishaK_, Thanks for the support, i will consider adding alerts in the future :)
+1 رد
AlishaK_ alexgrover
@alexgrover, hopefully so. thanks agains!
رد
Thank you Alex... Gem !!
+2 رد
alexgrover idrisbengali
@idrisbengali, I'am glad you like it, thanks for your support as always :)
+1 رد
الصفحة الرئيسية منصة الأسهم منصًة العملات منصّة العملات الرقمية جدول الأعمال الاقتصادي كيف نعمل مميزات الرسم البياني أسعار العضوية قوانين الموقع المشرفون حلول المواقع الإلكترونية والوسطاء الأدوات حلول الرسوم البيانية مركز المساعدة طلب الخصائص المدوّنة والأخبار الأسئلة الأكثر شيوعًا معرفة تويتر
الملف الشخصي إعدادات الصفحة الشخصية الحساب وإعداد الفواتير عملات TradingView تذاكر الدعم الخاصة بي مركز المساعدة أفكاري المنشورة المتابعين تتابع رسالة خاصة المحادثة تسجيل الخروج