In the websocket feed, I get the 24 hour volume. How do I get the breakdown of the 24 Hour volume into something like 24HR Buy Volume + 24HR Sell Volume = 24HR VOLUME Basically I am trying to create footprint charts. Since live trades are not available in the websocket feed, I was hoping to create the chart using the live quote feed if I could get the 24HR BUY VOLUME and 24 HR SELL VOLUME or the buy and sell volume over any period of time (1 sec, 1 minute etc.)
There is nothing called a buy volume or sell volume. A trade can happen only when there is a buyer and a seller at the same price.
So theoretically, a volume of quantity 1 = 1 buyer volume + 1 seller volume.
In live market data what we provide, there is a field called total buy volume and total sell volume, it indicates that those many quantities of buy and sell pending orders exist at the exchange respectively.
The next tick might have double total buy volume or zero total buy volume, there won't be any correlation.
Again, these are my perspective, if you still want to plot those figures then you will have to dump all the incoming ticks from the websocket and plot it.
I understand that what you get from the exchange might only be the total volume and there is nothing against you, its just the way NSE is sending you data.
If you really want to know how it works, just try connecting to one of the premier crypto exchange apis, you will understand the difference between a real trade feed and quote feed. I specialize in this field so if you have any queries, let me know
From quote data it is not possible to figure out buy/sell.
The volume data that is available is cumulative for the day until that point.
It keeps increasing as buy/sell mounts.