NexusFi: Find Your Edge


Home Menu

 





VWAP bands


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 44 posts (111 thanks)
    2. looks_two syxforex with 10 posts (6 thanks)
    3. looks_3 Big Mike with 8 posts (6 thanks)
    4. looks_4 forrestang with 8 posts (1 thanks)
      Best Posters
    1. looks_one gtichauer with 7 thanks per post
    2. looks_two Fat Tails with 2.5 thanks per post
    3. looks_3 Big Mike with 0.8 thanks per post
    4. looks_4 syxforex with 0.6 thanks per post
    1. trending_up 65,506 views
    2. thumb_up 153 thanks given
    3. group 33 followers
    1. forum 102 posts
    2. attach_file 49 attachments




 
Search this Thread

VWAP bands

  #1 (permalink)
 crazybears 
Alesia E.U.
 
Experience: Intermediate
Platform: Sierra chart
Trading: Futures
Posts: 168 since Feb 2011
Thanks Given: 146
Thanks Received: 115

Hello

a friend of mine was showing me Marketdelta and its features, when he plotted VWAP indicator , i've seen something seems me wrong.
when price makes a big movement, the bands don't widen as result by the price movements but they tend to follow the price .
this is the same either the price goes up or go down.

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
What broker to use for trading palladium futures
Commodities
ZombieSqueeze
Platforms and Indicators
 
  #2 (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,103


crazybears View Post
Hello

a friend of mine was showing me Marketdelta and its features, when he plotted VWAP indicator , i've seen something seems me wrong.
when price makes a big movement, the bands don't widen as result by the price movements but they tend to follow the price .
this is the same either the price goes up or go down.

The bands should widen after a sharp move, but to further explore the behaviour, you should post both a chart and the code of the indicator.

Reply With Quote
  #3 (permalink)
 crazybears 
Alesia E.U.
 
Experience: Intermediate
Platform: Sierra chart
Trading: Futures
Posts: 168 since Feb 2011
Thanks Given: 146
Thanks Received: 115


Hi Fat Tail

I've not the code , i think it's coded inside market delta and it's no possible to see the code.

see this chart ,it's investor R/T but is the same strange movement i saw on market delta.


Started this thread Reply With Quote
  #4 (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,103


crazybears View Post
Hi Fat Tail

I've not the code , i think it's coded inside market delta and it's no possible to see the code.

see this chart ,it's investor R/T but is the same strange movement i saw on market delta.



I can see that the bands widen after a sharp price movement as they should. Of course, the bands also follow price, as they are bands around the VWAP, and the VWAP follows price, as it is an average price.

Reply With Quote
  #5 (permalink)
beowulfit
Prague, Czech republic, Europe
 
Posts: 3 since Sep 2010
Thanks Given: 0
Thanks Received: 1


Fat Tails View Post
I can see that the bands widen after a sharp price movement as they should. Of course, the bands also follow price, as they are bands around the VWAP, and the VWAP follows price, as it is an average price.

Here you can see how have to work bands (right pic is Ninja trader 7) and how work in MD.
Lows bands can't follow the trend when a sharp price movement occurs.

Attached Thumbnails
Click image for larger version

Name:	std sball.PNG
Views:	1294
Size:	328.5 KB
ID:	39498  
Reply With Quote
Thanked by:
  #6 (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,103


beowulfit View Post
Here you can see how have to work bands (right pic is Ninja trader 7) and how work in MD.
Lows bands can't follow the trend when a sharp price movement occurs.

There is certainly no way how bands have to work. It really depends on the definition of the bands. I have an idea, what may have caused the difference.

The bands are calculated by starting with the VWAP and then adding and subtracting multiples of the standard deviation. The VWAP only depends on the exact session chosen, so there is not much room for discussion. It may lack precision, if the resolution of the bars is insufficient, but it will certainly be close to identical for all charting software packages, if you apply it to a 1 min chart.

The difference comes from the standard deviation

So the problem comes with the standard deviation. There are different ways to define it. Let us first have a look at the Bollinger Bands with a period N. The standard deviation is calculated in the following way:

-> Calculate moving average as sum of last N closes divided by N
-> Calculate the squares of the difference between the n close and the last value of the moving average
-> Add up the square to calculate the variance
-> The square root of the variance is the standard deviation
-> Add and subtract a multiple of the standard deviation to the moving average

This is pretty straight forward. For the Bollinger bands the period of the standard deviation remains constant, so you can compare the standard deviation of yesterday at 10:00 AM to the standard deviation today at 3:00 PM.

The VWAP is an entirely different animal. It is a moving average with an ever increasing period until the session closes. If you calculate the standard deviation in a similar fashion as for the Bollinger Bands, you will start with a small period standard deviation and then have a standard deviation with a large period at the end of the session. Any bands calculated in the same way as the Bollinger Bands are therefore of little use. I can imagine different ways to calculate a standard deviation which is more in line with the requirement to get meaningfull bands.

Standard deviation is a measure of dispersion as is the average true range, and in a first approximation I would assume that the (average) value of the standard deviation increases with the square root of the period N. So one option would be to calculate the standard deviation in the same way as it is calculated for the Bollinger Bands, taking into account the ever increasing period and converting it to a fixed period standard deviation.

Different ways to calculate standard deviation

Another way to cope with the problem would be to calculate a standard deviation from differences of the closes and the value of the VWAP corresponding to that close. See the difference:

-> for a Bollinger Band you take n different closes and subtract each of them the last value of the moving average
-> for the standard deviation of the VWAP bands you could take n different closes and substract each of them from the corresponding of the last n values of the VWAP, meaning you take a different value for the moving average each time

Applying the second method will get you the standard deviation of the average distance of price from the VWAP.

How have different software packages implemented the bands?

To summarize, there can be at least 3 different methods to calculate standard deviation bands for the VWAP. What we have to find out now, is how the different software packages calculate those bands, and which of the options is most suited to trading.

I will have a look at the code and come back.

Reply With Quote
  #7 (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,103

I had a look at the NinjaTrader VWAP. It comes with two different options to calculate the standard deviation, one of them is called VWAP, the other one AvgVWAP.

The VWAP mode is comparable to a Bollinger Band with an increased period. Of course, if the volume of a bar takes the value k, the period is increased by k, and the values are stored in an array. The standard deviation is then calculated by using the last value of the VWAP as an input for the variance. So this is a non-corrected version.

If there is a sudden move of price with high volume, this drags the VWAP aways from its prior balance, which means that the variance of all data points that had already been collected increases as well. And as there are no dropouts at the beginning of the period, as would be the case for Bollinger Bands with its moving average, the variance of the old data points increases.

I am not sure that this makes sense, but it is the outcome that @ beowulfit showed on his chart.

The other option with an average price of the VWAP is quite a peculiar approach. It is not a standard deviation of price relative to an average, but a standard deviation of the VWAP relative to its average price (the average of all VWAPs). I don't see any point in calculating this and won't further comment it.

The two different approaches can be seen on the charts below. Neither calcualtion method for the bands is identical with the solution adopted by Inverstor RT or Ensign Windows.

Attached Thumbnails
Click image for larger version

Name:	AvgVWAP.jpg
Views:	865
Size:	107.9 KB
ID:	39503   Click image for larger version

Name:	VWAP.jpg
Views:	748
Size:	100.8 KB
ID:	39504  
Reply With Quote
  #8 (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,103

Investor RT has different options to plot the bands. Some of the options use my suggestions from post #6.

Option 1: Use the variance of the difference (close - average) by using the average at the time of the close.
Option 2: Use a quarter of the session range up to that point
Option 3: Use the average bar range of the last 20 bars (this is more like a Keltner Channel thing applied to VWAP)
etc.

Options 1 and 2 will give you bands that expand over the lifetime of the session. This is unlike Bollinger Bands, which expand and contract, but do not have a trend of continuous expansion.

Option 3 does not expand, but you could use the average true (using simple smoothing instead of exponential smoothing) over the session.

There are also proprietary ways of calculating bands, which are not disclosed.

Here is the link to explore:

Investor/RT Tour - [AUTOLINK]Volume Weighted Average Price[/AUTOLINK] ([AUTOLINK]VWAP[/AUTOLINK])

Reply With Quote
  #9 (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,103

The standard deviation is based on the distance of the price from the VWAP. This is the same as option 1 as explained for Investor R/T.

Ensign Software - Studies: [AUTOLINK]VWAP[/AUTOLINK] Volume-Weighted Average Price

Reply With Quote
  #10 (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,103


Had a look at the NinjaTrader VWAP bands again. They are not correct. I am referring to this indicator:

NinjaTrader Support Forum - View Single Post - Vwap

which seems to be identical with the VWAP in the download section of the NinjaTrader forum.

The chart below shows VWAP (red) and standard deviation bands as calculated by the NinjaTrader VWAP (blue bands) and an indicator that I have coded for testing (slate gray bands). After two bars into the session, it is easy to calculate the standard deviation manually:

Standard Deviation = SQRT (((1.4273 - 1.4266)*(1.4273-1.4266)*1683 + (1.4277-1.4273)*(1.4277-1.4273)*3496)/5179)
= SQRT((0.0007*0.0007*1683 + 0.0004*0.0004*3496)/5179)
= 0.0001 SQRT (49*1683 + 16*3496)/5179)
= 5.17 pips

This shows that the blue bands are too narrow and do not catch volatility correctly, the standard deviation after two bars is around 5 pis and not 1 pip as shown by the NinjaTrader VWAP indicator.

Any comment on this appreciated.



Reply With Quote




Last Updated on March 6, 2012


© 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