mean absolute deviation formula - futures io
futures io futures trading



mean absolute deviation formula


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one raker with 2 posts (0 thanks)
    2. looks_two sptrader with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 BobF with 1 posts (0 thanks)
    1. trending_up 2,506 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

mean absolute deviation formula

(login for full post details)
  #1 (permalink)
Birmingham , United Kingdom
 
 
Posts: 2 since Dec 2013
Thanks: 0 given, 0 received

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.

THx

Reply With Quote

Can you help answer these questions
from other members on futures io?
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
Webinar: Finding your own way in trading w/Adam Grimes
The Elite Circle
What blockvolume is visible? - order processing
NinjaTrader
Short Interest Ratio indicator?
ThinkOrSwim
Automatic pattern research with NT
Elite Algorithmic NinjaTrader Trading
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
109 thanks
Battlestations: Show us your trading desks!
108 thanks
Rank your Futures vs Stocks trading priority
55 thanks
Want your NinjaTrader indicator created, free?
27 thanks
Whats this confusion with margins?
21 thanks
 
(login for full post details)
  #3 (permalink)
Colorado
 
Experience: Advanced
Platform: MultiCharts
Broker: IB & Iqfeed
Trading: ES , CL
 
sptrader's Avatar
 
Posts: 543 since Apr 2010
Thanks: 1,094 given, 696 received



raker View Post
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.

THx

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

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Birmingham , United Kingdom
 
 
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...

Reply With Quote
 
(login for full post details)
  #5 (permalink)
Hyannis, MA
 
Experience: Advanced
Platform: TradeStation
Trading: ES
 
Posts: 3 since Nov 2011
Thanks: 0 given, 2 received

You do not specify where the data points are coming from. I assumed they are in an array.

Here is a function that should do what you want.

---

Input: aValues[S1](NumericArray), Size(NumericSimple);

Vars: j(0), Sum(0), Mean(0);

Sum = 0;
for j = 1 to Size begin
Sum = Sum + aValues[j];
end;
Mean = Sum / Size;

Sum = 0;
for j = 1 to Size begin
Sum = Sum + AbsValue(aValues[j] - Mean);
end;

MeanDeviation = Sum / Size;

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > mean absolute deviation formula


Last Updated on February 17, 2014


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts