VWAP Indicator (wit...
 
Notifications
Clear all

VWAP Indicator (with Period)

1 Posts
1 Users
2 Likes
1,120 Views
snoperg
(@snoperg)
Posts: 15
Admin Admin
Topic starter
 

VWAP Indicator with Period

translated from https://www.tradingview.com/script/rSTNnV6B-VWAP-with-period/

 

//VWAP

 

// There are five steps in calculating VWAP:
//
// 1. Calculate the Typical Price for the period. [(High + Low + Close)/3)]
// 2. Multiply the Typical Price by the period Volume (Typical Price x Volume)
// 3. Create a Cumulative Total of Typical Price. Cumulative(Typical Price x Volume)
// 4. Create a Cumulative Total of Volume. Cumulative(Volume)
// 5. Divide the Cumulative Totals.
//
// VWAP = Cumulative(Typical Price x Volume) / Cumulative(Volume)

//Period = 14

set tPrice = (high + low + close) / 3
set tPriceVolume = tPrice * volume
//cumulative sum with period 14
set ctPriceVolume = sum(tPriceVolume , 14)
set cVolume = sum(volume, 14)

set vwap = ctPriceVolume / cVolume

plot(vwap , line, any, main)

1618845358-vwap.jpg
 
Posted : 19/04/2021 11:15 pm
makku and jamesacre reacted
Share: