Anchored VWAP

Viewing 15 posts - 1 through 15 (of 20 total)
  • #49684

    Dear All,

    Would anybody be able to help build an anchored VWAP tool please?

    The anchored VWAP is regular VWAP but only taking into account x number of candles previously.

    So for instance, say a stock gapped up 9 days ago, I want to use an anchored VWAP to see the VWAP upto and including that day.

    I honestly have no idea where to start coding this up!

    Thanks very much for any help!

    Jay

    #49687

    So the x number of previous candlesticks would be a manual setting for the indicator, right? somehow not something automated ..

    #49731

    Hey Nicolas,

    Yep, thats right, it would be a manual setting.

    Essentially, it is exactly the same as an EMA, but instead of price it uses volume.  Thats why I only want it to go back x candles because if it is across the entire chart, it looses responsiveness.

    Does that make sense?

    Thanks very much for your help Nicolas, very much appreciated!

    #49747

    Just to clarify on my previous post, the VWAP formula is:

    VWAP = Sum (Price[t] x Volume[t])  / Sum(Volume[t])

    Basically, I want to be able to chose t… so go back say 8 candles, so that t=8.  On the chart, this would be plotted between 8 days ago to today only.

    The reason I want to be able to do this is because as t increases, the VWAP for the current day changes.  Therefore you can get a sense of the average price the market buys under different points.

    #49764

    Hi, if you want just a ProBuilder indicator (rather than a piece of code that can be re-used in a ProOrder strategy), maybe you don’t need to build it by code, but can use the already built in VWAP or VWAP bands in PRT? These have the option of selecting a lookback period of X minutes in the top right corner of the indicator properties window. Just saying in case you didn’t see it in there… but if you need to build it with code for other reasons, or if you have an older version of PRT without it (I think it came up recently within v10.3), my apologies.

    #49779

    There are also custom VWAP indicators in the library: https://www.prorealcode.com/tag/vwap/

    Please let us know if any of our solution suits your query or not. Otherwise, I could modify the code of our VWAP indicator to include a lookback period for calculation instead of a fixed one.

    #49843

    Thank you for your replies Nicolas and Noobywan.


    @Noobywan
    – the VWAP in the software is too granular for my trading style.  I take a more swing trading approach, but the existing VWAP doesn’t allow to calculate on candles on a daily/weekly basis.


    @Nicolas
    – unfortunately those are not quite what I’m after…

    Lets say I am looking at a daily view.  Lets say 8 days ago there was a gap up, and so I want to calculate (and plot) the VWAP but only up to and including 8 days ago.  Thats because if I included more days older than 8 days ago, the VWAP would be different on each day.  In other words, I want to anchor the VWAP to 8 days ago.

    In an ideal world, in the PRT software, I would select my ‘Anchored VWAP’ code, then click a point on the chart and the VWAP would be calculated from the day I clicked… appreciate this may not be feasible though.

    The next best solution would be to add a VWAP and then set a parameter to 8 days.  Then I could add multiple anchored VWAPs to the same chart changing the parameter as necessary

    #49855

    Ok, so to be clear, you want to anchor the start of the VWAP calculation to a specific Date and Time that will not changed once you have set it? (sorry, need exact information before coding something customized).

    #49860

    Yes exactly, that’s it!

    #49900

    This is an example of what I made, VWAP start calculation from December 12th 2016 on TOTAL share. Is that ok?

    #49906

    That looks perfect Nicolas, thank you ever so much.

    The only thing I would change would be to remove all the SD (only really want the main VWAP) and have the ability to add multiple anchored VWAPs (anchored at different dates)

    Many thanks

    #49907

    I will let people to choose if they need to see SD or not (as an option in settings). You’ll be able to add multiple times the VWAP on your chart of course. I’ll post it in the library for everyone convenience, I’ll give you the link in a few minutes.

    #49915

    The indicator is now available here: anchored VWAP on chart

    #49990

    Nicolas, you are gentleman… thank you very much for this my friend!

    #88050

    Hello Nicholas,

    I posted this comment in the actual script comment section but realize now you may not receive this for some time so thought I’d comment here. I am super excited to see you having built this script (and @jaysay requesting it)! I assume he is a Brian Shannon scholar as am I. However, I am having difficulty creating this on the thinkorswim platform. I’m sure its a noob mistake, but my scripting knowledge is about nill. When I paste this script into thinkorswim, it replies with the error of “Invalid statement: // at 1:1”. When I remove the “//” of course I continually get similar errors. When I remove entire first two ‘paragraphs’ where these forward slashes occur, the script takes, but with no input ability (of course because the date settings you’ve created are removed. How can I get this thing to take?

Viewing 15 posts - 1 through 15 (of 20 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login