Closed ecpgieicg closed 4 years ago
Try converting the hashset to a cell-array with something like:
details = collection2cell(buf.get().data); details = details{1}.contractDetails; details.strike
Does this work?
Not sure I understand. Hash is key-value pairs so does not flatten/convert to list or cell array.
I’ll try have a look today
On Sep 5, 2019, at 2:27 AM, Despair2000 notifications@github.com wrote:
Try converting the hashes to a cell-array with something like:
details = collection2cell(buf.get().data); details = details{1}.contractDetails; details.strike
Does this work?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Did you try the lines I sent? I'm pretty sure it will do the trick. I can't try it myself right now because an application of mine is connected to the TWS right now and I don't want to stop the program.
At least I access several fields from the contract details in this way. Didn't try the strike field though.
If I recall, the “strike” is property of contract so you need to ask for contractDetails.contract().strike
On Sep 5, 2019, at 5:54 AM, Despair2000 notifications@github.com wrote:
Did you try the lines I sent? I'm pretty sure it will do the trick. I can't try it myself right now because an application of mine is connected to the TWS right now and I don't want to stop the program.
At least I access several fields from the contract details in this way. Didn't try the strike field though.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/softwarespartan/IB4m/issues/63?email_source=notifications&email_token=ABC2VVCBVIITCEIJXZTK7NDQID6O5A5CNFSM4ITBFQZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD567RNY#issuecomment-528349367, or mute the thread https://github.com/notifications/unsubscribe-auth/ABC2VVF5KTITLAXU2GUTCDDQID6O5ANCNFSM4ITBFQZA.
You are right.
details.contract.strike
(in my example) gives the strike price. I now had the possibility to try it.
hi guys,
Sorry for my late reply. I missed all the messages earlier.
Yes,
.contractDetails.contract.strike
does the trick.
Thanks a lot to both of you!
Hi Abel,
As always, thank you very much for creating, sharing and maintaining the IB4m package.
Is there a way to enable access to the
.strike
field ofcom.ib.client.ContractDetails
-- the return ofreqContractDetails
?.strike
would be helpful for auto-discovering available option contracts of a specified underlying and expiration date.For example, the following returns the contract details of all front month VIX Call options.
One of the hashsets in the buffer will look like the following.
But with most fields, including
.strike
, attempting to access will give the following error.What do I need to do in order to access the
.strike
field?Thank you for your attention!