Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 642 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
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