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!
Remove from Favorite Scripts Add to Favorite Scripts
A list of Free indicators: https://bit.ly/2S7EPuN
A list of Paid indicators: https://bit.ly/2SQOhDF

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

Comments

Nice, thanks!
+1 Reply
NikoBellic90 NikoBellic90
@everget - are you using CCI a lot ?
Reply
everget NikoBellic90
@NikoBellic90, nope. It is similar to Bollinger
Reply
Thanks for sharing :) more things to try with BBs :)
+1 Reply
everget puppytherapy
@puppytherapy, nemas zac)
Reply
I absolutely love these indicators
+1 Reply
everget overttherainbow
@overttherainbow, me too)
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out