开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育
Date

Re: reqMktdata SPX call

 

Sorry Richard

I wanted to just ask the general question if it was legitimate for me to send a reqMktData for an index. Here's the TWS connection data

Info: connected
│   V = "167"

I'm using a language called julia and so posting the code won't help as this language isn't supported on this forum. I'm using the same structure of call I use for "STK" so I was hoping that if I send the same call but with the following fields filled out I would get a data stream.


Contract(symbol="SPX" , secType="IND" , exchange="CBOE"  , currency="USD")

Is this is legitimate call please in general terms.


Re: reqMktdata SPX call

 

开云体育

Give us some clues please!

?

Like what API implementation are you using?

?

?

From: [email protected] <[email protected]> On Behalf Of comicpilsen
Sent: 11 March 2022 00:02
To: [email protected]
Subject: [TWS API] reqMktdata SPX call

?

Hi all is there ANY reason that calling reqMktdata using "SPX" , "CBOE","USD" as parameters would cause

sending | ┌ Error: exception thrown
│?? e = TypeError: in typeassert, expected Float64, got a value of type Nothing

and no data?

I can send the same reqMktdata for any symbol and it works perfectly.


reqMktdata SPX call

 

Hi all is there ANY reason that calling reqMktdata using "SPX" , "CBOE","USD" as parameters would cause

sending | ┌ Error: exception thrown
│   e = TypeError: in typeassert, expected Float64, got a value of type Nothing

and no data?

I can send the same reqMktdata for any symbol and it works perfectly.


Re: Unexpected duplicate orders re-submitted many times within a short time

 

Hi WHmKK Zeng,

Just curious, what method are you using to avoid re-submitting the same orders? I'm trying to stop new orders from being created when open orders for that contract already exist, but I'm not sure how to.

Thanks in advance!


IBKR currency carry reference benchmarks + history

 

Hello TWS group,

Was looking into FX trading recently, and tried to source the below reference benchmark rates from the TWS API without success.


I would need today's rate but also history if possible, it is available from the IBKR website, so I suppose it must be stored somewhere in the API, but can't find it.
Any suggestions?

Thanks,
Jonathan


Re: Place a Limit Order with 2 Profit Takers and 1 Stop Loss for a Stock

 

Dear Orionn,?

May I ask how can we trigger the stop-loss order modification a profit taker order fills??

Thank you.
Hao

On Thu, Feb 4, 2021 at 09:57 AM, Orionn wrote:
My suggestion is that you create two sets of orders. Each set includes the parent limit order and two attached OCA child orders (profit taker and stop loss). The limit price of the profit taker orders is different on each set of orders. To update the stop loss orders, just monitor the status of the profit taker order in the first set (wait for a fill) and then place the stop loss orders again with modified prices. You may simply trigger the stop loss order modification when the first profit taker order fills. Hope this helps.

--

?Dear Orionn,

I just read your reply


Re: Connected to gateway, but no response from API via gateway

 

Are you sure you are using the correct gateway, Eric? It feels like you are trying to make "Client Portal API" calls to the ":TWS API Gateway".

The Client Portal API comes with its own little gateway and generally uses port 5000. Here a link to the section of the Client Portal API,

闯ü谤驳别苍


Re: Connected to gateway, but no response from API via gateway

Nick
 

开云体育

Um, the TWS API is not a web server or http based at all. It uses a custom protocol, http is not going to work.

I am not a python expert so I apologize if your example is running a python TWS API library rather than http.


On 3/9/2022 9:57 AM, Eric Eikrem via groups.io wrote:

r = requests.post(, data='{"symbol": "GWO","secType": "STK"}')


Connected to gateway, but no response from API via gateway

 

Hello,

One computer on my LAN is running the IB Gateway and another is running scripts that connect to the IB Gateway. I am able to connect to the gateway, but I am not getting responses from the API:

?curl -v " -d "{"symbol": "GWO","secType": "STK"}"
*?? Trying 192.168.1.10:4002...
* Connected to 192.168.1.10 (192.168.1.10) port 4002 (#0)
POST /v1/api/trsrv/stocks HTTP/1.1
Host: 192.168.1.10:4002
User-Agent: curl/7.74.0
Accept: */*
Content-Length: 26
Content-Type: application/x-www-form-urlencoded
* upload completely sent off: 26 out of 26 bytes

After that, it just sits there waiting for a response. I have got log and API messages visible on the gateway and cannot see any trace of the (supposedly) incoming requests.

The same result with python code (no surprise, I suppose):

import requests
r = requests.post(", data='{"symbol": "GWO","secType": "STK"}')

No connection errors, but it just sits there.

The configuration of the IB Gateway (v.10.12):

- All default except that "Allow connections from localhost only" has been disabled, and I have added the client machine to the Trusted IPs list.

Gateway network and firewall:

inet 192.168.1.10/24 brd 192.168.1.255 scope global noprefixroute enp2s0

$ sudo ufw status
Status: active

To???????????????????????? Action????? From
--???????????????????????? ------????? ----
22/tcp???????????????????? ALLOW?????? Anywhere
80/tcp???????????????????? ALLOW?????? Anywhere
443/tcp??????????????????? ALLOW?????? Anywhere
4002?????????????????????? ALLOW?????? Anywhere
4001?????????????????????? ALLOW?????? Anywhere
4000?????????????????????? ALLOW?????? Anywhere
22/tcp (v6)??????????????? ALLOW?????? Anywhere (v6)
80/tcp (v6)??????????????? ALLOW?????? Anywhere (v6)
443/tcp (v6)?????????????? ALLOW?????? Anywhere (v6)
4002 (v6)????????????????? ALLOW?????? Anywhere (v6)
4001 (v6)????????????????? ALLOW?????? Anywhere (v6)
4000 (v6)????????????????? ALLOW?????? Anywhere (v6)

Client machine network and firewall:

inet 192.168.1.106/24 brd 192.168.1.255 scope global noprefixroute wlp0s20f3

$ sudo ufw status
Status: active

To???????????????????????? Action????? From
--???????????????????????? ------????? ----
22/tcp???????????????????? ALLOW?????? Anywhere
59000????????????????????? ALLOW?????? Anywhere
4002?????????????????????? ALLOW?????? Anywhere
22/tcp (v6)??????????????? ALLOW?????? Anywhere (v6)
59000 (v6)???????????????? ALLOW?????? Anywhere (v6)
4002 (v6)????????????????? ALLOW?????? Anywhere (v6)

Log and ini-file enclosed.

Any help much appreciated.

Best regards,

Eric Eikrem


Re: bunch of reqMktData requests for options

 

Hi Richard,

I created a ticket. Let's see whether they will fix it.

From a retrospective view, you're right and I could have saved me a lot of hassle. But to be fair, I couldn't be sure before whether this bug resides inside the TWS or anywhere else. Therefore, I didn't know whether this issue could be resolved by using realtime data. Additionally, I considered these actions as part of a test of the TWS API and thus, I wouldn't invest money into something that doesn't work properly. As for the time you and 闯ü谤驳别苍 have spent for supporting me, this is the biggest downside but to drag this into a positive light, you might have learned something new regarding the TWS. ;-)

By the way, for my use case, delayed data should be fine so far.

Regards
Andreas


Re: bunch of reqMktData requests for options

 

开云体育

Andreas

?

Login to Account Management and you can submit a trouble ticket there. It's easy enough to find the mechanism once you've logged in.

?

The cost of the US Equity and Options Add-On Streaming Bundle is $4.50 per month and the US Futures Value PLUS Bundle (which you also need) is $5.00 per month.

?

So for a monthly sum of $9.50 you could have saved yourself a lot of hassle, not to mention the amount of time I and others have spent on this topic today. Besides which I would never expect delayed data to give me any realistic indication of how the live feeds perform: they're probably pretty good, but there's no reason to expect them to be – they're free after all!

?

Go figure…? ?

?

?

?

From: [email protected] <[email protected]> On Behalf Of hansblafoo via groups.io
Sent: 08 March 2022 20:23
To: [email protected]
Subject: Re: [TWS API] bunch of reqMktData requests for options

?

Hi together,

thanks for your responses! :-)

I'm running the latest TWS API version and the most recent TWS version. As described, this TWS version seems to be flawed since I cannot reliably request delayed (!) market data. I would love to use this version, really, but it drives me crazy.

Later, I discovered the files section of this group and under API old versions, you can find a 972.1x TWS which I've downloaded and installed. It was built on 20th February 2020 (so roundabout two years old) and I can easily log in. There is only the message, that I should update. I then started my client without changing anything (!), I didn't even change to another TWS API version. Now, it runs absolutely fine - no problems anymore, delayed market data runs in very fast and without any issue. I guess, that this should be enough of a proof that newer TWS versions seem to be buggy regarding this type.

@Richard: To be honest, my plan is to subscribe realtime data later. As for now, I want to use the delayed data because I'm still developing my application (thus I don't need realtime data for now) and ironically, I also want to check how stable and realible the TWS API is before I'm going to invest any money on that. ;-)

Do you know a channel or an IB mail address I can report this issue to? I only found the contact form which allows to enter 200 characters or something like that, which is not enough to describe this problem.

Best regards
Andreas


Re: bunch of reqMktData requests for options

 

Hi together,

thanks for your responses! :-)

I'm running the latest TWS API version and the most recent TWS version. As described, this TWS version seems to be flawed since I cannot reliably request delayed (!) market data. I would love to use this version, really, but it drives me crazy.

Later, I discovered the files section of this group and under API old versions, you can find a 972.1x TWS which I've downloaded and installed. It was built on 20th February 2020 (so roundabout two years old) and I can easily log in. There is only the message, that I should update. I then started my client without changing anything (!), I didn't even change to another TWS API version. Now, it runs absolutely fine - no problems anymore, delayed market data runs in very fast and without any issue. I guess, that this should be enough of a proof that newer TWS versions seem to be buggy regarding this type.

@Richard: To be honest, my plan is to subscribe realtime data later. As for now, I want to use the delayed data because I'm still developing my application (thus I don't need realtime data for now) and ironically, I also want to check how stable and realible the TWS API is before I'm going to invest any money on that. ;-)

Do you know a channel or an IB mail address I can report this issue to? I only found the contact form which allows to enter 200 characters or something like that, which is not enough to describe this problem.

Best regards
Andreas


Open Tick Price For Index, for example COMP, INDU etc.

 

Do we get Open Tick price for indexes? I do get market data for it but no open tick price.

Please advise

Thanks


Re: reqMarketData live data lagging

Nick
 

While IB does sometimes mess up, these types of things are almost always due to an issue with the client app.

The first step is to enable the API log and look to at the data TWS actually sends.

If this is indeed a problem on IB's end I'd expect the group would have exploded with activity.

On 3/8/2022 2:38 PM, movais996@... wrote:
After a certain period, this gap grows to even a 10 or more minutes lag between the price received by API and the price shown on terminal! Has anyone experienced it?


reqMarketData live data lagging

 

Hi there, relatively new to tws api.
I am retrieving live ticks using IBAPI's reqMktData function and saving it in a csv. In the beginning, the data is retrieved as expected but gradually there starts to appear a gap between the price received and the price shown on tws and IQFeed terminals. After a certain period, this gap grows to even a 10 or more minutes lag between the price received by API and the price shown on terminal! Has anyone experienced it?? ?


Re: bunch of reqMktData requests for options

 

开云体育

Just an update on this.

?

I still have a 973 Windows installer (now more than three years old), and I ran that earlier today and was surprised to find that it still works. It now gives a message after login that it will be disabled on 31 March 2022. So presumably IBKR were pressured into easing the timescale for mothballing these dodgy versions.

?

I absolutely agree with 闯ü谤驳别苍 that running old versions like this, even if they appear to work, is not a good idea. If by running it you convince yourself that something that worked with 973 no longer works with 981+, I'm not sure that really helps: especially if there is only a couple of weeks that you can use 973.

?

If this problem with delayed options data is really causing a problem, then gather evidence and submit it to IBKR: there's nothing anyone on this group can do about it.

?

Or put your hand in your pocket and subscribe to the options market data…

?

?

From: [email protected] <[email protected]> On Behalf Of 闯ü谤驳别苍 Reinold via groups.io
Sent: 08 March 2022 19:01
To: [email protected]
Subject: Re: [TWS API] bunch of reqMktData requests for options

?

You should try and get your client working on a "stable" 981.3 or a "latest" TWS version of at least 10.12.2, Andreas. The same applies to IBGW.

I am not aware of any links where you can download older versions. And even if you'd get you hands on a 973, IBKR will refuse login attempts. The security issue that was found in December 2021 in the log4j library utilized by TWS was fixed in 981.3 and 10.12.2. Vulnerable TWS versions (such as 973) will be refused.

闯ü谤驳别苍

On Tue, Mar 8, 2022 at 11:46 AM, <hansblafoo@...> wrote:

Did a downgrade to 9.73 (where did you get it from?) solved the issue?


Re: bunch of reqMktData requests for options

 

You should try and get your client working on a "stable" 981.3 or a "latest" TWS version of at least 10.12.2, Andreas. The same applies to IBGW.

I am not aware of any links where you can download older versions. And even if you'd get you hands on a 973, IBKR will refuse login attempts. The security issue that was found in December 2021 in the log4j library utilized by TWS was fixed in 981.3 and 10.12.2. Vulnerable TWS versions (such as 973) will be refused.

闯ü谤驳别苍

On Tue, Mar 8, 2022 at 11:46 AM, <hansblafoo@...> wrote:

Did a downgrade to 9.73 (where did you get it from?) solved the issue?



Re: TWS API returns "Error: 0 200 No security definition has been found for the request" in reqMktData() for INDEX

 

You might try searching by region and exchange:


Re: bunch of reqMktData requests for options

 

Hi there,

I also have the exact same problem. Interestingly, after I tried to fetch the data via API from TWS and didn't get the prices though (I always got the message that the "requested market data is not subscribed"), the TWS seems to "lock" this strike/expiry date combination of this symbol. If I load the option chain in TWS, the combinations for which I didn't receive the data have blank lines and a link to the market data manager. This can only be fixed with a restart of the TWS.

Did someone found a solution for solving this problem? Did a downgrade to 9.73 (where did you get it from?) solved the issue?

Thanks a lot!
Andreas


Re: Software version upgrade, recommendations?

 

Hi,

I'm currently facing the exact same issue with the latest TWS release. Do you have a download link for the IB website for getting the 9.73 release? When I want to use TWS 9.73, do I also have to step back to an older TWS API release or does it work with the latest or stable API release?

?

Thanks and regards