Error messages

Below you'll find a list of possible errors that can occur during compilation or at runtime, together with suggestions for finding the reason of the error. Messages related to opening and closing positions are listed under Trading; known issues with brokers are commented on the related page (FXCM, IB, Oanda, MT4, ...) in this manual.

Almost all errors listed here are formal, which means they can be fixed by correct coding. Errors during compiling are especially easy to find, since they are caused by wrong syntax in the script, such as a typing mistake, a forgotten bracket or semicolon, or a referrence to a non existing variable or object. The script file and line in question is given in the error message. The most frequent syntax errors:

Error in line ...

Wrong or missing token in the script code. Sometimes the line in question is ok, but some command in the preceding code was incomplete. Examples are an #ifdef without an #endif, or a missing semicolon in the previous line, or an orphaned { } bracket in the previous function. Another not-obvious error is declaring a variable or function with the same name as a predefined system variable, such as Stop or Lots.

Wrong type ...

Wrong variable type. You've used a numeric operation with wrong parameter types, for instance an AND or OR operation with a float or var type. Or you've called a function with a var although it needs a series, or vice versa. Example: "Wrong type POINTER::DOUBLE" means that the code expects a double (or var) and you gave it a pointer (or series) instead.

Pointer expected ...

Function call with a wrong parameter type, for instance with a var when a series or an array is needed.

Undeclared identifier ...

The given name or type is unknown. A common reason is an #include statement without including <default.c> before. default.c contains all language definitions, but is only automatically included when nothing else is included.

Can not translate ...

Numerical operation with wrong parameter types, for instance an AND or OR operation with a float or var type. In that case, typecast the expression to the correct type.
 

Runtime errors

Those errors occur when the script is running, either in the message window, or in a separate message box. Some messages are not harmful and can be ignored, others require a decision about whether to continue or to stop the script. If _POS() statements are placed in the script, their argument is displayed at the end of most error messages for identifying the position in the code.

Error 010: Invalid trade parameter

A trade was entered with a Stop, TakeProfit, Trail, or Margin value that's unusually high, or low, or at the wrong side of the current price; or with an option or futures contract with no correct or missing Multiplier, strike, or expiration date. The trade can not be executed. If it happens during live trading, an alert box will pop up dependent on Verbose settings.

Error 011: xxx called with invalid parameters

An indicator or other function was called with wrong parameters.

Error 012: Bad time value

A date/time function was called with bad data, or the bar with the given time could not be found.

Error 013: Invalid parameter (...)

An invalid value or wrong format caused an exception in an expression.

Error 014: Function xxx timeperiod nnn > LookBack

An indicator required a higher LookBack period. For suppressing this error message when the lookback period is irrelevant, set LookBack to 0 before calling the indicator.

Error 015: Invalid xxx data

Object xxx contains invalid data, f.i. a wrong parameter for a pointer or string, or data from a non initialized array, or from an invalid mathematical operation such as a division by zero.

Error 016: Inconsistent start/end dates

StartDate, EndDate, NumYears, LookBack etc. have been set up in a way that the selected asset has no prices between start and end date.

Error 017: Bad return value

A script function returned an invalid value.

Error 018: Bad name

A name was too long, too short, or contained spaces or other invalid characters.

Warning 020: Midnight bars

You used daily bars with no BarOffset. Consequently, bars end at 00:00 midnight, which means their OHLC candles contain mostly the prices from the previous day. This is normally unwanted, so better set BarOffset to the end of the day or to the market close time.

Error 030: Check lookback, settings, asset order

The lookback period, simulation period, or price history was not set up correctly. Parameters that affect the bars generation (StartDate, BarPeriod, LookBack, TICKS, LEAN, etc.) were either inconsistent (f.i. a too short LookBack period for a subsequent indicator call), or changed after the bars were generated. Make sure to set up all parameters before calling asset. Use the PRELOAD flag for extremely long lookback periods.

Error 031: Price history missing

The simulation could not be finished because historical data was missing.

Error 032: Constant parameter changed

A variable that should remain constant - such as NumWFOCyles - was changed after the initial run. Make sure not to change those parameters at runtime.

Error 033: Asset missing in INITRUN

An asset was not loaded in the first run of the strategy, most likely due to a missing, skipped, or failed asset call. Make sure that all assets are properly initialized and price data is available.

Warning 034: No asset data for ...

The asset is missing in the asset list (note that asset names are case sensitive). The simulation will still run when historical price data is found, but asset parameters such as spread, margin, lot size, trade costs, trade profit etc. are made up and do not reflect the true values. The asset can not be traded.

Error 035: Price gap / invalid ticks

Prices are missing or have invalid time stamps. The server did not provide all historical data or no price quote arrived during the last bar. Normally not critical; the price functions return the values of the previous bar in such a case.

Error 036: Index exceeded

A function wrote past the maximum index of an array or a series.

Error 037: Invalid value

A plot function was called with an invalid value, caused by a division by zero, the square root of a negative number, or similar errors in the script.

Error 038: Too many elements

The plotGraph with the given name had more elements that bars exist on the chart. If you need this many, use another name for the rest of the elements.

Error 039: Expression too complex

The rule generated by a machine learning function is too complex for conversion to a C expression. In case of candlestick patterns, use the FAST pattern detection mode or reduce the number of patterns.

Error 040: Inconsistent optimize calls

Number or order of optimize calls are different between run cycles, due to a bug in the script. Make sure that optimize is always called in the same order, the number of optimize calls is the same as the number of optimized parameters, and the PARAMETERS flag is not changed between optimize calls.

Error 041: Inconsistent series / too many series

Bad series declaration in the script. Check your series() statements and function calls that internally declare series, such as Volatility, ATR, etc. - it's mentioned in the manual for any function. The number and order of series declarations or series declaring functions must not change from run to run. Don't skip them with if statements and don't declare them in tick-based intrabar functions (TMF, tick). The error message tells you in which bars the number of series differ, so the bug should be easy to fix. If you declared too many series and really intended that, increase TradesPerBar until the error message disappears.

Error 042: Parameter not found

Error 043: Wrong parameter

A parameter of a certain portfolio component could not be loaded from the *.par file. Check if the optimize calls or the loop parameters were changed after training.

Error 044: No rule for ...

An AI function could not find a valid code generated for the current asset/algo combination.

Error 045: Negative price offset

A price that lies in the future was requested by a price or day function. For the simulation you can suppress this message by setting the PEEK flag. PEEK is not available for real trading unfortunately - even though Zorro is good, it's not this good.

Error 046: LookBack exceeded

A price or TA function required a higher lookback period than reserved through LookBack. Normally Lookback is automatically adapted in the initial run, but it must be manually set to the longest possible period when time periods change at runtime, for instance by optimize calls or by loading optimized parameters. Setting LookBack to 0 suppresses all lookback adaptions and warnings at the user's risk.

Error 047: Not enough bars

Not enough price bars are available to cover the LookBack and test period. This can happen when a trade session is started and the market is closed or the price server does not provide sufficient history (especially with IB or MT4). In that case download recent price data from other sources and set the PRELOAD flag. Other reasons of this error can be a wrong test period setup in the script (see asset), a gap in a historic price data file, a too high MinutesPerDay value for one of the used assets, a wrong Weekend setting for an asset that is traded at weekends - such as crypto currencies - or a user-defined bar type that is much larger than the given BarPeriod. In the latter case decrease BarPeriod or increase MinutesPerDay for allocating more bars.

Error 048: Endless loop or recursion

Trades are possibly generated in an endless loop or recursion, f.i. by a TMF that enters trades who themselves enter new trades through their TMF. Or a for(trades) loop is nested inside another for(trades) loop.

Error 049: Too many trades

The script entered more than one trade per bar and asset, which is normally a sign of a script bug - therefore the error message. If you really need a huge number of trades, for instance for unlimited grid trading or for training several advise functions at the same time, set the TradesPerBar variable to the required number of trades per bar and asset.

Error 050: Can't access ...

Zorro could not open a file. The file could be already opened by a different program, or externally deleted, or set to read/only.

Error 051: Can't continue trades

Trading was stopped without closing the open trades, then resumed with a different Zorro version. Zorro can only continue trades that the same version has opened. Use the broker platform for closing the trades manually.

Error 052: Broker interface busy

Zorro attempted to log in to the broker, but another Zorro instance on the same PC is already connected. For multiple trading sessions and accounts, Zorro S is required.

Error 053: ... prices unavailable / invalid asset

The script attempted to subscribe or download prices of an asset that is either not offered by the broker, or offered under a different name, or for which no price quotes are available due to market closure or server maintenance at session start. Make sure to log in at a time when prices are available for all assets that you want to trade. Also make sure that the asset has a valid name and symbol, and is subscribed and visible under that symbol in the asset list of the broker platform. If the broker offers the asset under a different name, set up its correct symbol in the asset list. Not all assets are available to all users - for instance, US traders can sometimes not trade commodity or index CFDs that are offered to by the same broker to European traders.

Error 054: ... invalid asset data

One or several asset parameters, either in the asset list or returned from the broker API, had no or invalid content, f.i. a price, PIP, or lot value of zero. If this happens in [Trade] mode at the start of the script, a possible reason can be a too long response time of MT4/MT5 servers for uploading previously unused assets (see remarks about MT4 issues). In this case, simply start the script again. In [Train] or [Test] mode the asset list must be edited and the wrong value fixed.

Warning / Error 055: ... price history missing

Historical price data required for an asset was not found, or has no sufficient size or resolution for properly running the simulation. Make sure that all data for an asset is of the same time; a mix of .t1, .t2, and .t6 data, or a part of the data split into years and another part not, won't work. If data is missing, the simulation won't execute. You can download price data from online sources with the Download script. Often used data is also available on the Zorro Download page. If price data for a certain year is not available, create a .t6 file of 0 bytes size with the name of the asset and year (f.i. SPX500_2007.t6). Zorro will then skip that period in the simulation and not display the error message.

Error 056: ... can't download price history

Historical price data could not be downloaded from the broker's price server. The server can be offline or does not offer price data for the given asset and time period.

Error 057: history format

Check if the historical data is consistent (no mix of formats) and has sufficiently high resolution. T1 data is recommended for testing with bar periods less than one minute. The test will otherwise run with interpolated price data, but won't be very accurate.

Error 058: ... can't parse

A CSV file can not be parsed due to an invalid file format. If the file was recently downloaded (f.i. history.csv), open it with a text editor - it might contain no CSV data, but an error message from the data provider. Otherwise compare the CSV file content with your conversion format string. If in doubt, set Verbose to 7 for checking the source and parse result of the first 2 lines - this normally reveals the format error.

Error 060: Memory fragmented / limit exceeded

Zorro could not allocate a large memory resource - such as the ticks buffer for a simulation in TICKS mode, or the price buffer for a large simulation period. The script cannot be executed. In case of fragmented memory, restart Zorro. This will fix the problem. If you get the error frequently, your script allocates too much memory.
The error message appears when the memory assigned to a single Zorro process (3 GB maximum, regardless of the PC memory) was either exceeded, or became too fragmented by previous simulation or training runs so that a new buffer of the required size could not be allocated. The memory requirement of a script can be reduced by splitting the portfolio into separate strategies, by reducing the simulation period (f.i. by setting a EndDate or MaxBars limit), by not setting TICKS, or by using the LEAN flag and M1 rather than T1 price data.

Error 061: Compiled with different version

The executable script was compiled with a previous Zorro version that is incompatible to the current Zorro. The script must be recompiled with the current Zorro version.

Error 062: Can't open ...

A file was not found or could not be opened. Check the file name and make sure that the file exists, that the Zorro process has access rights to it, and that it is not opened with exclusive access in another application (f.i. a .csv file in Excel). The Windows error number is displayed in parentheses, f.i. (wb:13). Typical error numbers are listed below. If the missing file is a .par, .c, .fac, or .ml file, you probably have forgotten to train your strategy.
   

2

No such file or directory

9

Bad file number

11, 12

Not enough memory or resources

13

No access rights, or file opened in another application

16

Device or resource busy

23, 24

Too many files open in system

28

No space left on device

30

Read-only file system

38

Filename too long

Error 063: ... not available

The function is not available in this script because it requires a different setup, an external plugin, or Zorro S.

Error 064: ... wrong format

An asset list, account list, or other .csv file has a wrong spreadsheet format. Check the file for wrong entries, missing parameters, wrong delimiters, or the like. Every line in a .csv file must have the same number of delimiters - commas or semicolons - and end with a 'new line' character.

Error 070: Trade unconfirmed by ...

Zorro opened a trade, but received no confirmation from the broker. This can happen in f.i. due to a temporary server glitch or Internet connection breakdown just after sending the trade to the broker. Check in the broker platform if the trade was be opened or not. If it was, it is orphaned; handle it manually or close it. Zorro can not handle this trade because it did not receive the trade ID from the broker.

Error 071: Trade not found ...

Zorro closed the trade with the given ID, but the trade was not found in the broker's trade lists. Possibly it was never opened, or was already closed manually or by a margin call or similar event.

Error 072: Timeout ...

A broker command to open or close a trade could not be executed due to a problem of the broker API, such as a server crash or loss of connection. Zorro will attempt to close the trade in regular intervals until the broker's server is online again.

Warning 073: Can't close nn lots

An exitShort/exitLong command for partial closing could not be fully executed because not enough trades were open to close the given number of lots.

Error 074: Balance limit exceeded

You need Zorro S when your annual profit exceeds $30,000 or your account balance exceeds $7,000.

Error 075: Can't open / can't close

A trade could not be opened or closed during a live trading session. The reason can be found in a preceding broker message (see below), or - in case of an MT4/MT5 connection - in the 'Experts' log. Valid reasons for not opening or closing a trade are: not enough funds, no permission to trade that asset, a too distant order limit, a wrong asset symbol, market closure or lack of liquidity, FIFO violation, NFA rules violation, a wrong stop distance, or unsupported partial closing (as with some MT4 / MT5 brokers). All this, except for the funds and permission, can be fixed in your script, in the asset list, or in case of a Z system in the Z.ini configuration.

 

Error 111: Crash in ...

A function in the script crashed due to a wrong operation, such as a division by zero, a wrong array index, or exceeding the stack size by declaring huge local arrays. The current run is aborted (which can cause subsequent errors, f.i. inconsistent series calls). Normally the name of the faulty function is displayed. See Troubleshooting about how to fix bugs in your script functions or deal with other sorts of crashes.

 

Broker messages

 

!...

All messages beginning with an explamation mark are sent from the broker API in a live trading session, so their content depends on the broker. On high Verbose settings, some diagnostics can be printed on events such as session start. Other messages can indicate that the connection was temporarily interrupted or a buy/sell order was rejected (see enter/exit). This happens when assets are traded outside their market hours, such as an UK stock index when the London stock exchange is closed. A "Can't close trade" message can also indicate that the NFA flag was not set on a NFA compliant account, or vice versa, the NFA flag was set on an account that is not NFA compliant. Read the comments on the broker related page (FXCM, IB, Oanda, MT4, ...) in this manual. When trading with the MT4 bridge, details and reason of error message is printed under the [Experts] and [Journal] tabs of the MT4 platform.

 

 

 

► latest version online