We're trying to build a VWAP based strategy in Python and for that we're calculating VWAP using the formula given below;
Σ (Volume x Price) / Σ (Volume)
After testing this across multiple stocks and across multiple timeframes, we've observed that the VWAP value calculated using the formula above does not match the VWAP value that is plotted on Kite charts (VWAP indicator line).
We know that Average Traded Price (ATP) is already provided as part of the quote packet structure but there seems to be a lot of confusion about whether ATP is the same as VWAP? General observation shows that ATP (in market depth) and VWAP (on charts) are different values for most of the time.
It'd be really helpful if someone here could help us out in calculating the correct VWAP value which matches with the VWAP value plotted on the charts.