Gamestudio Links
Zorro Links
Newest Posts
Performance reporting showing Annual and monthly % returns
by OptimusPrime
Today at 01:19
Issue with inconsistent test results
by kvm
Yesterday at 17:24
Access string content through another string
by ChrstphFr
Yesterday at 11:30
How to return a vector from a function
by Superku
Yesterday at 05:39
Vector Displacement, realtime Blendshapes
by jumpman
08/14/18 23:46
Code Repository
by OptimusPrime
08/14/18 13:25
Votes for future features
by OptimusPrime
08/14/18 07:18
AUM Magazine
Latest Screens
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Forgotten Tales - Demo version
Who's Online
6 registered (Dalla, kvm, jenGs, firecrest, alibaba, bailemad), 452 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
Ulenspegel, toto, FloMi, behr065, OptimusPrime
18027 Registered Users
Topic Options
Rate This Topic
#472529 - 05/03/18 10:50 Push-based broker plugins
Veratyr Offline

Registered: 01/08/16
Posts: 118
I've been testing the multi-broker beta with recording tick data for a few brokers and assets and I've found that Zorro frequently can't keep up with all the data.

My guess is that this is because Zorro is polling every broker for every asset.

At the moment my only option seems to be decreasing tick resolution (and hence increasing latency).

I think it'd be better if instead of polling for prices, broker plugins could push them. An API something like BrokerAsset(char* asset, FARPROC fpAsset) that the plugin can call when it gets a price update.

#472535 - 05/03/18 15:28 Re: Push-based broker plugins [Re: Veratyr]
Zheka Offline

Registered: 07/03/17
Posts: 294

AFAIK, the default Zorro price update request interval is 100ms.
Set TickTime to 10-20 to get nearly all the ticks.

Setting TickTime=1 will most probably bear significant overhead and will indeed slow things up.

Edited by Zheka (05/03/18 15:35)

#472562 - 05/05/18 00:24 Re: Push-based broker plugins [Re: Zheka]
Veratyr Offline

Registered: 01/08/16
Posts: 118
Yeah, I'm aware. The problem is that polling starts to choke pretty quickly when you've got a few brokers and when you're looking at arbitrage, a delay of 10ms is huge.

I suspect most of my problem is caused by the MT4 broker plugin itself though. I'm trying to write a FIX plugin to get around that. It should bring the BrokerAsset call down to no more time than copying a double from RAM.

#472572 - 05/05/18 17:09 Re: Push-based broker plugins [Re: Veratyr]
Zheka Offline

Registered: 07/03/17
Posts: 294

1) I might be wrong, but looking through the MT4 mql file . From what I can tell, it should actually trigger on any tick, OR on a timer (which you can change in the header). It might be that TickTime has nearly no influence on an MT4 plugin...but I might be wrong.

2) Even if it does, it's not really a 10ms delay. 10ms rather a max delay.

3) You can run a Zorro instance per broker connection to split the load (so that each Zorro occupies one CPU core) and exchange data via a global variable ( or implement this yourself).

4) I think the whole exercise is futile: theoretical arbitrage opportunities might exist if you trade vs. an pure MM MT4 server, but most serious brokers are STP and use more or less the same LPs. You might indeed observe a worthy price difference in MT4 but you will not be able to get filled at such prices.
MT4 introduces a significant overhead, getting to FIX makes you compete with FPGAs.

#472574 - 05/05/18 20:09 Re: Push-based broker plugins [Re: Zheka]
Veratyr Offline

Registered: 01/08/16
Posts: 118
1) I did a pretty basic test and whatever's going on, it's not good enough. I sat Zorro next to MT4 and just watched the quotes. Zorro at times sat still for several hundred milliseconds while I watched MT4 tick over repeatedly.

2) No, it's a minimum delay. Per

The minimum time between two tick calls can be set up with TickTime. If a new quote arrives earlier, it is delayed until the TickTime is over.

3) Sure but if I'm writing extensive logic outside Zorro, there's little point using Zorro. Broker arbitrage doesn't require a whole lot of complex logic.

4) Theoretically, if a broker is STP and using the same LPs, yes, this is true. However I think brokers do a lot of order matching between their own clients, so it's not entirely STP.

I've already been recording FIX data across a few brokers and there are definitely opportunities there. These brokers are too small for the folks with serious resources like FPGAs and ASICs to deal with.

#473388 - 07/02/18 16:40 Re: Push-based broker plugins [Re: Veratyr]
AndrewAMD Offline
Senior Member

Registered: 02/21/17
Posts: 338
Loc: Chicago
It seems Zorro can now receive every tick - as long as it's supported by the respective broker plugin.

Here is the new Zorro Broker API feature, now in beta:

For asynchronously triggering a price quote request, send a WM_APP+1 message to the window handle received by the SET_HWND command. For triggering the callback function, send a WM_APP+2 message. This can be used for prices streamed by another thread. An example for sending messages can be found under HWnd.
Further reading:


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at)