Zorro processes. Integration in 3rd party software.

Zorro can be used for trading, backtests, optimizations, or other computations under control from a VC++ project, a software application, or from a Zorro 'master' instance. For this purpose, a ZorroControl DLL provides functions to start, stop, and exchange information with one or several Zorro processes (up to 72). A Zorro process is a single Zorro.exe instance running a given script and returning a result. In this way Zorro scripts can be run from other trading platforms, user interfaces, or software tools. 





The following API functions are available in the ZorroControl DLL. They can be called from other programs, and can also from Zorro scripts:

zInit (int Num, int Size): int

Initializes the interprocess communication and determines the maximum number of processes and the size of the data area per process. Must be called first from the ZorroControl DLL and from all Zorro processes. Returns 0 when no communication channel could be established, otherwiee nonzero.

zOpen (int Id, const char* Commandline): HANDLE

Starts a single Zorro process with the given identifier and command line. Must be called from the ZorroControl DLL or the master instance. Returns the process handle, or 0 when no process could be started due to an error in the command line, no Zorro S license, no Zorro.exe in the same folder, or a failed zInit call.

zStatus (int Id): int

Returns 1 when the process is still running, 0 otherwise. Must be called from the ZorroControl DLL or master instance. 

zClose (int Id)

Closes the Zorro process with the given Id. Id == 0 closes all Zorro processes. Must be called from the ZorroControl DLL or the master instance.

zData (int Id): void*

Returns a pointer to a memory area of the previously given Size for exchanging data and information with the Zorro process with the given Id. Every process has its own data area, but can also read or write to other processes' data areas. For the data area, a byte-aligned struct can be defined that contains the variables to be exchanged (see example). 


Num Total number of processes to handle, 2..72. The master instance is always process 1.
Size Size of the data area for information exchange per process, in bytes. 8 bytes per var, 4 bytes per int.
Id Process identifier number, 2..Num, or 1 for the master instance.
Commandline Command line parameters for the Zorro process. If no script name is given, the script of the master instance is used.


Nonzero when successful, 0 otherwise.


Example (see also the Process.c script):

typedef struct INFO { 
  var Position; 

INFO *Own, *Other;

void main()
  if(!zInit(2,8)) {
    printf("Can't initialize process!"); 

  if(Core <= 1) zOpen(2,"-w 320"); // shift window to the side
  Own = zData(Core);
  Other = zData(3-Core); // Core is 1 or 2

  while(wait(1)) {
    Other->Position = slider(2);

See also:

Licenses, Core, command line ► latest version onlin