everget

[RESEARCH] Mean Absolute Deviation

Hello traders and developers!

I was wondering how built-in "dev" function in Pine is calculated so I made a little research.

I examined 7 samples:
0) "dev" function itself
1) "dev" according to its description: series - sma (series)
2) Mean Absolute Deviation
3) ratio of the absolute difference from 1) divided by period
4) ratio of the difference from 1) divided by period
5) Median Absolute Deviation
6) tricky for-loop to calculate Mean Absolute Deviation

The results of the null and sixth samples are identical.

So, TV built-in "dev" function represents Mean Absolute Deviation and it's description is incorrect.

Where it is used? For example: Commodity Channel Index . You can check its original formula and if you used simple standard deviation instead of MAD in your CCIs - well guys, you were wrong.

Good luck!
Favori Komutlardan Çıkart Favori Komutlara Ekle
A list of Free indicators:
https://bit.ly/2S7EPuN

A list of Paid indicators:
https://bit.ly/33MA81f

Earn $30:
https://www.tradingview.com/gopro/?share_your_love=everget

Toss a coin to your witcher:
PayPal: https://www.paypal.me/alexeverget

Yorumlar

Hey everget. Thanks for everything you do and your contribution to the community! I'm working on this problem and I'd like to use the "dev" function with a "len" that is a series output. Am I reading this correctly that the only way to do this is to use the "for" loop and get accurate results?
pinecoders provided everyone with functions for SMA, Stdev, Sum, and others that create the ability to use a series as the length. Would this be possible for dev as well?

Again, can't thank you enough =)
+1 Cevap Gönder
kurtsmock everget
@everget, Great stuff. Thanks so much. I really appreciate it!
+1 Cevap Gönder
Nice, thanks!
+1 Cevap Gönder
NikoBellic90 NikoBellic90
@everget - are you using CCI a lot ?
Cevap Gönder
everget NikoBellic90
@NikoBellic90, nope. It is similar to Bollinger
Cevap Gönder
Thanks for sharing :) more things to try with BBs :)
+1 Cevap Gönder
everget puppytherapy
@puppytherapy, nemas zac)
Cevap Gönder
I absolutely love these indicators
+1 Cevap Gönder
everget overttherainbow
@overttherainbow, me too)
Cevap Gönder
Ana Sayfa Hisse Senedi Takipçisi Forex Takipçisi Kripto Takipçisi Ekonomik Takvim Nasıl Çalışır Grafik Özellikleri Ücretlendirme Tanıdık yönlendirme Kurallarımız Destek Merkezi Web Sitesi & Aracı Kurum Çözümleri Görsel Bileşenler(Widget) Grafik Çözümleri Hafif Grafik Kitaplığı Blog ve Haberler Twitter
Profil Profil Ayarları Hesap ve Ödemeler Tavsiye edilen arkadaşlar Koinler Destek Kayıtlarım Destek Merkezi Yayınlanmış Fikirler Takip Edenler Takip ediliyor Özel Mesajlar Sohbet Çıkış