VWOP: Volume Weighted & Oscillated Price

EsIstTurnt Updated   
While playing around with the standard "ta.vwap" I wondered why there was no length input, so I did some research on what the underlying calculation actually is, and did my best to augment it so as to allow for a variable length based on an oscillator value.

Normal VWAP = (Number of Shares Bought x Typical Price) / Total Volume

In my VWOP Calculation, typical price is replaced by selected moving average type or "matype" and then multiplied by the volume.
Then a total value is calculated using math.sum with a length value that changes according to a selected oscillator's value. The total is then divided by
the sum of just volume using the same oscillating length value. Result is then passed through the selected"matype" once more to give the final result.

Indicator designed for use as a entry/exit indicator in conjunction with more traditional moving averages and/or signal filters. Useful for taking volume + an oscillator into account along with price, instead of just the price as with a simple moving average.
Release Notes:
Fix Chart
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.


The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?