How to Fetch Instrument (Stocks,Indices) Charts with real time data

Hi Team @shanmu @Pradeep_Jaiswar
We are only getting live price for Indices, getting 0 price for all the stocks from Node Js socket …
Kindly assit for the same

Indices Price
image

Stocks Price
image

Hope to hear from you soon!

@sam_jain1995

To address this issue, let’s use ‘Tata Elxsi Limited’ as a case study. Could you please provide the instrument key you used to subscribe to this particular stock?

Thanks!

Hi @shanmu

Instrument Key Used - NSE_EQ|INE670A01012 (Tata Elxsi Limited)

But still, its showing 0 price for all stocks, while for indices its getting fetched live price

@sam_jain1995

I’ve experimented with the market feeder using the following payload:

{
      guid: "someguid",
      method: "sub",
      data: {
        mode: "full",
        instrumentKeys: ["NSE_INDEX|Nifty Bank", "NSE_INDEX|Nifty 50", "NSE_EQ|INE670A01012"],
      },
    }

Here’s a sample of the update received over the websocket:

{
  "feeds": {
    "NSE_INDEX|Nifty Bank": {
      "ff": {
        "indexFF": {
          "ltpc": {
            "ltp": 46587.6,
            "ltt": "1705470966000",
            "cp": 48125.1
          },
          "marketOHLC": {
            "ohlc": [
              {
                "interval": "1d",
                "open": 46573.95,
                "high": 47212.75,
                "low": 46534.3,
                "close": 46587.6,
                "ts": "1705429800000"
              },
              {
                "interval": "I1",
                "open": 46595.7,
                "high": 46602.5,
                "low": 46574.2,
                "close": 46578.75,
                "ts": "1705470900000"
              },
              {
                "interval": "I1",
                "open": 46576.95,
                "high": 46587.6,
                "low": 46576.95,
                "close": 46587.6,
                "ts": "1705470960000"
              },
              {
                "interval": "I30",
                "open": 46687.55,
                "high": 46732.65,
                "low": 46586.55,
                "close": 46613.35,
                "ts": "1705468500000"
              },
              {
                "interval": "I30",
                "open": 46609.45,
                "high": 46641.7,
                "low": 46555.95,
                "close": 46587.6,
                "ts": "1705470300000"
              }
            ]
          },
          "yh": 48636.45,
          "yl": 38613.15
        }
      }
    },
    "NSE_EQ|INE670A01012": {
      "ff": {
        "marketFF": {
          "ltpc": {
            "ltp": 8574.3,
            "ltt": "1705470958757",
            "ltq": "1",
            "cp": 8604.55
          },
          "marketLevel": {
            "bidAskQuote": [
              {
                "bq": 2,
                "bp": 8569.5,
                "bno": 1,
                "aq": 5,
                "ap": 8574.3,
                "ano": 2
              },
              {
                "bq": 32,
                "bp": 8569.1,
                "bno": 5,
                "aq": 1,
                "ap": 8575,
                "ano": 1
              },
              {
                "bq": 3,
                "bp": 8569.05,
                "bno": 1,
                "aq": 2,
                "ap": 8575.25,
                "ano": 1
              },
              {
                "bq": 15,
                "bp": 8569,
                "bno": 3,
                "aq": 1,
                "ap": 8575.55,
                "ano": 1
              },
              {
                "bq": 1,
                "bp": 8568.1,
                "bno": 1,
                "aq": 4,
                "ap": 8576.6,
                "ano": 1
              }
            ]
          },
          "optionGreeks": {},
          "marketOHLC": {
            "ohlc": [
              {
                "interval": "1d",
                "open": 8599,
                "high": 8599,
                "low": 8511,
                "close": 8574.3,
                "volume": 32916,
                "ts": "1705429800000"
              },
              {
                "interval": "I1",
                "open": 8569.7,
                "high": 8575,
                "low": 8569.6,
                "close": 8575,
                "volume": 49,
                "ts": "1705470840000"
              },
              {
                "interval": "I1",
                "open": 8575,
                "high": 8575,
                "low": 8569,
                "close": 8574.3,
                "volume": 38,
                "ts": "1705470900000"
              },
              {
                "interval": "I30",
                "open": 8565.95,
                "high": 8577.45,
                "low": 8552.35,
                "close": 8565.5,
                "volume": 3098,
                "ts": "1705468500000"
              },
              {
                "interval": "I30",
                "open": 8567.05,
                "high": 8582.6,
                "low": 8561.05,
                "close": 8574.3,
                "volume": 1517,
                "ts": "1705470300000"
              }
            ]
          },
          "eFeedDetails": {
            "atp": 8573.09,
            "cp": 8604.55,
            "vtt": "32916",
            "tbq": 9139,
            "tsq": 14636,
            "lc": 6883.65,
            "uc": 10325.45,
            "yh": 9200,
            "yl": 5882.55,
            "fp": 8574.3,
            "fv": 1
          }
        }
      }
    },
    "NSE_INDEX|Nifty 50": {
      "ff": {
        "indexFF": {
          "ltpc": {
            "ltp": 21731.35,
            "ltt": "1705470966000",
            "cp": 22032.3
          },
          "marketOHLC": {
            "ohlc": [
              {
                "interval": "1d",
                "open": 21647.25,
                "high": 21851.5,
                "low": 21636.95,
                "close": 21731.35,
                "ts": "1705429800000"
              },
              {
                "interval": "I1",
                "open": 21736.55,
                "high": 21738.1,
                "low": 21728.7,
                "close": 21729.65,
                "ts": "1705470900000"
              },
              {
                "interval": "I1",
                "open": 21729.9,
                "high": 21731.35,
                "low": 21729.9,
                "close": 21731.35,
                "ts": "1705470960000"
              },
              {
                "interval": "I30",
                "open": 21738.4,
                "high": 21754.5,
                "low": 21727.15,
                "close": 21740.7,
                "ts": "1705468500000"
              },
              {
                "interval": "I30",
                "open": 21740.2,
                "high": 21749.35,
                "low": 21725.85,
                "close": 21731.35,
                "ts": "1705470300000"
              }
            ]
          },
          "yh": 22124.15,
          "yl": 16828.35
        }
      }
    }
  }
}

We are receiving updates for both indexes and stocks as expected. I suggest you review your app’s logs for further clarity. If that doesn’t resolve the issue, try running the socket locally with a smaller set of index and stock combinations to observe the results.

Please note that updates are only sent when new data is available. Therefore, for the example stated above, not all update messages may contain all three of the subscribed instrument_keys.

I hope this explanation is helpful.

Thanks!

Hi Team @shanmu
There’s one issue here, when passing these three data in socket we are getting live price of these …

{
guid: “someguid”,
method: “sub”,
data: {
mode: “full”,
instrumentKeys: [“NSE_INDEX|Nifty Bank”, “NSE_INDEX|Nifty 50”, “NSE_EQ|INE670A01012”],
},
}

But when we pass all the instrument keys in socket then only limited data is getting fetched sharing screenshot of data we are getting from socket.

Summary

Screenshot by Lightshot

Screenshot by Lightshot

We are not getting all stocks and indices live data in socket getting only limited data there

Kindly assist for the same @shanmu @Pradeep_Jaiswar

i am also facing same issue

@sam_jain1995

I’ll need to test with a larger dataset before I can give a definitive answer, which I’ll do shortly. Please note, the update will include only those instrument keys that have undergone changes, not all of them.

@vinod_mokashi

Your query is different from this discussion. Please refer to the other thread where we’ve provided a suggestion for your specific issue.

Thank you!

@shanmu
By when you could revert for the same…

Hi @shanmu @Pradeep_Jaiswar
Any updates on this … You were about to revert for live data feed for large dataset

Kindly revert ASAP. Awaiting for your revert …

Thank You!

Hi Team
Any updates on this …

Also, we need past historical data of instrument, how to fetch this… in socket for candle implementation. Currently we have API, but we need to reload again and again to get past data

How to get this historical data in socket

We’re unable to replicate the error with a large dataset. However, we will continue attempting to reproduce it and inform you of our findings.

Regarding historical data, it is not accessible through the websocket, and we currently have no intention of making it available via the API. Given the web socket’s purpose, it is exclusively utilized for real-time and near-real-time data.

Hi @Pradeep_Jaiswar
Thanks for your revert
Could you please let me know by when you could update for Live Data Price for Stock, as said we are getting price for limited number of instruments only in the socket. And in these it covers only few indices

Also, For chart using lightweight plugin of trading view … now candle making has started but only last candle has been showing … how can I see the old data … the problem is still there as I don’t have old data of particular instrument.

Hi @Pradeep_Jaiswar @shanmu
Any revert on this

Could you please let me know by when you could update for Live Data Price for Stock, as said we are getting price for limited number of instruments only in the socket. And in these it covers only few indices

Hi @Pradeep_Jaiswar @shanmu

I’m only getting around 150 stocks live prices in socket … Whereas I’ve more than 2000 data… Kindly assist for the same

Hi Team @Pradeep_Jaiswar @shanmu

How to extend duration of access token, is there any way ?

Unfortunately, the duration of the access token cannot be extended. According to regulations, it must expire daily, and a new one is required for each trading session.

Hi Team

how to generate token through API without any human interaction.
Or do we have any other process for this?

Because for generating access token, first need to generate auth-code - For this, we need to login and enter PIN after then auth-code generated … Is there any alternative or any way to keep auth-code for longer period, so that we can generate token from same auth-code

In accordance with regulatory guidelines, we do not recommend automating the login process. Users are required to manually log in every day to adhere to regulatory and compliance standards.

Hi Team
NIFTY 50 Actual Price - 21,286.85
And in socket we are getting - 19326.75
Any specific reason ??

1 Like