How do I get the total Buy volume and Sell Volume in websocket feed

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.)
  • sujith
    sujith edited September 2018
    Hi @Debsush,

    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.
  • sujith
    It depends on market participants and not really a trend.
  • Debsush
    @sujith I respectfully disagree with the first part. When a trade happens, a trade has generally the following must have fields. Timestamp, Price, Quantity and Side. Side is either buy or sell. So if your quote is for 1 second, the exchange will aggregate all trades over 1 second, the sum of all buy and sell volume will be your total volume traded over that 1 second. You may want to learn about Order Flow Analysis.

    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
  • sujith
    We get snap quote data from the exchange.
    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.
  • vaibhavsharma13
    Do you know any feed that provide buy volume and sell volume?
Sign In or Register to comment.