Personal Finance & Money Asked by Geek on June 2, 2021
I have been trying to code a VWAP implementation in my Python code. I used the formula that is suggested on many sites:
VWAP = (Typical Price x Interval Volume) / Cumulative Volume
However the values of VWAP as coming on investing.com are different than what I get by using this formula. is there a different way to calculate VWAP ?
The Python code that I wrote on similar lines is below :
''' typicalPrice = (open + high + low)/3
VP = volume * typicalPrice
totalVolume = np.cumsum(volume)
totalVP = np.cumsum(VP)
VWAP = totalVP/totalVolume'''
I am using TA-LIB python library in my code and it doesn’t have a VWAP implementation.
Are there any other Python libraries which have VWAP implementation ?
Thanks in advance.
I don't know a thing about Python nor have I ever looked at the VWAP indicator.
What I can tell you are trying to replicate an indicator that involves moving averages or some sort of cumulative sum or difference, the respective indicator values will not be the same unless the data values and the data period used is same.
Answered by Bob Baerker on June 2, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP