Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    How to get per tick volume from websocketv2 ?

    Python SDK
    1
    1
    2
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      radheshjoshi02 last edited by

      Hello SmartAPI Team,

      I am using the SmartWebSocketV2 to build 1-minute OHLCV candles. I am facing an issue regarding the accuracy of per-tick volume across different exchanges.

      The Issue:
      To calculate the volume for a specific candle, I am tracking the volume_traded_today field. My logic subtracts the cumulative volume of the previous tick from the current tick to derive the "Per-Tick Volume."

      MCX: This logic works perfectly. The incremental volume is accurate.

      NSE/BSE: The calculation becomes highly inaccurate. The delta between ticks often results in anomalies or does not align with the actual trade quantity executed in that timeframe.

      Questions:

      Is volume_traded_today the recommended field for deriving interval volume on high-frequency exchanges like NSE, or is there a known lag in cumulative volume updates?

      Should I be using last_traded_quantity (LTQ) to sum up the volume for my candle instead?

      Does the WebSocket V2 feed for NSE/BSE provide a direct "Tick Volume" field that I might be overlooking to avoid manual cumulative subtraction?

      Environment:

      Language: Python

      Library: SmartApi

      Feed Method: WebSocket V2 (LTP, Quote, or Snap quote mode)

      Any guidance on the most reliable way to capture accurate per-tick/per-candle volume for NSE/BSE would be greatly appreciated.

      Thank you.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post