Gamestudio Links
Zorro Links
Newest Posts
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
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, 1 invisible), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
New BrokerCommand: SET_TRIGGER_PIPE #472858
05/26/18 21:21
05/26/18 21:21
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline OP
Serious User
AndrewAMD  Offline OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
I would like to request that a new BrokerCommand SET_TRIGGER_PIPE be supported by Zorro. Below is my explanation.

The broker API is synchronous in nature. I am proposing a basic way for Zorro to set up a dedicated asynchronous listener, so that a plugin can request a BrokerAsset call for a specific Asset.

Command: SET_TRIGGER_PIPE
Text/Parameter: PipeName (f.i. "\\.\pipe\PipeName")

Sets the name of an existing named pipe. Zorro will create the named pipe and asyncronously listen to it. The plugin will write to the pipe using the Trigger Protocol defined below. Return Value: the version number of the Trigger Protocol supported, or zero if not supported.


Proposal for Trigger Protocol (Version 1):

The protocol will consist entirely of fixed-size messages. Each message will be exactly 128 bytes. The message will contain a null-terminated string.

The message struct:

Code:
typedef struct TRIGGER_V1
{
	char Asset[128];
} TRIGGER_V1;


Here's how it works:

* Plugin has a dedicated listener.
* Plugin receives market data.
* Plugin sends Asset name to pipe.
* Zorro calls BrokerAsset() for the specified Asset.

On the Zorro side, instead of sleeping for TickTime between BrokerAsset calls, there can be a listener with a timeout of TickTime. This way, no multithreading is required.

And that's it. No need to rewrite the broker API from scratch in order to support pushing market data.

Re: New BrokerCommand: SET_TRIGGER_PIPE [Re: AndrewAMD] #472899
05/28/18 20:46
05/28/18 20:46
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
That makes sense. Put on the todo list.

Re: New BrokerCommand: SET_TRIGGER_PIPE [Re: jcl] #473187
06/19/18 16:18
06/19/18 16:18
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline OP
Serious User
AndrewAMD  Offline OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
jcl,

I do realize my above method is possibly overkill.

If convenient, some alternative approaches can be employed. For example, I know that with Boost Asio, there is a trick where one can change the deadline of a timer on another thread to trigger an event on that other thread.

So really, the core issue is that we need Zorro's main thread to enter a state of waiting for a network event to occur.

Of course, I will happily employ whichever trigger method is made available. Thanks.

Re: New BrokerCommand: SET_TRIGGER_PIPE [Re: AndrewAMD] #473377
07/02/18 09:46
07/02/18 09:46
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
We'll do that not with a pipe, but will make the Zorro window handle available to other processes, so that they can send messages and trigger price requests.

Re: New BrokerCommand: SET_TRIGGER_PIPE [Re: jcl] #473383
07/02/18 12:07
07/02/18 12:07
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline OP
Serious User
AndrewAMD  Offline OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
This is even better, thanks!


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