TradingView
CapitalMastery
May 15, 2020 10:01 AM

Rolling Multiday VWAP 

Datadog, Inc.NASDAQ

Description

Couldn't find a VWAP script that worked the way I needed so I created this one. Basically, it provides a multiday rolling VWAP. I made the rolling period configurable, but I primarily use it to add a 2 day VWAP to my chart alongside the standard VWAP indicator. This unique thing that this indicator does is dynamically anchor to the configured period, but starting from today backwards.


Basically, this indicator ensures VWAP never anchors to the current day, but instead always shows a 2 day VWAP on today's charts. The problem I had with other indicators is that every other day my 2 day VWAP indicator would anchor to the current day and essentially become a redundant standard VWAP indicator.

Hope to update in the future to dynamically update based the chart day you have in focus, but will need some time to figure out if that's even possible.

Release Notes

Refactored the original indicator/script to fix a number of bugs, and make the lookback period (in days) configurable. Enjoy!

Release Notes

Updated chart, and added documentation.

Release Notes

Fixed lookback period bug
Comments
CapitalMastery
Hey guys, I realized there's a bug in my indicator that causes it to only work as a 2-day VWAP indicator for now, and as long as it's set to the default 1D. I'll def fix this as soon as I have time, but just a heads up in case you're trying to use it for anything other than a 2-day VWAP.
CapitalMastery
FYI, this has been fixed.
freelight
@CapitalMastery, Thanks can we now set different durations? e.g. 7 days?

From your experience, what is a good lookback for cryptocurrencies? Thanks
bwenman
Multiday VWAP suddently disappeared off my charts. The key is still there under the ticker symbol but when you click on it, it highlights the VWAP line and changes its colour to the Multiday VWAP line. Tried deleting and adding it back. Any ideas? Thanks.
tabby73
If there is a holiday during weekdays, 2 Day VWAP is now showing up. Could you fix this?
Ruggedreality
This is awesome. I have the multiday VWAP for TOS, but tried to write the code very similar to TOS but didnt work. So thank you for writing one up.
joeswing
On NQ1! (RTH), when I use 2 instances of this, one set to 2 days, the other set to 3 days, both plot the same line.
GannPriceTimeAnalysis
can we create the indicator to calcualte monthly vwap
ShrewdTechy
This script is literally almost perfect for using VWAPs as a trading strategy. Having a 2 and 3 day VWAP along with the TV session VWAP is legit. Could this script be updated to work based off of sessions instead of calendar dates? Runs into issues with market holidays and weekends?
zografa
Hey buddy, great one! Could you think of a way to plot historically? I mean to plot lets say the 2-day rolling VWAP for 30-60-90 periods back?
More