¿ªÔÆÌåÓý

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

reqCurrentTime

 

Hi All,
Probably a dumb question, so apologies in advance:
I don't see this reqCurrentTime being used in the latest 9.85 API (no callback).
Is it to be deprecated with the EClient code left for backward compatiblity ?
Thanks


Re: US futures historical data in exchange time

 

Thanks for the reply. I'm using .NET C#?"yyyyMMdd HH:mm:ss" format for the? endDateTime so I guess it is what you meant??
As much as I remember Python (quite rusty) it is the same...?

Are you saying IB decides what time zone to send the historical data based on the time string format??

My conversion is:

string endDateTime = currentTime.ToString("yyyyMMdd HH:mm:ss");


On Tue, Aug 17, 2021 at 1:58 PM ebtrader <jsiddique@...> wrote:
The issue is how you set current time.? Make sure you set your "endDateTime" variable in the following way using the datetime package, if you are using Python (script attached):

endDateTime = datetime.now.strftime("%Y%m%d %H:%M:%S")

Regards,

Javed

On Tue, Aug 17, 2021 at 6:21 AM edwardgonen via <edwardgonen=[email protected]> wrote:
Hi,

I'm trying to get historical 5 mins bars for US futures, like ES, NQ etc, for several days back. So I'm calling the?
reqHistoricalData(tickerId, contract, endDateTime, "2 D", "5 mins", "TRADES", 0, 1, false, historicalDataOptions);

The interesting fact is that the data is reported back for each day in range of 1:00am through 23:55. It is instead of getting it in the exchange time (Chicago) or, preferably in time Zone I want (like EST). As you know there is an one hour break in the futures trading. So it seems like IB treats that break as the beginning of new day.

The question is - can I somehow cause the IB to return historical bars in the exchange time zone (or even better - specify the desired timezone like EST)?

Or am I doing something wrongly?

Thanks
Ed
?


Re: US futures historical data in exchange time

 

The issue is how you set current time.? Make sure you set your "endDateTime" variable in the following way using the datetime package, if you are using Python (script attached):

endDateTime = datetime.now.strftime("%Y%m%d %H:%M:%S")

Regards,

Javed


On Tue, Aug 17, 2021 at 6:21 AM edwardgonen via <edwardgonen=[email protected]> wrote:
Hi,

I'm trying to get historical 5 mins bars for US futures, like ES, NQ etc, for several days back. So I'm calling the?
reqHistoricalData(tickerId, contract, endDateTime, "2 D", "5 mins", "TRADES", 0, 1, false, historicalDataOptions);

The interesting fact is that the data is reported back for each day in range of 1:00am through 23:55. It is instead of getting it in the exchange time (Chicago) or, preferably in time Zone I want (like EST). As you know there is an one hour break in the futures trading. So it seems like IB treats that break as the beginning of new day.

The question is - can I somehow cause the IB to return historical bars in the exchange time zone (or even better - specify the desired timezone like EST)?

Or am I doing something wrongly?

Thanks
Ed
?


US futures historical data in exchange time

 

Hi,

I'm trying to get historical 5 mins bars for US futures, like ES, NQ etc, for several days back. So I'm calling the?
reqHistoricalData(tickerId, contract, endDateTime, "2 D", "5 mins", "TRADES", 0, 1, false, historicalDataOptions);

The interesting fact is that the data is reported back for each day in range of 1:00am through 23:55. It is instead of getting it in the exchange time (Chicago) or, preferably in time Zone I want (like EST). As you know there is an one hour break in the futures trading. So it seems like IB treats that break as the beginning of new day.

The question is - can I somehow cause the IB to return historical bars in the exchange time zone (or even better - specify the desired timezone like EST)?

Or am I doing something wrongly?

Thanks
Ed
?


Data

Eduardo Esteva Kremer
 



Hi,

What's the difference between using reqMktData() and reqTickByTickData() ?

When using the latter, it seems you receive Bid Ask quotes a little faster. Doesn't it ?

Best

Eduardo Kremer


Re: reqFundamentalData not working this week

 

Nothing major changed on my end. All last week we had two situations:

After TWS restart:

  • Requests for four of the seven data types succeed
  • Requests for ReportSnapshot, ReportsFinSummary, ReportsFinStatements, and ReportsOwnership succeed and provide XML that looks good (though we are not consuming it)
  • Requests for ReportRatios and RESC fail with error 430 and message suffix "failed to fetch"
  • Requests for CalendarReport fail with error 430 and message suffix "Not allowed"

All last week, after TWS lost connection with IB briefly during the maintenance window and had to retry a few times to login, only one of the seven would succeed:

  • Requests for ReportsOwnership succeeds
  • Requests for all other types fail with error 430 and message suffix "Not allowed"
This second situation persists until our next TWS restart.

´³¨¹°ù²µ±ð²Ô

PS. We did update to TWS 985.1k over the weekend and, so far, see the first scenario (four work, three fail)


Re: reqFundamentalData not working this week

 

Hey Guys, Is this still an issue for you all as well ??


Re: How to interpret "Count" & "Volume" in historical data?

 

Welcome to the group.

As far as I know there is no one standard for exactly what is counted in volumes, number of trades, and even OHLC prices. Just like I am often surprised what is being sold as "Bratwurst".

The largest chunk of difference comes from the fact that IBKR reports historical bars in "lots of 100" and you get much closer to the number reported on other sites after multiplying the bar lot volume with 100.

We don't work with bar data or historical data that much but I happened to have some IBKR historical bar data for IBM in January 2020. For 2020-01-24, for example, IBKR reports for exchange=SMART:

  • 37,922 lots -> 3,792,200 shares during regular trading hours only
  • 42,571 lots -> 4,257,100 shares during regular and extended trading hours
Yahoo finance and NYSE report about 5.58 million shares for that day (however they define day). Here some thoughts on where the difference comes from:
  • IBM is being traded on over 20 exchanges and SMART covers only some of them. Would be interesting to iterate over all valid exchanges and add up all results. That may get you pretty close to what others report. For example for exchange=NYSE, IBKR reports 10,960 lots -> 1,096,000 shares (rth=false) for that day.
  • It could also be that IBKR only counts "reportable" trades and does not count "odd lots". Just like the difference between the real time ticks RtVolume and RtTradeVolume. Not counting odd lots would seriously reduce the number of trades and could account for the gap.
Hope this points you in the right direction. Let us know in case you learn more

´³¨¹°ù²µ±ð²Ô


How to interpret "Count" & "Volume" in historical data?

 

Sorry, I'm new with IB API. Recently started experimenting with historical bar data via??with?whatToShow =?"Trades". It returns prices as expected, but the volumes and trade counts are really weird. E.g. hourly volumes for AAPL are somewhere between 20k-100k for SMART exchange and even lower for NYSE/AMEX/etc - order of magnitude lower than the real data. For other symbols like IBM hourly volume could be in less than 1k. What am I missing here??


Re: TWS data providers in the cloud OR " I don't want to run a TWS instance on my machines any more"

 

¿ªÔÆÌåÓý

We looked at quite a few of the financial data vendors using websockets it's certainly interesting. Coding it is simple enough and the one that piqued our interest was

then

or

?It's certainly a route worth considering. I didn't know about SSE and thank you for pointing that out.

have an excellent one

cp

?

On 8/15/21 1:59 PM, ´³¨¹°ù²µ±ð²Ô Reinold via groups.io wrote:

Thank you for your kind words, CP. The group has definitely been valuable to us since many topics triggered reviews of our approaches and often helped us mature our environment.

Many of the more modern market data providers (including the IB Client Portal API) employ for the delivery of data streams. In these cases, no additional software is required on your end other than your decision making tool that receives the ongoing stream. Libraries for pretty much every programming language exist that present data streams to your application in the most natural form of streaming foe the language. are bi-directional and has a nice echo server you can use to try them out. Many web sites and mobile aps use WebSockets for quite a while already.

Another standard that I have seen are unidirectional that again, show up as data streams in your application.

´³¨¹°ù²µ±ð²Ô


Re: TWS data providers in the cloud OR " I don't want to run a TWS instance on my machines any more"

 

Thank you for your kind words, CP. The group has definitely been valuable to us since many topics triggered reviews of our approaches and often helped us mature our environment.

Many of the more modern market data providers (including the IB Client Portal API) employ for the delivery of data streams. In these cases, no additional software is required on your end other than your decision making tool that receives the ongoing stream. Libraries for pretty much every programming language exist that present data streams to your application in the most natural form of streaming foe the language. are bi-directional and has a nice echo server you can use to try them out. Many web sites and mobile aps use WebSockets for quite a while already.

Another standard that I have seen are unidirectional that again, show up as data streams in your application.

´³¨¹°ù²µ±ð²Ô


Re: TWS data providers in the cloud OR " I don't want to run a TWS instance on my machines any more"

 

¿ªÔÆÌåÓý

first of all, congratulations on your new role and thank you for taking the time.

I "was" hoping that the sign on to the data vendor would be at level where I subscribed to their "account" with IB not mine. So they would have a relationship with IB and farm out the data using whatever subscription level I signed up for.? That way they wouldn't need to have any access to my account and they could cater to hundreds of NON IB subscribers who just want the data.

I have looked at? quite a few market providers and agree that it's an option. Many of them require some kind of process to run my end which defeats the object for me. I like the simplicity of the IB api but don't want to keep supporting the environment. It's not a HUGE effort to be honest. Start it up on a Sunday and just let it reboot at 9pm every day, I run it on an old hp 8440p laptop so it's pretty reliable.

?I don't need the IB client data BUT didn't know about the Client Portal so I will certainly look into that.

Again thank you so much for taking up the new role, this is an excellent forum and I always find the people here helpful and knowledgeable in a respectful and considerate manner. A refreshing change I think.

cp


On 8/15/21 11:59 AM, ´³¨¹°ù²µ±ð²Ô Reinold via groups.io wrote:

I am not aware of any such service and can come up with a long list of reasons why this would probably not be a good idea. One of them is security since that TWS would have to be logged into your IB account and anyone with access to the TWS will have access to your account.

Let me put my system architect hat on for a moment. When you do a quick "what -> why -> how" assessment, TWS is a "how" that provides a large number of different functions and It sounds like you are interested primarily in the market data stream function. So I am wondering whether you would be better served with a dedicated market data stream provider (independent of TWS and IB). It would work very much like you described, but without TWS, IB, or your IB account. Such an approach would likely give you "better" market data streams (richer features, lower real-time latency, broader historical data). Keep in mind that main purpose for IB market data is the support of trading via TWS and is not a general purpose market data service.

If you need IB related information as well (such as positions, account related details), maybe the would work for you. But that is less mature than the TWS API, requires a small gateway between your application and IB, and comes with all IB account related limitations.

´³¨¹°ù²µ±ð²Ô


On Sun, Aug 15, 2021 at 10:29 AM, comicpilsen wrote:

"start up a program on a machine on MY network which logs into a TWS data vendor's machine. Once the credentials are ratified and the session established I can send API requests to the vendor and receive the STREAM of data back and pump it into reliable queues which populate my decision matrix. I do NOT want to trade on this system as it's used to AUGMENT my trading."


Re: TWS data providers in the cloud OR " I don't want to run a TWS instance on my machines any more"

 

I am not aware of any such service and can come up with a long list of reasons why this would probably not be a good idea. One of them is security since that TWS would have to be logged into your IB account and anyone with access to the TWS will have access to your account.

Let me put my system architect hat on for a moment. When you do a quick "what -> why -> how" assessment, TWS is a "how" that provides a large number of different functions and It sounds like you are interested primarily in the market data stream function. So I am wondering whether you would be better served with a dedicated market data stream provider (independent of TWS and IB). It would work very much like you described, but without TWS, IB, or your IB account. Such an approach would likely give you "better" market data streams (richer features, lower real-time latency, broader historical data). Keep in mind that main purpose for IB market data is the support of trading via TWS and is not a general purpose market data service.

If you need IB related information as well (such as positions, account related details), maybe the would work for you. But that is less mature than the TWS API, requires a small gateway between your application and IB, and comes with all IB account related limitations.

´³¨¹°ù²µ±ð²Ô


On Sun, Aug 15, 2021 at 10:29 AM, comicpilsen wrote:

"start up a program on a machine on MY network which logs into a TWS data vendor's machine. Once the credentials are ratified and the session established I can send API requests to the vendor and receive the STREAM of data back and pump it into reliable queues which populate my decision matrix. I do NOT want to trade on this system as it's used to AUGMENT my trading."


Re: TWS 985 changes quote size units for US stocks

Nick
 

In the past I was looking at futures so I didn't have the lots/shares issue. Thanks for the heads-up about the change in reporting.

On 8/15/2021 12:11 PM, ´³¨¹°ù²µ±ð²Ô Reinold via groups.io wrote:
Since they are reporting individual trades, TickByTick always reported shares not lots.


Re: TWS 985 changes quote size units for US stocks

 

Since they are reporting individual trades, TickByTick always reported shares not lots. That is also true for RtTradeVolume, RtVolume, and Level II data feeds.

The way I read the change is that it impacts the size reporting :

  • BidSize with TickId 0
  • AskSize with TickId 3
  • LastSize with TickId 5

Plus reporting in some TWS windows.

I guess if you are happy with the current #lots reporting, there is nothing you need to do and the "stable" version 983 is fine. But if you want #shares for those three tick types, the "latest" 985 version will be required. In any case, #shares reporting will be the way to go i the future so that we might want to prepare our apps and drop the '*100' at some time.

´³¨¹°ù²µ±ð²Ô


TWS data providers in the cloud OR " I don't want to run a TWS instance on my machines any more"

 

Hi All I have been running a TWS mosaic session on a machine on my network for some 3 years and it's excellent. I get to see what is going on AND I can use it to get data when I need to using the api using Python. It's almost problem free so that's GREAT!!! BUT I would like to start to investigate vendors of IB data in the cloud without having to maintain a login to my IB account. I know that I could run the TWS in the cloud but that means I still have to maintain it where all I want is the data. I don't even know if there are any vendors that allow access to the TWS api and maintain the environment for me. I thought that someone might have walked this path before and I would appreciate ANY guidance.

To make sure I am being clear here is what I would like to do.

"start up a program on a machine on MY network which logs into a TWS data vendor's machine. Once the credentials are ratified and the session established I can send API requests to the vendor and receive the STREAM of data back and pump it into reliable queues which populate my decision matrix. I do NOT want to trade on this system as it's used to AUGMENT my trading."

I hope this isn't off topic for this forum and if it is please feel free to delete it as a topic. I don't want to interfere with the wonderful flow of this forum. cp


Re: TWS 985 changes quote size units for US stocks

Nick
 

¿ªÔÆÌåÓý

With TWS 981.3c and Api 9.73 I am seeing stock bid/ask size for TickByTick data in shares but for MktData I'm seeing it in lots.

I don't have any of the related TWS config settings.

TWS 981.3c is the stable version but looks like if you want the config settings you have to install TWS latest.

On 8/15/2021 12:33 AM, ´³¨¹°ù²µ±ð²Ô Reinold via groups.io wrote:

You may have known this, but we did not. Apparently the US SEC updated some rules last year that lead to IBKR changing the way quote size data is displayed in TWS and reported to the API for US stocks.

TWS 985.1k provides two new configuration parameters in the API section of the Global Configuration that deal with this change:

  • One in API->Precautions that bypasses the nagging (and possibly blocking) dialogue during TWS startup called "Bypass US Stocks market data in shares warning for API Orders"
  • One in API->Settings that controls whether they send sizes in units of "lots" or "shares" called "Send market data in lots for US Stocks for dual-mode API clients". Not quite sure what they mean with "dual mode API clients".


TWS 985 changes quote size units for US stocks

 

You may have known this, but we did not. Apparently the US SEC updated some rules last year that lead to IBKR changing the way quote size data is displayed in TWS and reported to the API for US stocks. AskSize, BidSize, and LastSize are now? in #shares not in #lots of 100 any longer. The change was implemented in TWS 985.1k that we installed this week as part of our weekend updates.

There is a document that describes the changes: And the .

TWS 985.1k provides two new configuration parameters in the API section of the Global Configuration that deal with this change:

  • One in API->Precautions that bypasses the nagging (and possibly blocking) dialogue during TWS startup called "Bypass US Stocks market data in shares warning for API Orders"
  • One in API->Settings that controls whether they send sizes in units of "lots" or "shares" called "Send market data in lots for US Stocks for dual-mode API clients". Not quite sure what they mean with "dual mode API clients".

IB suggests that API clients migrate to "quotes in shares" at our earliest convenience.

Hope this helps,
´³¨¹°ù²µ±ð²Ô

Popup during TWS startup


From TWS 985 Release notes:

US Stock "Size" Quotes Displayed in Shares

Previously, US stock size quotes were displayed in round lots (of 100 shares). Effective with TWS release 985 and above, the bid, ask, and last size quotes are displayed in shares instead of lots.

API users have the option to configure the TWS API to work in compatibility mode for older programs, but we recommend migrating to "quotes in shares" at your earliest convenience. To use compatibility mode, from the Global Configuration > API > Settings page, check "Bypass US Stocks market data in shares warning for API orders."

?


Re: TickByTick data outage during the night?

 

¿ªÔÆÌåÓý

Hi,

Mij tws chart showed the same behavior, but the api kept delivering the correct price and volume data. But in the api, I use tickString for price and volume, so that may be the difference between what's shown in the tws chart versus the api data I collected.

Regards,
Raoul



On 12-08-2021 22:31, ´³¨¹°ù²µ±ð²Ô Reinold via groups.io wrote:

So here is a new one for me. Did anyone else experience TickByTick data outage during the night?

  • Between 03:26 and 06:26, no TickByTick values were delivered for the instruments we monitor. (Chicago Time)
  • But all other level I and level II market data did arrive timely.
  • Also, TWS charts show a gap for that time frame. See below ES, VX, YM, and ZN.

All evidence indicates that trading took place normally and, for example, "Volume" and "RtTradeVolume" market data ticks agree that just over 24,000 ESU1 contracts traded during that time frame.

I cannot find any error messages or warnings, no TWS disconnects, no Market Data Farm warnings, ...

The exact time frame was [1628756782601, 1628767570816] just shy of exactly 3hrs

  • Thursday, August 12, 2021 3:26:22.601 AM GMT-05:00 DST
  • Thursday, August 12, 2021 6:26:10.816 AM GMT-05:00 DST



Re: TickByTick data outage during the night?

Nick
 

¿ªÔÆÌåÓý

Sure but the OP is talking about several hours of no activity at all. That is not throttling it's an outage.


On 8/13/2021 9:09 AM, YSS wrote:

IB's data feed is not a true tick by tick data feed.

I compared different datafeeds and IBs was missing a lot of data. They do this on purpose with their burst feed (4x per second) and to avoid paying non-screen feed status with the exchanges.