TradingView

Rolling VWAP

TradingView Aktualisiert   
█  OVERVIEW


This indicator displays a Rolling Volume-Weighted Average Price. Contrary to VWAP indicators which reset at the beginning of a new time segment, RVWAP calculates using a moving window defined by a time period (not a simple number of bars), so it never resets.



█  CONCEPTS


If you are not already familiar with ​VWAP, our Help Center will get you started.

The typical VWAP is designed to be used on intraday charts, as it resets at the beginning of the day. Such VWAPs cannot be used on daily, weekly or monthly charts. Instead, this rolling VWAP uses a time period that automatically adjusts to the chart's timeframe. You can thus use RVWAP on any chart that includes ​volume information in its data feed.

Because RVWAP uses a moving window, it does not exhibit the jumpiness of VWAP plots that reset. You can see the more jagged VWAP on the chart above. We think both can be useful to traders; up to you to decide which flavor works for you.



█  HOW TO USE IT


Load the indicator on an active chart (see the Help Center if you don't know how).


Time period

By default, the script uses an auto-stepping mechanism to adjust the time period of its moving window to the chart's timeframe. The following table shows chart timeframes and the corresponding time period used by the script. When the chart's timeframe is less than or equal to the timeframe in the first column, the second column's time period is used to calculate RVWAP:

  Chart       Time
timeframe    period

   1min   🠆   1H
   5min   🠆   4H
   1H     🠆   1D
   4H     🠆   3D
   12H    🠆   1W
   1D     🠆   1M
   1W     🠆   ​3M

You can use the script's inputs to specify a fixed time period, which you can express in any combination of days, hours and minutes.

By default, the time period currently used is displayed in the lower-right corner of the chart. The script's inputs allow you to hide the display or change its size and location.


Minimum Window Size

This input field determines the minimum number of values to keep in the moving window, even if these values are outside the prescribed time period. This mitigates situations where a large time gap between two bars would cause the time window to be empty, which can occur in non-24x7 markets where large time gaps may separate contiguous chart bars, namely across holidays or trading sessions. For example, if you were using a 1D time period and there is a two-day gap between two bars, then no chart bars would fit in the moving window after the gap. The default value is 10 bars.



█  NOTES


If you are interested in VWAP indicators, you may find the VWAP Auto Anchored built-in indicator worth a try.


For Pine Script™ coders

The heart of this script's calculations uses the `totalForTimeWhen()` function from the ConditionalAverages library published by PineCoders. It works by maintaining an array of values included in a time period, but without a for loop requiring a lookback from the current bar, so it is much more efficient.

We write our Pine Script™ code using the recommendations in the User Manual's Style Guide.


Look first. Then leap.

Versionshinweise:
v2
Updated to include standard deviation bands adjustable from the input menu.
Versionshinweise:
v3

Updated to include 2 more sets of standard deviation bands.

Get $15 worth of TradingView Coins for you and a friend: www.tradingview.com/share-your-love/

Read more about the new tools and features we're building for you: www.tradingview.com/blog/en/
Open-source Skript

Ganz im Spirit von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es besser verstehen und überprüfen können. Herzlichen Glückwunsch an den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Veröffentlichung unterliegt den Hausregeln. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.

Möchten Sie dieses Skript auf einem Chart verwenden?