@Hardik
with historical data do we get access to old expired future contract data also? this helps in backtesting. for example- copper contract of Jan-Feb 2024 mcx
No, currently we do not provide Historical Options data via APIs. We understand the use case here, but again APIs are optimised for execution purposes.
I am trying to get live data, right now commodity market is live but only one packet at a time is received. Why on second attempt Socket is getting disconnected ? and why its saying “Invalid Client ID” where it is valid on first attempt ?
Over here, authentication of Client ID, active Data API plan and access token, all happens async. This means that the socket is connected and instruments are subscribed and meanwhile, on background authentication takes place.
You will need to check on the above three things if the socket is being disconnected abruptly. We have also mentioned the same in documentation:
I have taken stock positions using MTF. And now my combined ledger is in negative -68k.
And the issue is that I cannot subscribe to Data API because of this. When I contacted support I was told that it was because my ledger was negative. And I should clear the debit of the trading ledger by either transferring funds or selling the shares. I think this should not be the case as this means I can’t have mtf positions when I want to subscribe to data API.
I think an option to pay for the Data API directly via a payment gateway could resolve this. One should not be forced to have a positive ledger balance with MTF positions active and simply selling the shares is not an option. To subscribe to an API which costs Rs. 499+GST.
As mentioned, yes, since the authorisation is done parallel to subscription of instruments and sending data, this scenario may arise, where you receive some packets and then the connection is closed.
On security flaw, we do have other measures in place, which will prevent such an incident, on multiple levels. The reason behind keeping authorisation asynchronous is to separate two modules and make sure data is pushed as soon as user connects on websockets.
Understood what you are saying. But my credentials are correct. Still why it says Invalid Client ID !
Even I tried generating new token and tested with that still getting same.
(Note : I have subscribed to DATA APIs as well 499/- so no issues on that front as well )
Do we have any documentation ? or promising way to find root cause and fix ?
# Maximum 100 instruments can be subscribed, then use 'subscribe_symbols' function
@Hardik can you please clarify how many symbols can be subscribed in single websocket connection?
Also, if I am able to subscribe to let’s say 5k instruments, will I get response in single list/array per second OR I will get separate response for each instrument ?
On the subscription of symbols, on initial connection, only 100 symbols can be subscribed. But with subscribe_symbols function, you can subscribe the other 4900 symbols. The comment on python code is only on how to handle subscribing to instruments and not on maximum instruments which can be connected on a socket (which remains at 5000)
On the response, since the Market Feed updates as and when there is any update in a any instrument, it is not possible to provide the same in a single list/array. You will be getting separate response for each instrument.
just to give you reference, when I subscribe to 100 instruments in zerodha, I get single array which has tick data, it may have 90 ticks based on the changes, but the response is single array/list. I wanted to know if same is true for Dhan