The VWAP is a ratio that measures daily the total volume of trade in a security, as well as its average price. The volume-weighted average price can also be calculated over a given period.
This indicator calculate and plot the VWAP for the Weekly, Monthly and Yearly periods. It needs, of course, that the instrument has Volumes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
//PRC_VWAP weekly,monthly,yearly //28.09.2016 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge //calculation periods if DayOfWeek=0 or (dayofweek[1]=5 and dayofweek<>5) then weekbar=barindex endif if month<>month[1] then monthbar=barindex endif if year<>year[1] then yearbar=barindex endif once dWeekly=1 once dMonthly=1 once dYearly=1 dWeekly = max(dWeekly, barindex-weekbar) dMonthly = max(dMonthly, barindex-monthbar) dYearly = max(dYearly, barindex-yearbar) VWAPweekly = SUMMATION[dWeekly](volume*typicalprice)/SUMMATION[dWeekly](volume) VWAPmonthly = SUMMATION[dMonthly](volume*typicalprice)/SUMMATION[dMonthly](volume) VWAPyearly = SUMMATION[dYearly](volume*typicalprice)/SUMMATION[dYearly](volume) RETURN VWAPweekly as "VWAP Weekly", VWAPmonthly style(line,2) as "VWAP Monthly", VWAPyearly style(line,3) as "VWAP Yearly" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
code updated with a better accuracy to calculate automatically the VWAP periods.
bonjour Nicolas pas de possibilité de contournement pour la trimestrielle ? merci
Je pense que ça doit être possible à faire bien sûr. Merci d’ouvrir un sujet dans le forum probuilder stp.
bonjour, tout nouveau ici, je recherche, concernant les vwap, l’indicateur vwap sur plusieurs UT comme ici, mais avec les PREVIOUS daily, weekly, et + en rajout ?! si vous avez un lien, merci…
Il n’existe pas encore dans la bibliothèque, merci de formuler une demande dans le forum approprié.
Hi Nicolas, is it possible to adjust the starting date of the VWAP on the charts? Thanks in advance…
Yes, have a look there: https://www.prorealcode.com/prorealtime-indicators/vwap-date-anchored/
Merci Nicolas!