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
3 registered members (AndrewAMD, Quad, TipmyPip), 865 guests, and 6 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
New BrokerCommand: SET_TRIGGER_PIPE #472858
05/26/18 21:21
05/26/18 21:21
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

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

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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,718
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

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

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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,718
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

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