OI data is zero

mohanarakere
Hi,

I am trying to get open interest data from tick in websocket client for NIFTY option (Example : NIFTY21N1818100CE).
I am getting zero when I use tick.getOi(). It is tried when market is open.
Is there any API which gives total number of OIs in CALL/PUT side.

Regards
  • SRIJAN
    SRIJAN edited November 2021
    There is no such api as tick.getOI(). To get oi,either use quote api and extract oi from it. Or,you can use websocket, subscribe to your desired instrument(s) and extract oi from the incoming ticks. Example:-

    def on_ticks(ws.ticks):
    for tick in ticks:
    print(tick['oi'])
  • mohanarakere
    Could you provide java client code
  • SRIJAN
    Sorry,i dont know java. You can use the same logic which i told you. Or ask someone who knows java. :)
Sign In or Register to comment.