Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (blaurock), 750 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
run() delayed with IB and many assets #485763
04/20/22 11:51
04/20/22 11:51
Joined: Aug 2021
Posts: 101
M
MegaTanker Offline OP
Member
MegaTanker  Offline OP
Member
M

Joined: Aug 2021
Posts: 101
I'm using BarOffset with daily bars to trigger the run() function at the desired trading time. When I try this out, I notice that the actual execution is delayed around 10 minutes after the time set in the script. When I reduce the number of assets being looped from around 60 to just 3, the delay becomes much shorter as well, though it's still not very precise. I'm assuming this is related to slow price requests from IB.

1. Is there anything that can be done about this, to execute the run() more precisely with many assets?

2. I notice the timestamp in the status bar updates much less frequently with many assets. What triggers an update of this timestamp?

3. How exactly does Zorro build these daily candles with BarOffsets? Does it collect live data in some interval and then use this data to construct the candle when it closes?

Re: run() delayed with IB and many assets [Re: MegaTanker] #485766
04/20/22 14:10
04/20/22 14:10
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Price requests from IB can be up to 10 seconds. And prices are updated immediately before the run function, so with several 100 assets you can indeed get a 10 minutes delay.

Price requests are much faster when you activate the 'fast' price type - see https://zorro-project.com/manual/en/brokercommand.htm. Otherwise, when your trading is time critical, set BarOffset accordingly earlier.

Zorro builds daily candles in the way you described. In your case they are collected every 10 minutes.

Re: run() delayed with IB and many assets [Re: MegaTanker] #485768
04/20/22 14:33
04/20/22 14:33
Joined: Aug 2021
Posts: 101
M
MegaTanker Offline OP
Member
MegaTanker  Offline OP
Member
M

Joined: Aug 2021
Posts: 101
I see, thank you. The 'fast' mode makes the delay bearable, cuts it down to around a minute delay with 60 assets.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1