Navigation

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

    Understanding WebSocket tick data

    General Discussion
    6
    18
    388
    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.
    • S
      Surya 1 @softice last edited by

      @softice

      you get LTP from the websokcets. one need to aggregate it for the time desired to get high and low. first entry in that time period is open and last entry is close.

      for example :

      time       ltp
      10:01:01 100
      10.01:02 110
      .
      .
      .
      
      10:01:30 120
      10:01:31  90
      .
      .
      .
      10:01:59 101
      

      open 100
      high 120
      low. 90
      close 101

      I hope its clear now.. this is how candles are made..
      https://smartapi.angelbroking.com/docs/WebSocket

      S 2 Replies Last reply Reply Quote 0
      • S
        softice @Surya 1 last edited by

        @rajanprabu Thanks a ton man. You made my day. This turned out to be very simple than all the hacks I was trying.

        Thanks once again.

        1 Reply Last reply Reply Quote 0
        • S
          softice @Surya 1 last edited by

          @rajanprabu one more question. How to build the volume for a 1 min candle from this tick data?

          S 1 Reply Last reply Reply Quote 0
          • S
            Surya 1 @softice last edited by

            @softice

            pandas has resample function which can do this automatically for you.. I wrote it just for theoretical explanation.

            for volume you can use delta volumes ( tick V now - tick V previous )

            S 2 Replies Last reply Reply Quote 0
            • S
              softice @Surya 1 last edited by softice

              @rajanprabu thanks for the reply on volume. Regarding using Pandas, well call me old school but I am on Java.

              1 Reply Last reply Reply Quote 0
              • S
                softice @Surya 1 last edited by

                @rajanprabu I am back with my query. My WebSocket API call stopped working today while it was working earlier.

                Today whole day, I just got below messages:

                [{"msg":"connected","task":"cn","ak":"ok"}]
                [{"msg":"mw","task":"mw","ak":"ok"}]
                [{"msg":"mw","task":"mw","ak":"ok"}]
                []
                [{"msg":"heartbeat","task":"hb","ak":"ok"}]

                Even though I got ack for task "mw", didn't get any data at all. Any pointers would be helpful.

                Thanks in advance.

                S 1 Reply Last reply Reply Quote 0
                • S
                  Surya 1 @softice last edited by

                  @softice You are using Java which I have no idea.. maybe a fellow Java trader can help.

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    softice @Surya 1 last edited by

                    @rajanprabu Thanks. I figured out the problem. It was an error that I introduced while refactoring the code. After fixing it, its working fine now.

                    1 Reply Last reply Reply Quote 0
                    • A
                      Ankita @sakshi_97 last edited by

                      @krishna
                      you have to check the length of every tick, iterate through each part of tick,then use try/except to extract ltp if any portion of tick is having that

                      L 1 Reply Last reply Reply Quote 0
                      • S
                        Surya 1 @Guest last edited by

                        @MNAGESH

                        ltp in websocket stream is last traded price..

                        1 Reply Last reply Reply Quote 0
                        • L
                          lakshya_2410 @Ankita last edited by

                          @Ankita could you please provide a sample script to get tick by tick data , I tried every method but unable to get the tick data ?

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