1 min data

Sumit
Hi,
Can I pause websocket stream for every 1 min interval?
I mean i want a data after every 1 minute?
or is it a good idea to add delay or sleep in between?

Sumit
  • Vivek
    @sumit you can unsubscribe and subscribe back but it's not a good idea to do that since after subscription it may take some time to receive ticks. It's better you use first tick of the second and ignore the remaining by simple conditional statement.
  • Sumit
    Thanks vivek.

    One more query, I am not getting streaming data with same frequency with ltp mode.
    is it because of no change in previous prices?

    Sumit
  • Vivek
    @Sumit Yes, if you subscribed to LTP mode then you will get next tick when it has been changed. If you rely on other data like volume you should subscribe to quote mode or full mode.
  • Ashok121
    Ashok121 edited May 2018
    How to get difference of last two tick data in python?
    Say I subscribe for reliance and value of first tick is 1000 and second is 1001.now I want to get difference of these two.i.e. 1001-1000=1.
    What formula to put to get difference?
  • Ashok121
    Ashok121 edited May 2018
    Could you please revert? @vivek
  • sujith
    sujith edited May 2018
    You need to store the tick you receive and from next tick, you can use that last price of first tick and last price of the current tick to find the difference.
Sign In or Register to comment.