Hi,
I suspect that there is an issue with the automatic calculation of the Volume Weighted Average Price (VWAP), in that it seems to only calculate the average from a limited number of points.
Is this correct? And if so, how do I correct the code to instead base the VWAP on the entire series?
I noticed the potential issue when testing a live-update of my chart with some artificial data - every 3 seconds a new identical data point was added to the series. Initially, the VWAP behaves as expected, but after ~100 new points it suddenly jumps to the exact value of the added point.
Please see attached screenshot for a visual presentation of the problem. Prices are on top, volume is on bottom. VWAP is the grey line, and the orange line corresponds to the current time.
Best regards,
Bjarke Svane