Navigation

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

    DevPatel

    @DevPatel

    0
    Reputation
    5
    Posts
    1
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    DevPatel Follow

    Best posts made by DevPatel

    This user hasn't posted anything yet.

    Latest posts made by DevPatel

    • RE: Issue with tick data when large number of tokens are subscribed

      @nitish-bane sir i am also developing a strategy where I need to select a strike price based on a premium price category. How can i do that ? any idea. Please help…..

      posted in Bugs
      D
      DevPatel
    • RE: Issue with tick data when large number of tokens are subscribed

      @nitish-bane sir how can i get OHLC data of any timeframe ( i am using ltp request but i think in response i got OHLC of 1 day timeframe) . How can i send request of OHLC dara for any particular timeframe.

      Is there any parameter for timeframe in lpt request ??

      Please help

      posted in Bugs
      D
      DevPatel
    • RE: websocketv2 throws 401 error on nodejs sdk

      @BalaDhruv This error occurs when you pass invalid parameter in below function. check it first.

      const web_socket = new WebSocketV2({
      jwttoken: 'YOUR_JWT_TOKEN_HERE',
      apikey: 'YOUR_API_KEY_HERE',
      clientcode: 'YOUR_CLIENT_ID_HERE',
      feedtype: 'YOUR_FEED_TOKEN_HERE',
      });

      posted in Bugs
      D
      DevPatel
    • RE: Issue with tick data when large number of tokens are subscribed

      @nitish-bane I tried this code and i got this error
      8fff9ed6-1df0-4d97-bd66-90b50e20d756.jpeg

      Code:

      let { WebSocketV2 } = require('smartapi-javascript');
      var axios = require('axios');

      const speakeasy = require('speakeasy');
      const secretKey = '';

      // Generate TOTP code
      const totpCode = speakeasy.totp({
      secret: secretKey,
      encoding: 'base32',
      });

      var axios = require('axios');
      var data = JSON.stringify({
      "clientcode":"K55544670",
      "password":"3123",
      "totp":${totpCode}
      });

      var config = {
      method: 'post',
      url: 'https://apiconnect.angelbroking.com//rest/auth/angelbroking/user/v1/loginByPassword',

      headers : {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'X-UserType': 'USER',
      'X-SourceID': 'WEB',
      'X-ClientLocalIP': '192.168.43.238',
      'X-ClientPublicIP': '106.193.147.98',
      'X-MACAddress': ' fe80::87f:98ff:fe5a:f5cb',
      'X-PrivateKey': 'xL9TyAO8'
      },
      data : data
      };

      axios(config)
      .then(function (response) {
      let a=response.data;
      console.log(a.data.feedToken+"\n\n\n")

      console.log(a.data.jwtToken);
      const jwt=a.data.jwtToken
      
      let web_socket = new WebSocketV2({
          jwttoken: jwt, // replace this with your own credentials
          apikey: 'hjdhdhdg',
          clientcode: 'K55544670',
          feedtype: 'order_feed',
      });
      web_socket.connect().then((res) => {
          let json_req = {
              correlationID: 'abcde12345',
              action: 1,
              mode: 2,
              exchangeType: 1,
              tokens: ["99926009", "99926000"]// token for nifty and bank nifty
          };
      
          web_socket.fetchData(json_req);
          web_socket.on('tick', receiveTick);
          function receiveTick(data) { // your code to process tick data
          }
      }
      )
      

      })
      .catch(function (error) {
      console.log(error);
      });

      posted in Bugs
      D
      DevPatel
    • RE: Issue with tick data when large number of tokens are subscribed

      Sir can you please share me websocket 2.0 code in nodejs. I have been looking for this code for a long time. Please help me

      posted in Bugs
      D
      DevPatel