Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. greatworld
    3. Topics
    G
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by greatworld

    • G

      WebSocketV2 fetchData function response
      Bugs • • greatworld  

      4
      0
      Votes
      4
      Posts
      39
      Views

      G

      @Moderator_2 Nothing is working neither setInterval(() => { WebSocketV2response.on("tick", async (response) => { console.log(response); }); }, 3000); nor setTimeout(function () { WebSocketV2response.on("tick", async (response) => { console.log(response); }); }, 3000); It's receving data continuosly after 3 sec in both the cases ?
    • G

      USE OF ACTION
      Bugs • • greatworld  

      3
      0
      Votes
      3
      Posts
      21
      Views

      G

      @Moderator_2 I mean when i provide 1 then i get data continuously but when i provide 0 then i receive pong as a data. I want to receive data once or few seconds later for what i have requested but while providing 1 it is giving me the same data continuously for what i have requested. How can i receive data with some latency so that i can computing on present value of data and again i request or by itself after few seconds or minutes it should fetch data using fetchData function ? THANK YOU
    • G

      API for fetching current data of market of any index
      General Discussion • • greatworld  

      2
      0
      Votes
      2
      Posts
      30
      Views

      M

      Hi @greatworld Apologies for the delayed response. Kindly fetch the required details for any scrip with below market data API of FULL mode. Ref: https://smartapi.angelbroking.com/docs/MarketData Regards, SmartAPI team
    • G

      FETCH AT THE MONEY STRIKE PRICE
      Bugs • • greatworld  

      2
      0
      Votes
      2
      Posts
      22
      Views

      Mnagesh

      @greatworld you need to write own logic for that . there is no standard api for that . for index get index value get floor value - compute by division and round to nearest for call get ceiling value - compute by dividing and round to the next value for put
    • G

      Node JS WebSocketV2
      General Discussion • • greatworld  

      4
      0
      Votes
      4
      Posts
      29
      Views

      G

      @Moderator_2 "next": "14.1.3", I am using next js instead of node js to connect with WebSocketV2 directly from fronend. It got connected and worked very fine with all the function defined in WebSocketV2 leaving WebSocketV2.fetchData function in smartapi-javascript\lib\websocket2.0.js which is upload in your github repo https://github.com/angel-one/smartapi-javascript/blob/main/lib/websocket2.0.js. In documentation it said to pass parameter like : { "correlationID": "abcde12345", "action": 1, "params": { "mode": 1, "tokenList": [ { "exchangeType": 1, "tokens": [ "10626", "5290" ] }, { "exchangeType": 5, "tokens": [ "234230", "234235", "234219" ] } ] } } but while retriving in WebSocketV2.fetchData function which is in line number 127 of https://github.com/angel-one/smartapi-javascript/blob/main/lib/websocket2.0.js file is like const { correlationID, action, mode, exchangeType, tokens } = json_req; but i am passing data in different structure , so as to retrive the data i pass it has to be like : const { correlationID, action, params : {mode, tokenList :{exchangeType, tokens} }} = json_req; I request please provide the solution as soon as possible. Thank you
    • G

      Error due to fetchData function from WebSocketV2
      Bugs • • greatworld  

      2
      0
      Votes
      2
      Posts
      27
      Views

      M

      Hi @greatworld Apologies for the delayed response. Kindly find below working code to fetch data. Please verify and let us know if this helps. Code Snippet: let web_socket = new WebSocketV2({ jwttoken: 'jwt_token', apikey: 'api_key', clientcode: 'client_code', feedtype: 'feed_token', }); web_socket.connect().then((res) => { let json_req = { correlationID: 'abcde12345', action: 1, mode : 1, exchangeType: 5, tokens: ["234230", "234235", "234219"], }; web_socket.fetchData(json_req); web_socket.on('tick', receiveTick); function receiveTick(data) { console.log('receiveTick:::::', data); } }); Regards, SmartAPI team