average_price field precision only up to 2 decimals?

sidverm
Hi Team,

I know that the average_price field that is received in Market data tick structure via API is volume weighted average price since morning.

But I didn't realize this field is truncated (or rounded?) to 2 decimal places. Why is this so? Is the exchange sending more precision digits and you are rounding it? Or is the exchange itself rounding it?

Of course live bid and ask prices cannot take more than 2 decimals because of tick size, but the average_price will most likely have many decimals. The reason I need the accurate value is that I am trying to infer information about trades between two successive ticks (which are currently being sent every 200ms) using changes in the volume field and average_price field. volume being an integer is accurately captured, but average price being rounded, almost never changes between two successive ticks, which is an approximation that's broken my entire plan! :(

Can you please send average price up to 8 decimals or so?

Regards,
Siddharth


Tagged:
  • Kailash
    Hi Siddarth,
    We do not mutate any values in the WebSocket stream whatsoever. They are relayed as-is.

    Exchanges send a 4 byte unsigned int (uint32) for price fields representing a "paise" value. Based on the segment, at your end, you should apply a divisor and obtain the "Rupee" value. For instance, /100 for equity and /10000000 for currency.
  • sidverm
    oh ok, so that means NSE itself is not sending the accurate value of average_price. sad, but can't be helped :(
This discussion has been closed.