Median Absolute Deviation (MAD) is a measure of variation used in a similar manner to the standard deviation. The MAD is more robust in the presence of outliers and does not require a gaussian distribution.  

 

In order to estimate the standard deviation for a gaussian distribution the MAD can be multiplied by 1.4826

 

Syntax:

MedianAbsoluteDeviation( series, bars )

 

Parameter:

Description:

bars

The number of bars over which to find the median absolute deviation

 

Returns:

The median absolute deviation over the specified number of bars.

 

Example:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Update Indicators Script
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  MedAbsDev = IPV - Numeric Series
'  Bar_Count = 21
MedAbsDev = MedianAbsoluteDeviation( Instrument.Close, Bar_Count )
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Chart Display:

MedianAbsoluteDeviation_21-Bar

 

 

 


 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software