Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Nymphodora, AndrewAMD, TipmyPip, Quad, Imhotep), 847 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Push-based broker plugins #472529
05/03/18 08:50
05/03/18 08:50
Joined: Jan 2016
Posts: 122
V
Veratyr Offline OP
Member
Veratyr  Offline OP
Member
V

Joined: Jan 2016
Posts: 122
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.

Re: Push-based broker plugins [Re: Veratyr] #472535
05/03/18 13:28
05/03/18 13:28
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
http://zorro-project.com/manual/en/ticktime.htm

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.


Last edited by Zheka; 05/03/18 13:35.
Re: Push-based broker plugins [Re: Zheka] #472562
05/04/18 22:24
05/04/18 22:24
Joined: Jan 2016
Posts: 122
V
Veratyr Offline OP
Member
Veratyr  Offline OP
Member
V

Joined: Jan 2016
Posts: 122
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.

Re: Push-based broker plugins [Re: Veratyr] #472572
05/05/18 15:09
05/05/18 15:09
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783

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 (https://fx1.net/sharedvar.php 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.

Re: Push-based broker plugins [Re: Zheka] #472574
05/05/18 18:09
05/05/18 18:09
Joined: Jan 2016
Posts: 122
V
Veratyr Offline OP
Member
Veratyr  Offline OP
Member
V

Joined: Jan 2016
Posts: 122
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 http://zorro-trader.com/manual/en/tick.htm:

Quote:
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.

Re: Push-based broker plugins [Re: Veratyr] #473388
07/02/18 14:40
07/02/18 14:40
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
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:

Quote:
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:
http://zorro-project.com/manual/en/hwnd.htm
http://zorro-project.com/manual/en/brokerplugin.htm
http://zorro-project.com/manual/en/brokercommand.htm
http://zorro-project.com/manual/en/tick.htm
https://msdn.microsoft.com/en-us/library/windows/desktop/ms644944(v=vs.85).aspx


Moderated by  Petra 

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

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

Powered by UBB.threads™ PHP Forum Software 7.7.1