Anchored VWAP
Forums › ProRealTime English forum › ProBuilder support › Anchored VWAP
- This topic has 19 replies, 1 voice, and was last updated 3 years ago by Luciole.
-
-
10/17/2017 at 2:11 PM #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
10/17/2017 at 2:59 PM #4968710/17/2017 at 7:56 PM #49731Hey 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!
10/17/2017 at 10:18 PM #49747Just 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.
10/18/2017 at 7:10 AM #49764Hi, 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.
10/18/2017 at 9:05 AM #49779There 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.
10/18/2017 at 3:36 PM #49843Thank 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
10/18/2017 at 5:13 PM #4985510/18/2017 at 5:41 PM #4986010/19/2017 at 8:44 AM #4990010/19/2017 at 8:59 AM #49906That 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
10/19/2017 at 9:06 AM #49907I 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.
10/19/2017 at 9:25 AM #49915The indicator is now available here: anchored VWAP on chart
10/19/2017 at 8:18 PM #4999001/05/2019 at 11:03 PM #88050Hello 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?
-
AuthorPosts