Daily Distribution Lines (standard deviation)

Completed

Comments

7 comments

  • Tiki Dave

    Aloha there Accendo - I just shared an enhanced version of Tradovate's VWAP indicator called "Tiki VWAP".  

    It doesn't have 68% or 95% bands plotted, but it does plot bands using a formula I have seen to calculate 1st and 2nd std deviations. If you have a formula I could look at to double-check my work that would be great!

    Hope this helps, it definitely helps me spot opportunities such as in the chart attached.

    0
    Comment actions Permalink
  • Accendo

    That's awesome - I'm going to reach out to support to figure out why your indicators do not show up for me.  Thanks so much for your time and effort

    0
    Comment actions Permalink
  • Patrick

    Where can I get your VWAP indicator Tiki? Thanks

    0
    Comment actions Permalink
  • Tiki Dave

    Sorry, I missed your post.  It's in the Code Explorer and called "Tiki VWAP". 

    0
    Comment actions Permalink
  • Cameron Osborne

    The formula used to calculate the rolling standard deviation is incorrect. The correct formula is located here in this code. There is a comment in the source code with a link on all manner of rolling standard deviation and moving average calculations, many goodies. 

    https://www.tradingview.com/script/dQF211AS-Multi-Timeframe-VWAP/

    0
    Comment actions Permalink
  • Cameron Osborne

    That is my trading view profile, I am pretty active on there in the community with script development.

    0
    Comment actions Permalink
  • Cameron Osborne

    Look for this section of the source code:

    getVWAP(newSession) =>
        p = iff(newSession, hlc3 * volume, p[1] + hlc3 * volume)
        vol = iff(newSession, volume, vol[1] + volume)
        v = p / vol

        // Incremental weighted standard deviation (rolling)
        // http://people.ds.cam.ac.uk/fanf2/hermes/doc/antiforgery/stats.pdf (part 5)
        // x[i] = hlc3[i], w[i] = volume[i], u[i] - v[i]

        Sn = iff(newSession, 0, Sn[1] + volume * (hlc3 - v[1]) * (hlc3 - v))
        std = sqrt(Sn / vol)

        [v, std]

    The link and section of that article show just how the standard deviation is calculated from point to point, or in our case, candle to candle. You would need to adjust maybe less than 3 lines of code for the final STD calculation in both places where a d.profile() (volume profile exists) or when it doesn't exist. 

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk