Getting problem for calculation of volume from websocket data feed for perticular candles guide me for this and also clarity that the websocket feed sending cumulative traded volumes or incremental volumes for each tick…? Need to calculate volume for 1 min candle on websocket…
I was trying to figure out the same. But after a bit of hit and trial here is what I have found.
- Volume are cumulative
- To get volume for specific tick, we need to subtract from previous tick value.
I have written an implementation in dotnet which seems to be working with 99.9% value accuracy, but when I compare with values on upstox, it’s off by 0.5% occasionally.
An official conformation would be very helpful.
Yaa.thanks,i tried that approach of subtraction but still not getting accurate volume numbers (may be due to missing bits sometimes)
ltq, bidQ askQ are the volume for the specific order or trade but there’s no cumulative volume provided. Something like volume_trade_for_the_day
would be useful in the API. Upstox please consider adding this field.
Hi @Read_Me @Nirav_vora @Parimal_Raj
Volume traded for the day is included in as "vtt"
and is available in full-mode
Being 100% accurate in real-time is a thing of moments while consuming web-sockets. Difficult to pin point what exactly went wrong for missing bits as there are so many factors at play, mainly around internet/bandwidth consistency.
As @Parimal_Raj mentioned, for volume between specific period, you’ll need to deduce it by subtracting the volume of the lower timestamp from the higher timestamp.
It should be quite precise if based on the prev 1-min candle OHLCV