Anyone know how to calculate SD of VWAP?

Discussion in 'Technical Analysis' started by IronFist, Jul 23, 2008.

  1. If you have tradestation use their Bollinger Band code and substiute vwap for price.

    John
     
    #21     Jul 24, 2008
  2. I don't.

    But I tried plotting BBands of the vwap and got the same narrow useless junk that I got when I tried plotting SDs of the vwap.
     
    #22     Jul 24, 2008
  3. Iron Fist, looking at your plot, I don't think the problem is how you are caclulating the standard deviations. Rather it is in how you are calculating VWAP. That doesn't look like any kind of "average" of the price series you are showing.

    I showed the VWAP equation on an earlier post and it's also on the site that has been referenced a few times.
     
    #23     Jul 24, 2008
  4. Sorry about the identical reference, but you are still applying VWAP across periods longer than a single day, which may or may not be valid. The original definition of VWAP is strictly intraday.
     
    #24     Jul 24, 2008
  5. NP. Your hints earlier (along with Equalizer) helped me figure out what my original problem was.

    Think of it as just a fixed window function of a time series. In my case, I happened to use days, and divide the total period to apply the function to into two equally spaced windows (periods). I did this as I it was more convenient at the time to use a daily price series (I had up at the time).

    The exact same methodology applies to intra-day, only the total window period you are using to run and plot the function over is each day and the function is applied to each point in the intra-day time-series (which can further be broken up into hr/min/sec etc..).

    The intra-day definition is just a construct. The methodology applies over any time series chopped up by windowing. You could even get creative and vary the window length. Whether that is useful or not is for the user to decide/discover. Sticking to rigid rules limits creativity.:D

    Cheers,
    Dt
     
    #25     Jul 24, 2008
  6. I'm using the VWAP study in SierraChart. I'm pretty sure it's correct.
     
    #26     Jul 24, 2008
  7. Thinks about it this way. The definition for VWAP at any time n, is the series: sum of price*vol / sum vol over n steps. Well, for the very 1st tick of data
    (lets call that tick n= 1), you should be able to approximate it as just VWAP ~
    P1*V1/V1 at time n= 1. If you agree with that,
    then at that time, VWAP is simply ~P, since the Vs cancel out.

    Therefore at the 1st time instance (tick/bar/whatever you are using), shouldn't your 1st VWAP value be very close to P (or the average of P on that tick)?

    If you agree with this reasoning so far, then let me ask you this... Why is it that your 1st value of VWAP is way above the 1st price tick (like a huge offset)?

    [​IMG]

    Find any single (correct) example on the web of VWAP that has the first VWAP point so far away from the 1st price bar.
    I doubt you will.

    Can you argue against that? If so, I'd like to see an example. If not, then there is likely a problem with the way your program (or you) are calculating the VWAP values.

    dT
     
    #27     Jul 24, 2008
  8. BTW. I was assuming that your 1st bar is the first bar of the day you are plotting (can't see the numbers at the bottom too well). If not, please repost with the 1st bar of the day shown.
     
    #28     Jul 24, 2008
  9. The left side of that chart was around 11am CST.

    VWAP calculation in SierraChart starts at midnight (based on my suggestion they're going to allow that to be modified in a future release).

    On this 5min YM chart you can see that VWAP resets to the first trade at midnight CST when it rolls over.
     
    #29     Jul 25, 2008
  10. Ok, now we are talking. Notice the 1st data point in your VWAP series is ~p1 as I surmised (where they start each window at midnight). So far, so good. The VWAP even looks good through the rest of the ride side of the chart.

    The left side still has too big of a gap, however. Your argument about low volume towards the end of the day should not create a large gap like that, for a similar reason to my 1st argument about the beginning of the time series.

    Suppose the regular trading session ended (hypothetically) at time t = n = 21. Further assume that the last data pt in the 24 hr window they calculate is nf. The series would then look like

    sum (v1p1 + v2p2 +.... v21p21 +... vnfpnf)/
    sum (v1 + v2 + ... v21 + ... vnf)

    If the volume is very low on the last terms after the regular trading session close (say points v21 and forward)... then those terms would become insignificant and swamped by the prior cumulative trading vwap sums.

    i.e. think of v22 and forward equal to zero -- then regardless of the last few price terms, the volume coefficient makes the products on top very insignificant and the bottom terms become insignificant. Thus VWAP should stay about where it was towards the end of the regular trading close. It should not gap that high and remain stuck like that throughout the ending pts of the VWAP window.

    However, I really need to see more of the entire (24 hr - mid to mid) window to confirm the above. (It's possibly correct, depending on the prior swings during the day).


    I would also like to see more of the full data period for a few full windows.

    Plot out about three full days worth of data. I want to see how the VWAP responds over the full day for a few periods.

    and also verify if...
    1) the trading period they calculate VWAP over is the full 24 hour day.

    Getting there.
     
    #30     Jul 25, 2008