Zorro command line

Zorro can be started directly with a script from an external program, a shortcut, or a Windows command shell, like this:

"C:\Users\YourName\Zorro\Zorro.exe" [scriptname] [options]

For starting it manually with command line options, use the Windows command prompt, navigate to your Zorro folder (cd command), type in the command line, for instance Zorro -diag, and hit the [Enter] key.

If a script name is given, Zorro will open and start it. scriptname (without blanks, special characters, or extension ".c" or ".x") must be an existing script in the Strategy folder; subfolders are not supported through the command line. While the script is running, the COMMAND status flag is set to indicate that it's run from the command line. Several Zorro functions use this way to start other Zorro processes, f.i. for multicore training, retraining, or retesting. External tools, like the genetic optimizer, also use the command line.

You can give a command line option either directly in the Windows command prompt, or with the Windows [Run] function, or by editing the properties of a Zorro shortcut on the Windows desktop. For this, right click the shortcut icon and select Properties (for icons in the task bar you need to hold the [Shift] key). Under the shortcut tab you'll see the Target field containing the exact location of Zorro.exe within quotation marks. Add command line options, such as '-diag', after the last quotation mark, and save the modified shortcut with [Apply].

Besides the script name, the following command line options can be given (Zorro S only):

-run

Run the script in [Test] mode, and exit afterwards.

-train

Run the script in [Train] mode, and exit afterwards.

-trade

Run the script in [Trade] mode.

-edit

Select the script and open it in the editor.

-h

In combination with -run, -train, or -trade: run with minimized Zorro window.

-stay

In combination with -run, -train, or -trade: don't close Zorro afterwards.

-a assetname

Select the given asset from the [Assets] scrollbox.

-c accountname

Selects the account with the given name from a user defined account list.

-d definename

Passes a #define statement with the given name to the script (Zorro S only). This way, a script started with the command line can behave differently. Only a single #define can be set through the command line.

-i number

Passes an integer number to the script (Zorro S only) that can be read through the Command variable. Up to 4 numbers can be transferred to the script, each preceded by "-i". This way, the same script started with the command line can behave in different ways.

-x 

Compiles the selected script to an executable, like the EXE mode, and exit afterwards (Zorro S only).

-diag

Starts Zorro in 'black box' mode, as if the DIAG flag was set. Used for debugging the startup behavior. A message "diagnostics mode" will appear in the message window at startup, and the DIAG flag is automatically set in subsequent scripts. Startup events are recorded to a file "diag.txt" in the Zorro main folder. Black box recording strongly reduces the program speed, so do not use this feature unnecessarily.

-quiet

Don't open a message box when Zorro encounters a fatal error; print the error in the message window instead.
   

Examples

"c:\program files\Zorro\Zorro.exe" -train Z3

Starts a re-training run with the Z3 strategy.

"c:\program files\Zorro\Zorro.exe" -run pricedownload -a USD/CAD

Runs the script pricedownload.c with the selected asset "USD/CAD" in test mode.

"c:\program files\Zorro\Zorro.exe" -diag

Starts Zorro in diagnostics mode. A file diag.txt is generated in the Zorro folder.

See also:

Testing, Training, Trading, Zorro.ini

► latest version online