Skip to content

OptionChain's underlyingConId Returned as String #221

Description

@philipbel

There's a bug in reqSecDefOptParams—the returned OptionChains' underlyingConId field is returned as a string, whereas it's typed as int.

Minimal example:

opt_chains = ibkr.reqSecDefOptParams(
    underlyingSymbol="AAPL",
    futFopExchange="",
    underlyingSecType="STK",
    underlyingConId=265598,
)
print(repr(opt_chains[0].underlyingConId))
print(type(opt_chains[0].underlyingConId))

Output:

'265598'
<class 'str'>

Expected: underlyingConId to be int.

The issue is in Decoder.securityDefinitionOptionParameter: underlyingConId is destructured as a str and should, similarly to what is done for n, be converted to int.

Do you accept PRs? Or is the main branch frozen (in light of the ongoing protobuf implementation)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions