¿ªÔÆÌåÓý

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

Re: Problem retrieving option strings with TWS API


GUY
 

¿ªÔÆÌåÓý

Thank you very much Gordon,

Attached, you have the python code

Here is the result:

------- enregistrement des donn¨¦es -------

0 -C 20230303 bidc 27.95 askc 28.35 strike 118.0 -P bidp 27.95 askp 28.35

1 -C 20230303 bidc 27.95 askc 28.35 strike 119.0 -P bidp 27.95 askp 28.35

2 -C 20230303 bidc 27.95 askc 28.35 strike 120.0 -P bidp 27.95 askp 28.35

3 -C 20230303 bidc 27.95 askc 28.35 strike 121.0 -P bidp 27.95 askp 28.35

4 -C 20230303 bidc 27.95 askc 28.35 strike 122.0 -P bidp 27.95 askp 28.35

5 -C 20230303 bidc 27.95 askc 28.35 strike 123.0 -P bidp 27.95 askp 28.35

6 -C 20230303 bidc 27.95 askc 28.35 strike 124.0 -P bidp 27.95 askp 28.35

7 -C 20230303 bidc 27.95 askc 28.35 strike 125.0 -P bidp 27.95 askp 28.35

8 -C 20230303 bidc 27.95 askc 28.35 strike 126.0 -P bidp 27.95 askp 28.35

For the first row (0), I get ask ,bid for strike 118 . the result is correct and compliant with the TWS platform. But for rows >0 , bid and ask are the same because MktData is not updated

maybe it is necessary to send a parameter to reqMktData to force the update

Thank you again for your help

Cordially

guy

envoy¨¦ : 24 f¨¦vrier 2023 ¨¤ 15:50
de : "Gordon Eldest via groups.io" <hymagik@...>
¨¤ : [email protected]
objet : Re: [TWS API] Problem retrieving option strings with TWS API


You should include the code of your request as is in your code, including the parameters you used, especially the "tick types" you used? and bool flags.
This feature work.

1- What do you mean by "the function don't be triggered and I keep the bid and the Ask of the first Strike"
If the function doesn't come back, it doesn't deliver anything. you bid and ask is probably remnant of your last call.

2- What do you mean by "change the strike" ?
IBKR work using Contract to identify the instrument, the strike price is part of the contract.
I interpret what you wrote as: "I change the contract." please confirm.

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