¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

securityDefinitionOptionParameter to get ONLY specific expirations Option Strikes


 

A very good day to everyone. I'm a newbie here and wished to seek some guidance and advise.

By using Python,?I wished to retrieve ONLY specific expirations 20230317 available Option Strikes?(and NOT all the combined Strikes throughout all expirations) with the following codes :-

Code #1
def securityDefinitionOptionParameter(self, reqId, exchange, underlyingConId, tradingClass,
multiplier, expirations, strikes):
for expiration in expirations:
if expiration == "20230317":
strikelist = [strike for strike in strikes]
strikelist = sorted(strikelist)
print(f"Expirations: {expiration}")
print(f"Strikes: {strikelist}")

Code #2
def securityDefinitionOptionParameter(self, reqId, exchange, underlyingConId, tradingClass,
multiplier, expirations, strikes):
for expiration in expirations:
if expiration == "20230317":
for strike in strikes:
strike = sorted(strike)
print(f"Expirations: {expiration}")
print(f"Strikes: {strike}")

But result always comes back with the FULL available strikes combined from ALL expirations date.

I would really appreciate if you can advise me on how to?retrieve ONLY specific expirations 20230317 available?Option?Strikes.

Thanking you in advance for your kind attention.

Best regards.

Join [email protected] to automatically receive all group messages.