NexusFi: Find Your Edge


Home Menu

 





Moving Standard Deviation


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one jwhtrades with 6 posts (0 thanks)
    2. looks_two bobwest with 4 posts (3 thanks)
    3. looks_3 Fat Tails with 2 posts (4 thanks)
    4. looks_4 choke35 with 2 posts (1 thanks)
      Best Posters
    1. looks_one Fat Tails with 2 thanks per post
    2. looks_two Big Mike with 1 thanks per post
    3. looks_3 bobwest with 0.8 thanks per post
    4. looks_4 choke35 with 0.5 thanks per post
    1. trending_up 8,089 views
    2. thumb_up 9 thanks given
    3. group 4 followers
    1. forum 15 posts
    2. attach_file 4 attachments




 
Search this Thread

Moving Standard Deviation

  #11 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,168 since Jan 2013
Thanks Given: 57,452
Thanks Received: 26,278


choke35 View Post
Before re-inventing the wheel: The indicator that you are looking for is called Bollinger's %B.

Standard configuration - as shown - is +/- 2 SD around a 20 period SMA.
Bollinger himself uses a 0/100 scaling instead of 80/20 (because in relation to 2 SDs 80%/20% don't really make much sense).
He just wants to know how much of +/- 2 SDs are maxed out.

I was wondering about whether the indicator in the chart was showing a percentage. I guess I should have pushed on a bit, but the formula given was just for standard deviation by itself....

Thanks for the complete answer.

Bob.

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #12 (permalink)
 
jwhtrades's Avatar
 jwhtrades 
woodstock, ga
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: Futures, TF, CL
Posts: 163 since Feb 2011
Thanks Given: 670
Thanks Received: 92

Thanks


choke35 View Post
You can download it here:


(Default style is bar here, but you can switch it to line - which would be standard.)


Started this thread Reply With Quote
  #13 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



jwhtrades View Post
The 20-period standard deviation for the data above is 6.787. Note that this is the "full population" version of the Standard Deviation. There is a different kind of Standard Deviation calculation that is used when you are taking a statistical sample of a population, but that version is not used in technical analysis since all of the data points are known.

You are correct in your assumption that all data points are known. However, the data points are not the 20 bar closes that you mention, but all transactions that occured during the period represented by the 20 bar. This clearly shows that you only use a meagre sample of all trades to approximate the standard deviation.

To calculate the correct standard deviation, you should use unfiltered tick data and then calculate the standard deviation from the full population.

But even if you do not have full resolution tick data available, but only have the OHLC and volume data from the last 20 bars, you can do much better than calculating the standard deviation from the closes:

-> first of all you can take into account the volume of each of the 20 bars
-> also the bar close should be replaced with a better price such (open + high + low + close)/4


The chart below shows how a modified calculation of the standard deviation which uses 80 sample points and takes into account volume (blue plot) gives us a better approximation of the population standard deviation than the simple formula based on 20 closes (orange plot).


Reply With Quote
Thanked by:
  #14 (permalink)
 
jwhtrades's Avatar
 jwhtrades 
woodstock, ga
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: Futures, TF, CL
Posts: 163 since Feb 2011
Thanks Given: 670
Thanks Received: 92

Thanks Harry,

I've done an advanced search to try and find your anaStdDevBands and have not been successful. Can you provide the link please.

All the best,
John


Fat Tails View Post
You are correct in your assumption that all data points are known. However, the data points are not the 20 bar closes that you mention, but all transactions that occured during the period represented by the 20 bar. This clearly shows that you only use a meagre sample of all trades to approximate the standard deviation.

To calculate the correct standard deviation, you should use unfiltered tick data and then calculate the standard deviation from the full population.

But even if you do not have full resolution tick data available, but only have the OHLC and volume data from the last 20 bars, you can do much better than calculating the standard deviation from the closes:

-> first of all you can take into account the volume of each of the 20 bars
-> also the bar close should be replaced with a better price such (open + high + low + close)/4


The chart below shows how a modified calculation of the standard deviation which uses 80 sample points and takes into account volume (blue plot) gives us a better approximation of the population standard deviation than the simple formula based on 20 closes (orange plot).



Started this thread Reply With Quote
  #15 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


jwhtrades View Post
Thanks Harry,

I've done an advanced search to try and find your anaStdDevBands and have not been successful. Can you provide the link please.

All the best,
John

I have not had the time to put it into Big Mike's downloads. I will send you a link to the indicator via private message.

Reply With Quote
Thanked by:
  #16 (permalink)
 
jwhtrades's Avatar
 jwhtrades 
woodstock, ga
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: Futures, TF, CL
Posts: 163 since Feb 2011
Thanks Given: 670
Thanks Received: 92

Thanks for your quick reply. Look forward to receiving your link and trying this indicator.

Cheers,
John


Fat Tails View Post
I have not had the time to put it into Big Mike's downloads. I will send you a link to the indicator via private message.


Started this thread Reply With Quote




Last Updated on August 22, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts