Open AlbertBGeorge opened 1 year ago
welcome to Neo api :). you can subscribe index using their exchange token directly like this, it works and i am doing so, to this you can append your other instruments and subscribe.
subs = [{"instrument_token": "26000", "exchange_segment": "nse_cm"},
{"instrument_token": "26009", "exchange_segment": "nse_cm"}]
26000 - Nifty 50 26009 - Banknifty
Thanks @youngking1686, from where did you get instrument tokens for indices? These will be permanent, or do they keep changing? I generally don't like to hardcode things, if you can explain the process to get index instrument tokens, it would be helpful.
from the scripmaster for nse_fo, it is available as 'pAssetCode' - the underlying instrument token. Those are exchange tokens I have been using for a longtime, common across apis.
Since exchange identifier are not a number in case of Indexes, how do I subscribe to indices and FnO derivative contracts/ stocks etc at the same time? If I exclude the isIndex parameter, then it doesn't subscribe to the index.