VWOP: Volume Weighted & Oscillated Price

EsIstTurnt 已更新   
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.
Fix Chart

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。