This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:

We work extremely hard to keep things positive on our forums.

We do not tolerate rude behavior, trolling, or vendor advertising in posts.

We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.

We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

Favorite Futures: ES ,design own advanced custom breadth indicators

Posts: 2 since Dec 2013

Thanks: 0 given,
0
received

mean absolute deviation formula

Hi there ,

New to this forumn I am looking for formula /code for the mean absolute deviation not a fixed parameter one but a variable period like what vwap is , a variable period volume weighted average . I have already written and done a formula for a variable period standard deviation because there are a couple of alternate formulas to produce the same result . But the mean absolute is proving rather difficult . The formula itself is fairly straight forward but it is proving difficult to code . I do not have a lot of experience in languages , the platform I use is Neoticker and the language they use is called "formula language" . Any help would be appreciated.

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

***************************************************************************
You said: "The formula itself is fairly straight forward", could you post the formula, and maybe we can help..

Favorite Futures: ES ,design own advanced custom breadth indicators

Posts: 2 since Dec 2013

Thanks: 0 given,
0
received

the formula is just taking the average distance away from the mean e.g. ;

take the following numbers:

1,2,3,4

add them up and divide by number of data points (4) :

(1+2+3+4)/4 =2.5 this is the mean ;

then take the mean and subtract that from each value;

(1-2.5)+(2-2.5)+(3-2.5)+(4-2.5) this gives us the following :

(-1.5)+(-0.5)+(0.5)+(1.5) at this point some we take the absolute value of the data points which basically
means get rid of the negative sign and add them up :

(1.5)+(0.5)+(0.5)+(1.5) = 4 then take this number and divide by number of data points ;

4/4 = 1 this is the mean absolute deviation.

The part I am having a problem with is the part where you subtract the mean from all the previous data points , I do not know how to loop back to previous values...