Closed Harald-F closed 4 months ago
Hey @HaSiMiPa, thank you for checking out IBind and creating the first Issue on this repo! π₯³
Here's a celebratory GIF of a happy sheep for you:
Many thanks for bringing that endpoint into my attention - must have gotten corrupted by accident at some point.
I've just released v0.1.1
with a fix - let me know if it works for you π
thanks for the quick fix. After fixing my additional mistake by putting the arguments in list form, it seems to work. Thanks a lot!
Glad to hear it worked π
As for the mistake you mention - could you clarify it briefly? The live_marketdata_snapshot
indeed expects a list of arguments. These then get merged together in the following fashion:
params = {
'conids': ','.join(conids),
'fields': ','.join(fields)
}
What was the issue you were experiencing?
I just put e.g. '31' as argument with missing quare brackets, instead of correctly ['31'] or ['31, ''80]. '31' resulted in a parameter like '3,1'
Ahh, that's a bug too! Thanks for telling me this. The interface in fact supports providing both lists and single arguments. That endpoint was missing that functionality by accident. So yeah, thank you π
@HaSiMiPa Would you mind sharing how you filter for required options from a ticker?
@akshayaradhya I don't fuly understand your question. If you ask for an example of the live_marketdata_snapshot(), here is a simple one:
client.live_marketdata_snapshot('265598', ['31','55']).data
Output below.
265598 is the conid for AAPL, 31 is the code for last price, 55 the ticker. You find the codes in the API manual or in the definition file.
{'55': 'AAPL',
'6509': 'D',
'conidEx': '265598',
'conid': 265598,
'_updated': 1716588856195,
'6119': 'q0',
'server_id': 'q0',
'31': '189.99',
@HaSiMiPa This is for getting a snapshot. What I needed was, given a ticker - example AAPL, I want to first pull itβs conID (this is easy), after this I want to look for at the money options with same day expiry. And then, I would to find out the conID of a suitable option so I can subscribe to its data
@HaSiMiPa thanks for your example! π @akshayaradhya please see my reply in https://github.com/Voyz/ibind/issues/3 regarding the options chain example, hope it helps
@akshayaradhya I see. I missunderstood and thought you we asking for options as function parameters :-) I am not trading options, so cannot help here. But Voyz has kindly provided an example already.
Hi Voyz, amazing work you are doing here. After getting iBeam to work, i started to play with iBind. I succeeded several API calls, but not live_marketdata_snapshot(). It always returns with an Error 500.
Now I looked into your code. Isn't this function supposed to call /iserver/marketdata/snapshot? Yours calls iserver/secdef/search. While this must be possibly called as pre-flight call (for derivatives), to me it looks this function is not complete. There is also a mandatory pre-flight call for /iserver/accounts.
Let me know if this makes sense...