Trading a strategy. Interpreting log messages.

Click [Trade]. Zorro will connect to the broker and start spending your money. This happens in several steps:

While trading, Zorro will detect when the .par, .c, .fac or .ml files that contain the parameters, rules, capital allocation factors, or machine learning models are updated by a re-training process. In that case they are automatically reloaded at the begin of the next bar period. It is recommended to retrain strategy parameters and rules regularly (see WFO) for taking care of market changes. This is especially required for parameter-free strategies that have been walk-forward optimized.

The Server Window displays the server date and time shifted to UTC, and the current price of the asset selected by the [Asset] scrollbox (only if that asset is also used in the strategy, otherwise its price is not available). Arriving price quotes are indicated with a blinking asterisk. If the price is currently not available, for instance due to a server problem, XXXXX is displayed instead. "Closed" indicates that the market is currently closed, "Weekend" indicates that trading is suspended due to the weekend or holiday, and "Out of sync" indicates a discrepancy of server time and PC time. The tiny rectangle is green when connected to the server, and red when the connection was lost. Make sure that the displayed time is the correct UTC time and that the local time on your PC is also set up correctly. The server and PC time need not be the same when the time zones are different, but both need to be correct in their respective time zone, otherwise Zorro can not trade properly.

The left segment of the Progress Bar indicates the closed profit of the strategy since starting it, the right segment indicates the total profit or loss of all open trades (including phantom trades). When the right segment is green, your trades are in the profit zone; when the left segment is green, your account is in the profit zone. Otherwise the segment is red.

The Result Window below displays information about the account and profit situation, in the following form:

 4567  +1412  +50  !/\\' 

4567 Current equity, the sum of balance and value of all open trades of the account.
+1412 Money earned (or lost) by the strategy since the start, in account currency units.
+50 Current open trade value of the strategy, in account currency units.
!/\\' Current trades. ! is a trade with locked profit, / a winning, \ a losing, and ' a pending trade.

The Trade Status Page (see below) gives the most detailed view into the current account and trade situation. Note that Zorro displays prices as ask prices and profits/losses including commission, rollover, and spread, so the live values on the Zorro panel might look slightly different than the values in your trading platform for the same trades.

Some trading restrictions apply to the free Zorro version. If you see in the Result Window that your equity has grown above the allowed limit, withdraw profit from your account.


When something happens, Zorro prints a message in the message window and records it in the .log file that can be opened with any text editor. Details about Zorro's log files can be found under file formats.  The messages below are 'hardwired' in the software; their 'verbosity' can be set up with the Verbose variable. Additional messages can be generated by the strategy script using the printf function.

In a message, a trade is identified like this:

[AUD/USD:CY:S1234] - Short trade (S) with AUD/USD, CY algorithm identifier, and a trade number ending with 1234. The trade number can be used to identify the trade in the broker's platform. If a trade is partially closed, the trade ID can change. Trade types are short S, long L, put P, or call C.

{AUD/USD:CY:s1234} - Short phantom trade (lowercase s and winged brackets). Phantom trades are simulated, not executed.

(AUD/USD:CY:L) - Long pending trade (round parentheses). Pending trades are not yet opened and thus have no trade number.

If a message - especially a broker error, see below - is too long and outside the right window border, the content of the message window can be copied by double clicking into the window, then pasted in a text editor.

Startup messages

The following messages are generated at start:

Loading AUD/USD prices... 1000 h

Zorro downloaded 1000 hours recent price history from the broker's server and used it for the LookBack period. If an asset is not available for trading - which can happen with assets that US residents are not allowed to trade, f.i. some CFDs - an error message is issued and the asset must be excluded from the strategy.

Loading AUD/USD prices... 910+111 h

The PRELOAD flag was set and historic price data was available. Zorro read 910 hours price data from its history files and downloaded additional 111 hours price history from the broker's server. For portfolio strategies the number of downloaded hours can differ from asset to asset.

Loading AUD/USD prices... 1000 h, gap 36 h

There is a 36 hours gap between the end of the price data and the current time. This happens when a not suited price source was used for historical data, or when the price server was not recently updated, for instance after a weekend or holiday, or when the market was closed at session start. If the gap is harmful or not depends on strategy and gap size.

Loading AUD/USD prices... 835 h, 65 bars added

The price server could not cover the full LookBack period in time; 65 bars had to be substituted by Zorro. This can happen with some MTR4 brokers. MTR4 servers sometimes get the missing data after a waiting time; in that case the strategy just needs to be restarted after a minute. Added bars are normally not harmful, as missing prices are interpolated. But when a large number of bars has been added, indicators with long time periods can be less accurate at strategy start and cause reduced performance during the first time. Use the PRELOAD flag for overcoming price server limitations.

Loading AUD/USD prices... failed

The asset is available, but price data can not be downloaded. This can happen with MTR4 servers that need a long time for sending assets that have not been requested before (f.i. because no chart with that asset was opened in the MTR4 client). In such a case, start the strategy again after a minute - chances are that the MTR4 server meanwhile got its act together.

[AUD/USD:CY:L4401] - resumed

Zorro is resuming a previously closed or interrupted trading session and continues the trades that were opened in the previous session. Previous trades are not resumed when the new session opened new trades already in the first run.

[AUD/USD:CY:L4401] - (closed)

The trade cannot be resumed. Either an asset named "AUD/USD" was not available at session start (see Error 053), or the trade was externally closed through a 'safety net' stop loss or manually in the broker platform.

Read Trend.par Trend.c Trend.fac

The parameters, rules, and capital allocation factors of the Trend strategy were loaded. This message is generated at start and again when the strategy was re-trained (see below).

End of lookback period

All data series are filled and trading is now enabled.

Bar messages

[21: Wed 11-01-19 00:00] (95.18)

Bar number, bar end time bar end time rounded to 1 second, and optional ask price of the asset selected with the scrollbox. The number of decimals depends on the PIP value of the asset.

[217: Wed 11-01-19 01:15:00] 91.41/96.02\91.35/95.90

Bar number, rounded bar end time, and optional open/high\low/close ask prices of the selected asset with Verbose at 2. If none of the assets used in the script is selected with the scrollbox, no prices are displayed.

[217: Wed 11-01-19 01:15:00] 91.41/96.02\91.35/95.90 -0.15

As before, but with current ask/bid spread with Verbose at 3. The spread is displayed as a negative value to be subtracted from the ask prices for getting the bid prices.

[1385: Fri 12-06-29 00:00] 9038 +1438 9/7 (97.69)

Bar number, rounded bar end time, current equity, current open value, number of open winning/losing positions, and current price (when trades have been opened). The decimals of the equity and open value numbers depend on the decimals setting in the account list.

Trade messages - normal trades

The following messages are generated when trades are entered or exited. Prices and profits displayed are based on the last price quote. Prices are generally displayed as ask prices, even when the position was in fact opened or closed at the bid price. Profits include estimated trading costs. In live trading, real fill prices and profits can slightly deviate due to slippage and differences in trading costs.

[AUD/USD:CY:S] Skipped - Lots/Margin 0

The trade was not entered because Lots or Margin was set to 0.

[AUD/USD:CY:S] Skipped - Margin 10, Min 45

The trade was not entered because MARGINLIMIT is set and the allocated Margin of 10 account currency units was too low for buying 1 lot of the asset, which would require margin 45. If the ACCUMULATE flag is set, the margin of those skipped trades will be accumulated until a trade is eventually entered.

[AUD/USD:CY:S] Skipped - Risk 40, Min 90

The trade was not entered because the allowed Risk of 40 (in account currency units) was too low to cover the trade risk of 90 (see RISKLIMIT).

[AUD/USD:CY:S] Skipped - Total Margin 450

The trade was not entered because MARGINLIMIT is set and the account has not enough free margin to cover the Risk of the trade in a safe distance from a margin call. Either reduce the trade volume, or close open trades, or add some money to the account. You can see the current free margin in the broker platform, f.i. in the Account status of the FXCM Trading Station.

[AUD/USD:CY:S] Skipped - Total Risk 900

The trade was not entered because there's not enough balance in the account to safely cover the total risk of all open trades (see RISKLIMIT).

[AUD/USD:CY:S] Skipped (bar outside ...)

Only in a verbose log. The trade was not entered because trading was disabled on that bar, for instance due to SKIP flags, in the LookBack period, inside a TimeFrame, or during weekends or holidays.

(AUD/USD:CY:S) Short 3@0.87400 Entry stop

A pending trade was opened, with an entry stop at 0.87400. If the price drops to the entry stop within EntryTime, 3 lots will be bought at 0.87400 plus slippage. Note that pending trades are not sent to the broker.

(AUD/USD:CY:S) Short 3@0.87600 Entry limit

A pending trade was opened, with an entry limit at 0.87600. If the price rises to the entry limit within EntryTime, 3 lots will be bought at 0.87600 plus slippage. Note that pending trades are not sent to the broker.

(AUD/USD:CY:S) Missed entry 0.87400 after 2 bars

The pending trade was not executed because the entry price was not met within the allowed time period (EntryTime). This message is not displayed in the window, but in the log file.

(AUD/USD:CY:S) Missed entry 0.87400 at cancellation

The pending trade was not executed because the entry price was not met until the next exit command. This message is not displayed in the window, but in the log file.

(AUD/USD:CY:S) Order expired after 48 hours

The trade was not executed because the order was entered just before the market was closed at a weekend or holiday, and EntryTime was not long enough to cover that period. This message is not displayed in the window, but in the log file.

(AUD/USD:CY:S) Balance limit exceeded

The trade was not executed because you're already too rich. Withdraw capital until your account balance stays below the limit for the free Zorro version.

[AUD/USD:CY:S4400] Short 1@0.87310 Risk 116 ptlsx

A short trade was entered at market. The trade volume was 1 lot, the last price quote (not necessarily the fill price) was 0.87310. The risk of this trade - the maximum amount that can be lost due to a stop loss - is 116 units of the account currency. Other exit conditions are displayed with letters: "p" for a profit target, "t" for trailing, "l" for a profit lock, "s" for a fixed trailing step, and "x" for a fixed exit time. In the log file the entry time is also listed.

{AUD/USD:CY:l4500} Long 3@0.87310 Risk 200

A long phantom trade - mind the winged brackets and the lowercase l - was entered at market. 3 imaginary lots were bought at the price 0.87310.

[AUD/USD:CY:l4500] Long 3@0.87310 Pool trade

A pool trade in virtual hedging mode was entered at market in reaction on the opening or closing of phantom trades. 3 lots were bought at price 0.87310.

[AUD/USD:CY:S4400] Cover 1@0.85934: +105 at 17:01

A short trade was closed by an exitShort call. 1 lot was covered at 17:01 UTC at current price 0.85934 and profit of 105 account currency units. Since displayed profit and exit price are based on the last price quote and estimated trading costs, the real profit or loss of the trade can slightly deviate from the displayed values, and is visible in the broker platform.

[AUD/USD:CY:L4501] Sell % 1@0.85945: +33 at 17:01

A long trade was partially closed by an exitLong call. 1 lot was sold at 17:01 UTC at exit price 0.85945 and profit 33. The rest of the position remains open. The trade ID usually changes by partially closing, and the displayed ID and all further messages of that trade are for the remaining open position.

[AUD/USD:CY:L4401] Reverse 1@0.85945: +33 at 17:01

A long trade was closed by opening a short trade in opposite direction.

[AUD/USD:CY:L4451] Expired 1@0.85945: +33 at 17:01

A long trade was automatically closed because its LifeTime expired.

[AUD/USD:CY:S4400] Exit 1@0.85934: +105 at 17:01

A trade was closed by the trade management function. 1 lot was sold at the price 0.85934. The profit was 105.

[AUD/USD:CY:S2210] Closed 1@0.80201: +20.5 at 17:01

The trade was manually closed in the broker platform. 1 lot was sold at the price 0.80201. The profit was 20.5.

[AUD/USD:CY:L1200] Stop 1@0.78713: -49.30 at 17:25

The trade was stopped out at 17:25 UTC. 1 lot was sold at the price 0.78713. The loss was 49.30.

[AUD/USD:CY:L1200] TP 1@0.7971: +55.70 at 17:25

The trade hit the profit target at 17:25 UTC. 1 lot was sold at the price 0.7971. The profit was 55.70.

[AUD/USD:CY:S4400] Trail 1@0.79414 Stop 0.80012

The stop loss moved, either by script, or by trailing, or by updating the trade. The new stop is 0.80012. In TICKS mode and in life trading, a trade can trail several times within a bar. A trail message is only printed when the stop loss has moved by more than 2 pips, therefore the real stop limit at the end of the bar be different than the last printed value. Smaller PIP values produce more trail messages.

Trade messages - options and futures

The following messages are generated when option or future contracts are entered, closed, or exercised. Note that displayed underlying prices are taken from the options history when available, and thus can sometimes slightly deviate from the unadjusted asset prices taken from the price history. Displayed premiums, unlike underlying prices that are always the ask price, include the ask-bid spread.

[SPY:COT:LP0103] Buy 1 Put 20170118 210.0 100@1.16 Val 10 at 20:00

Buy a SPY put option with expiration at January 18, 2017 and strike price 210 at a $116 premium (100 * 1.16). The Val element of the contract was 10.

[SPY:COT:SC0104] Write 1 Call 20170118 215.0 100@1.09 at 20:00

Sell short a SPY call option with expiration at January 18, 2017 and strike price 215 for a $109 premium (100 * 1.09).

[SPY::LP6633] Exercise 1 Put 212.0 100@209.84: +124$ at 19:00

Exercise a SPY put option with a strike price 212 at an underlying ask price of 209.84, and sell the underlying at market for a total win of $124.

[SPY::LC6634] Sell 1 Call 210.0 100@1.46: -22.00 at 19:00

Sell back a long SPY call option at $1.46, for a total loss of $22.

[SPY::SC6634] Cover 1 Call 210.0 100@1.46: +22.00 at 19:00

Buy back a short SPY call option at $1.46, for a total win of $22.

[SPY::LP5727] Expired OTM 1 Put 207.0 100@0.0: -190$ at 19:00

A long SPY put option expired out of the money. The $190 premium was lost.

[SPY::LC5131] Lapsed 1 Call 207.0 100@150.00: +50$ at 19:00

A long SPY call option position was found by contractCheck() to be externally closed on the account, by expiration, manual closing, being exercised, or similar events. A profit of $50 was assumed, based on the premium and the current underlying price 150.

[SPY::LC5728] Expired ITM 1 Call 207.0 100@209.50: +112$ at 19:00

A long SPY call option expired in the money at current underlying ask price 209.50. The underlying was sold at market. The total profit, minus the paid premium, was $112.

Other messages

Thursday 24.1.2012 --- Profit $880 ---

The daily profit or loss in relation to the previous day (if Verbose >= 2).

[AUD/USD:CY:S4400] +116$ s0.8733 c0.8729 e0.8731

Daily list of all currently open trades (if Verbose >= 3); also displayed on the status page. The trade made 116$ profit, based on a stop price of 0.8733, current price of 0.8729, and entry price of 0.8731.

Current DD: 2100$ (65%) in 11 days, CBI 23%

If Verbose >= 2: Depth and duration of the last or current equity drawdown in percent of the preceding equity peak; also displayed on the status page. CBI is the probability of the current drawdown based on the PnL curve from the last backtest. Note that the CBI is only valid when the backtest used the same trade volume as the live trading session, and no trades from a previous session have been resumed.

Weekend on 02.01.2017 23:00

It's weekend or holiday. Zorro takes a break and suspends trading until Sunday night when the Sydney stock market opens again (see also BarMode, StartWeek and EndWeek).

Liquidation / Margin call in 2016 (Equity 12800$ Margin 13500$)

The current margin requirement exceeds the available capital on the account (when the Capital variable is set). The trade is liquidated at market and the MARGINCALL status flag is set.

!ZDAS Exception - there is no tradeable price
[AUD/USD:CY:L] Can't open 1@0.82345 at 21:05:30

All messages that begin with an exclamation mark ("!") are information, errors, warnings, diagnostics, or other messages from the broker API (see Error Messages). A frequent message is about not being able to open or close a trade because no price quote is currently available or trading is temporarily suspended ("Instrument trading halted", "There is no tradeable price" etc.). This happens especially when assets are traded outside business hours. If a trade can not be closed, Zorro will attempt in regular intervals to close it again.

Trade status, chart and trade log

While trading, a HTML page named after the script and asset (f.i. MySystem_EURUSD.htm) in the Log folder displays a list with the live status of all open trades, a chart, and the current performance statistics. This document is generated when prices are available, and automatically updates once per minute. It can be displayed with any web browser. The HTML style can be changed by editing Source\status.htm and Source\zorro.css. When trading on a VPS, the HTML document can be stored in the server's public web folder (see WebFolder) for observing the current trade status via Internet on your PC or mobile phone. An instruction for setting up a VPS to display your trade status on the Internet can be found under Brokers.

The top of the trade status page contains information about the session start, the last update, the last drawdown depth and CBI, and the last warning message that required a follow-up, such as suspicious asset parameters (054) or potentially orphaned trades (070).

The trade list can look like this (phantom trades in {..} winged brackets and pending trades in (..) parentheses):

Trade ID Lots Entry Time Entry Price Stop Trail Target Risk Profit Pips
24.07. 07:5120.8519.786- - - - - - - - - - - -
- - - -
10.08. 23:511656617068- - - - - - - - - - - -
- - - -
19.08. 19:51102.90103.70- - - - - - - - - - - -
- - - -
19.08. 23:51102.96103.70102.45103.72 - - - -
[USD/CHF:HU:S4997] 1034997
27.08. 15:510.9147 0.91520.9168 0.9126 - - - -
27.08. 19:511.31971.31831.3351 - - - - - - - -
28.08. 07:510.91370.91520.91780.9095 - - - -
28.08. 07:510.91370.91520.9178 - - - - - - - -
{USD/CAD:HU:s7873} 1027873
11.08. 19:51 1.0926 1.0850 1.1095 1.0757 - - - -
{XAG/USD:HP:l0586} 1030586
18.08. 07:51 19.591 19.786 19.244 - - - - - - - -
{XAG/USD:HP:l1791} 1031791
20.08. 07:51 19.449 19.786 19.027 - - - - - - - -
(XAU/USD:LP:L) - - - -
- - - - 12931293 - - - - - - - - - - - - - - - - - - - - - - - -
(XAU/USD:LS:L) - - - -
- - - - 12931293 - - - - - - - - - - - - - - - - - - - - - - - -
(XAG/USD:VO:L) - - - -
- - - - 19.75519.786 - - - - - - - - - - - - - - - - - - - - - - - -

ID is the identifier assigned by the broker API. Entry is the fill price, Price is the current price. Stop, Trail, and Target are the 'real' stop / trail / takeprofit limits set by the script (the 'safety net' Stop Loss in the broker platform has normally a different value and is not used for the stopping the trade). Pool trades have no 'real' stops, therefore nothing is shown in that column.  Risk is the maximum possible loss when negative, and the minimum possible profit of the trade when positive. Profit is the current profit or loss, retrieved from the broker API for real trades, or calculated (including spread, rollover, and commission) for phantom trades. Pips is the volume-neutral profit or loss in pips. Due to slippage or lack of liquidity, trades can always close with a worse result than projected under Risk and Profit. Dependent on the broker plugin and on SET_PATCH parameters, the displayed entry or exit prices are not the open and close prices of the trade, but the market prices at trade entry or exit, which can slightly differ. While Zorro always records ask prices in the log, the entry and exit prices in the spreadsheet follow the usual notation of ask or bid prices dependent on trade type.

The displayed phantom lots do not necessarily sum up to the pool lots. The list can also contain phantom trades for the purpose of equity curve trading that do not contribute to the pool trades.

Below the trade list, a chart with the current price and the equity curve is displayed in the status page. The chart is updated on every bar or every hour, whichever is least frequent. The properties of the chart, such as PlotWidth etc., can be set up in the script. If a different chart in [Test] mode is required, different chart properties can be set up with the conditions if(is(TRADEMODE)) or if(is(TESTMODE)).

When the [Result] button is clicked and no specific action was assigned to that button, a chart and a performance report is immediately created in the Log folder, and a list of all open trades with entry, current, and stop prices and current profit/loss is also printed in the message window. The message window content is stored in the log file, so any event is recorded for later evaluation.

All closed trades are separately recorded in a CSV spreadsheet (see Data Export) for further evaluation or statistics. The spreadsheet can be read back by Zorro for simulating a test with real trades generated by another platform; the Simulate script can be used for that.  !!  Take care not to keep the trade spreadsheet open in Excel while Zorro is trading. Excel prevents any other program from accessing that file.

Manually closing trades

Normally you should refrain from tampering with the strategy, as it is (hopefully) already optimized and any manual intervention will most likely reduce the performance. Still, in some situations you might want to close individual trades, or lock an individual profit by placing a stop loss. You can do this directly in the broker platform. If supported by the broker API, Zorro will detect when a trade is manually closed, and also close it internally.

For closing all open trades in case of an emergency, click [Stop]. You'll then be asked first if you want to close all trades or not, and afterwards if you want to stop trading or not. Click first [Yes] for closing all trades, then [No] for continuing trading. All trades opened by this strategy will be closed; other open trades are not affected. If trades cannot be closed for any reason (the market is not open or there is no connection to the broker), they stay open, and must then be manually closed.

NFA compliance

US based accounts are restricted by NFA Compliance Rule 2-43(b). The rule requires that trades are served in a first-in, first-out order. You can not hedge positions or have more than one position per asset, you can not place stop loss or profit targets, and you can not close trades. Instead of closing a position, a new position must be opened in opposite direction. You're also not allowed to open more than 4 trades per week, dependent on your account deposit. All those restrictions are well-meant and intended to prevent US citizens from losing their money and suing their brokers (of course they do nevertheless). Zorro can step around NFA restrictions - except for low leverage, missing assets, and limited trades - when the NFA flag is set. It must normally be set for US based accounts, except when trading through MTR4. It must not be set for all other accounts. If it is set wrongly, you'll get error messages like "!Error - can't close trade" on US accounts, and you'll get a massive number of open trades on non-US accounts as no trade is ever closed. So make sure that you know whether you live in the US or not. Note that the performance of trade systems can be inferior in NFA compliant mode.

Stopping and resuming a live trading system

While trading, Zorro stores the currently open trades, the status of the sliders, and component specific variables (AlgoVar) in a .trd file in the Data folder. This way trading can be stopped and resumed without losing track of open trades. The name of the file is composed from the script name plus the selected asset plus a "_d" in case of a demo account. If a trade can not be resumed - for instance when it was externally closed - an error message will be printed at restarting the trading session, and Zorro will resume the other trades. Because any new trade overwrites the .trd file, its previous content is stored in a .bak file at session start. Trades are not resumed from a special session that has no lookback period and opens trades already in the first run.

The content of any .trd file can be loaded with loadStatus. For looking into its open trades, you can use a short script like this:

function run()
  if(Bar >= 1) {
    SaveMode = SV_TRADES+SV_HTML;

After a test run of this script, the open trades are printed in the HTML status page.

For updating Zorro to a new version, stop trading (but do not close the open trades), close Zorro, then install the new version into the same folder and start trading again. Please read the What's New page for checking if further actions are required.

For migrating a live trading system to a different PC or VPS, stop trading without closing the open trades, then copy the whole Zorro folder over to the new PC. Start trading on the new PC. Zorro will resume the old trades.

 !!  The .trd file can be simply copied over to the Data folder of a different Zorro installation for continuing the session from there. When stopping a trade session and starting a new session with the same script on a different broker or account, make sure to delete the .trd file so that open trades from the last session are not resumed with the new account or broker. This is especially important with an NFA account, since there is no way to automatically determine if trades were opened or closed on such an account.


While trading, Zorro S can re-train the system for adapting it to the current market situation, and can also run a backtest over the live trading period. For details see Retraining and Retesting.

Multiple instances

The free Zorro version allows to trade with only one Zorro instance. Zorro S can trade with several Zorro instances, brokers, and accounts simultaneously on the same PC. Trading Zorro instances are synchronized. That means that any instance waits until the other instance has finished its current task, such as sending an order or retrieving a price quote. This synchronization allows to trade even with a broker API that does not support many simultaneous connections, but it can also lead to long response times of the user interface, especially when lenghty operations - for instance, downloading large price histories - are performed on the PC on which other Zorros are live trading. For preventing synchronization, set (on your own risk) the NOLOCK flag in the script.

When trading the same script with several instances, make sure to either copy the script to different names, or run it from different Zorro installations. Otherwise the Zorro instances would write into the same status, .log, or .trd files, which can cause undesired behavior such as garbled log files or 'deadlock' situations.

Switching / updating strategies

Zorro updates come out every couple of months, normally with improved versions of the Z strategies. When developing your own strategies, you'll also often get new ideas and improve the script so that is generates a few pips more than the previous version. For the transition of a live trading system from the old version to a new Zorro and/or strategy version, you have several options:

Live trading vs. backtest results

Be aware of all effects that can cause differences between live trading and backtest results. They are listed at the end of the Testing page.

Errors and crash recovery

Zorro is designed to trade without human intervention. However, for keeping a program running for months and years, some special precautions are necessary. Don't switch off an active trading system - not even in the interest of energy saving. Broker APIs often won't resume the session after being interrupted, and will then require a manual restart. Set the PC energy settings accordingly. Disable automatic Windows updates, as some of them reboot the PC. Look here for how to automatically restart a session if a reboot still happens. Screen savers won't harm.

Zorro will display an error message when the broker can not open or close a certain trade. There can be many reasons for this, such as an interruption of the connection to the broker, a server failure, lack of liquidity, or a closed market. If a trade was not opened, it is up to the script to cancel the trade or retry. If a trade can not be closed, Zorro will automatically close it again in regular intervals until the market opens or liquidity is available. If the close command repeatedly fails because the trade is unknown to the broker, Zorro will assume that it was already closed, stop the close attempts, and remove it from its internal trade list.

If you trip over the wrong cable, or if the broker's server goes offline, Zorro gets temporarily disconnected from the trade session. This often happens on Saturdays due to broker server maintenance. It is normally no reason to worry, since the session will continue automatically when the connection is established again. While disconnected, no prices are received, no bars are created, and Zorro cannot react on the market. If the situation persists, the colored square next to the server window will change from green to red, and the time in the server window will switch from server time to PC time. Zorro will then start re-login attempts in regular intervals, until the connection is established again. Since the prices during the interruption have been missed, there can be a sudden jump to the current price at reconnecting, which might affect indicators. Trade strategies should consider disconnections when they are programmed to react on price jumps.

If the connection to the broker server is seriously broken for some reason and does not automatically establish again, click [Stop], then click [No] for not closing open trades and [No] for continuing trading. Zorro will log out, will close and re-open the broker API library, then log in again. This solves problems with a 'hung' broker interface or API.

In case of a PC breakdown or software crash, re-start Zorro and click [Trade] again. Zorro will read its last trade state from the .trd file (see above) and continue trading at the point where it was shut down. The continued trades are displayed in the message window (f.i. [AUD/USD:CY:S4400] continuing...]. If you see an error message instead, a particular trade could not be continued - it might have hit a stop loss and been closed by the broker inbetween. For checking, open the broker's trade platform, f.i. the FXCM Trading Station, and compare the ID numbers of the open trades to the trades continued by Zorro.

If the PC is malfunctioning and you have to continue trading on a different PC, install Zorro there and then copy the *.trd file from the old to the new Zorro installation. Zorro will then resume the open trades on the new PC. Note that when you have no access rights to the Programs directory on your PC - f.i. when you logged in without administrator rights - the Data folder is located in the ProgramData directory.

If Zorro and a connected program, such as MTR4, crashed in the wrong moment, it is possible that further communication is locked and cannot be established again. In that case Zorro appears 'frozen'. The simplest way to resolve that is closing MTR4, closing Zorro, rebooting the PC, then starting MTR4 and Zorro again.

See also:

bar, mode, Testing, Training, TradeMode


► latest version online