Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Hourly data from IB #485024
01/10/22 13:41
01/10/22 13:41
Joined: Aug 2021
Posts: 98
M
MegaTanker Offline OP
Junior Member
MegaTanker  Offline OP
Junior Member
M

Joined: Aug 2021
Posts: 98
assetHistory has a mode for hourly data, but the manual only lists Bittrex and CryptoCompare for this mode. I tried using it with IB and while it looks like it kind of works, it produces a kind of corrupt history that looks like the image below. I'm assuming this means that this feature does not properly support IB? It would be a nice option considering minute data takes a day to download for a single asset due to their API limits.

[Linked Image]

Re: Hourly data from IB [Re: MegaTanker] #485026
01/10/22 13:49
01/10/22 13:49
Joined: Feb 2017
Posts: 1,634
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,634
Chicago
I think it's more correct to say that IB has bad historical data.

Re: Hourly data from IB [Re: MegaTanker] #485028
01/10/22 14:33
01/10/22 14:33
Joined: Aug 2021
Posts: 98
M
MegaTanker Offline OP
Junior Member
MegaTanker  Offline OP
Junior Member
M

Joined: Aug 2021
Posts: 98
Maybe, but is it THAT bad? Even downloading something liquid like QQQ, these artifacts still exist (though they're more rare). And when viewing the graph in the TWS, the data does not have these errors.

Re: Hourly data from IB [Re: MegaTanker] #485029
01/10/22 14:56
01/10/22 14:56
Joined: Feb 2017
Posts: 1,634
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,634
Chicago
You assume that the data displayed in TWS is the same data output by the Gateway API.

Re: Hourly data from IB [Re: MegaTanker] #485030
01/10/22 15:27
01/10/22 15:27
Joined: Aug 2017
Posts: 265
Netherlands
G
Grant Online
Member
Grant  Online
Member
G

Joined: Aug 2017
Posts: 265
Netherlands
Andrew, would this mean that TWS (probably) has an internal data correction feature?

It's a shame that this reputable broker, which was once a front-runner in trading technology, hasn't fixed these basic issues.

Last edited by Grant; 01/10/22 15:28.
Re: Hourly data from IB [Re: MegaTanker] #485031
01/10/22 17:28
01/10/22 17:28
Joined: Apr 2008
Posts: 581
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 581
Austria
Neither bad data nor TWS correction, but IB hourly data is not probably not implemented in assetHistory. Load M1 and then convert it to H1, or post a feature request for IB H1 with assethistory.

Re: Hourly data from IB [Re: MegaTanker] #485044
01/11/22 16:43
01/11/22 16:43
Joined: Jul 2017
Posts: 781
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 781
If you are at least slightly familiar with Python you can use ib_insync and its ready-to-use notebooks for basic tasks: https://nbviewer.org/github/erdewit/ib_insync/blob/master/notebooks/bar_data.ipynb

Re: Hourly data from IB [Re: MegaTanker] #485045
01/11/22 20:07
01/11/22 20:07
Joined: Aug 2021
Posts: 98
M
MegaTanker Offline OP
Junior Member
MegaTanker  Offline OP
Junior Member
M

Joined: Aug 2021
Posts: 98
While we're on the topic the IB api... Does anyone know exactly what their BID_ASK mode returns for the Open and Close? The doc states "Time average bid" for Open and "Time average ask" for Close but I'm not sure what that means and I don't find it explained anywhere in the doc. The bars it returns look strange. See below comparison of TRADES mode vs BID_ASK mode

[Linked Image]
[Linked Image]

Re: Hourly data from IB [Re: MegaTanker] #485046
01/12/22 00:33
01/12/22 00:33
Joined: Oct 2018
Posts: 75
7
7th_zorro Offline
Junior Member
7th_zorro  Offline
Junior Member
7

Joined: Oct 2018
Posts: 75
Try this.

Outlier = 0;

Re: Hourly data from IB [Re: MegaTanker] #485047
01/12/22 01:23
01/12/22 01:23
Joined: Jul 2017
Posts: 781
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 781
'Time average bid' is the average of all bids during the bar; same for asks. Similar to what Zorro delivers with price().

The bid-ask spread is negligible relative to a 1-hr high-low range - so you see these marks as almost one on the chart.

Page 1 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1