I have already posted one query related to this topic earlier. In that thread I was clarified as below " You can subscribe for any token any time during the execution. Consider you already have a connection and getting ticks for RELIANCE and HDFCBANK, you can subscribe to TATASTEEL as follows,
Ticker.Subscribe("TATASTEEL")
The same rule applies to unsubscribe as well. " However I tried subscribing today during execution time and getting a error message from Kite saying "Invalid 'mode' message."
Kite Ticker only accepts the instrument tokens. You can subscribe and unsubscribe to the token on the go. Please go through the API documentation to know more about Syntax.
NOTE : The query clearly deals with Array and not an individual element.
When I pass a single instrument ID the subscription is working fine and ticks are coming. The issue is coming up when an array of Instrument Ids are passed. Few months ago my same solution worked fine when array of Instrument Ids are passed and suddenly now it stopped working. What has changed so that Kite API no longer accepting array of Instrument IDs ?
Can you check at your end and check whats wrong with array as subscription input ?
We haven't changed the behavior. I just tried with the following and it seems to be working fine. {"a":"mode","v":["full",[265,256265,54177543,54177799]]}
@DA1077 There are two common instances when this can happen. One is when you send tokens in a different format like String. But that won't happen here because the library accepts only integers. Second is when you send an empty list of tokens. This issue was present in the initial version of the library. But not in the current production version which is 3.0.1.0.
Can you check which version you are using? If you are not in the latest version try upgrading it. Otherwise please post a simple complete example that can reproduce this error. We will check.
Please go through the API documentation to know more about Syntax.
SubscribeArray is an array of type uint[] and contains 20 instrumentIds.
code used is as below
_ticker.Subscribe(SubscribeArray );
_ticker.SetMode(SubscribeArray , Constants.MODE_QUOTE);
Some InstrumentIds available in SubscribeArray , as I can see in debug mode are -
3329
5633
41729
70401
And so on.
But the code is getting error saying -
"Error parsing instrument tokens."
"Error parsing instrument tokens."
NOTE : The query clearly deals with Array and not an individual element.
When I pass a single instrument ID the subscription is working fine and ticks are coming. The issue is coming up when an array of Instrument Ids are passed. Few months ago my same solution worked fine when array of Instrument Ids are passed and suddenly now it stopped working. What has changed so that Kite API no longer accepting array of Instrument IDs ?
Can you check at your end and check whats wrong with array as subscription input ?
Need to sort this out asap.
I just tried with the following and it seems to be working fine.
{"a":"mode","v":["full",[265,256265,54177543,54177799]]}
"Error parsing instrument tokens."
We are getting this message on some occasions and on other occasion the subscription is connecting.
Dot net code used is as below where TradableInstruments is an uint[] array.
_ticker.Subscribe(TradableInstruments);
_ticker.SetMode(TradableInstruments, Constants.MODE_FULL);
Can you check which version you are using? If you are not in the latest version try upgrading it. Otherwise please post a simple complete example that can reproduce this error. We will check.