Wealth-Lab Wiki

API ChartStyles Community Components Community Indicators IndexDefinitions Knowledge Base Misc Optimizers Pending Deletion PosSizers Providers Standard Indicators TASC Traders Tips TASCIndicators Tutorial Videos Visualizers


Quick Search
Advanced Search »

Errors | Strategy


Strategy Monitor doesn't work


Suddenly, Strategy Monitor stopped generating orders. The log contains similar lines:

9/25/2013 10:47:18 AM: Update Completed: AAPL, LastDate=9/25/2013 11:46:00 AM, O=483.16 H=483.2399 L=482.61 C=482.8199 V=16646 Count=916, AAPL,OHLCV
9/25/2013 10:47:18 AM: Skip Update (not current): AAPL (916)

9/25/2013 10:34:19 AM: Update Completed: AAPL, LastDate=9/25/2013 11:33:00 AM, O=483.08 H=483.25 L=483.041 C=483.19 V=16451 Count=902, AAPL,OHLCV
9/25/2013 10:34:19 AM: Deleted 1: AAPL


These lines indicate that the SM considered the data not current, thus skipping the update (1st log) or deleting N bars from the updated data (2nd log) because it thought that they were timestamped beyond the "Next Run".


Your PC clock is set incorrectly, confusing the SM. Synchronize your PC clock.


You run strategies from the Strategy window, but cannot add them to the Strategy Monitor. When you try to open the Strategy Monitor, you get an error message that starts like this:

System.InvalidOperationException: There is an error in XML document (0, 0). System.Xml.XmlException: Root element is missing.

...or like this:

System.ArgumentException: Tick scale is not supported
at WealthLab.MarketHours.GetNextTimeStamp(DateTime timeStamp, BarDataScale scale)
at WealthLabPro.StrategyCenterItem.CalculateNextRun(Boolean forceToFuture)
at WealthLabPro.StrategyCenterForm.c()


The Strategy Monitor configuration file (StrategyMonitorConfiguration.xml) got broken. The numbers reported in the exception message can vary: if they're (0, 0) then the config file is empty i.e. its size is 0 bytes, if there's a larger number, then the file is broken at its end. In this case, you may contact support by entering a new ticket.


To have Strategy Monitor up and running again, please enable hidden file/folder visibility (Control Panel > Folder Options), locate the StrategyMonitorConfiguration.xml file and delete it:

  • \Users\Windows User Name\AppData\Roaming\Fidelity Investments\WealthLabPro\\Data


Strategy Monitor doesn't work, producing an unhandled exception window when trying to open its window or add a strategy on 1-10 minute bar intervals:

System.NullReferenceException: Object reference not set to an instance of an object.
   at WealthLabPro.StrategyCenterForm.a(StrategyCenterItem A_0, Boolean A_1)


You have not selected a Streaming provider in Wealth-Lab's Preferences dialog. Open Preferences (F12) and choose suitable Streaming provider.


When Strategy Monitor is opened, you get an error message saying that Current TimeZone not found that looks like below:

Current TimeZone not found.

System.ArgumentException: CurrentTimeZone not found.
at Fidelity.Components.TimeZoneInformation.get_CurrentTimeZone()


1. In Windows, Internet time synchronization is enabled. Disable it.

2. (Applies to: Windows Ultimate or Enterprise). You're using a localized (e.g. German) Windows Ultimate. This version lets you change the system language and you changed Display Language or all language options to English.

As a workaround for Windows 7/8, change your Display Language back to native (e.g. German). On Windows 10, restarting PC after applying the change seems to do the trick.

3. If you've changed the time zone in Windows recently, try reverting the change.

Strategy editor does not function


The application mostly works as expected but you're unable to open any Strategy editor window (either a saved or a new strategy). On the other hand, rule-based strategies are working fine. This error can arise after upgrading.

If you expand the exception dialog to view error details, this information is present:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()


Due to the editor component upgrade in WL5.3, there was a configuration file format change that sometimes results in an unhandled exception. You can be affected by this bug if you either have deleted the application's configuration file, WealthLabConfig.txt (see "Data > Where Data is stored" in the Wealth-Lab User Guide), or have a user selected color theme. Make sure hidden file/folder visibility is enabled in Windows Control Panel > Folder Options!


There are 4 workarounds:
  • Overwrite the EditorSettings.xml file in the same directory with its auto-backup copy "EditorSettings.147.xml" (if present)
  • If auto-backup copy doesn't exist, rename EditorSettings.xml to EditorSettings.bak
  • Alternatively, open up WealthLabConfig.txt from the same directory in Notepad, remove this line and save the file:
  • If nothing helps, delete EditorSettings.xml, reconfigure the Editor's Options, and closed WLP/D


Lines of WealthScript code in the Editor are being moved every Nth run, won't stay in place.


You're running TeamViewer or related remote control system.


Close TeamViewer. On a related note, Skype's Click To Call function is known to interfere with clipboard at least with MS Office programs, so be sure to check this too.

WL6 crashes on compiled strategy


Valid Strategy crashes Wealth-Lab for no good reason.


Sometimes, crash can be produced by a drag and drop indicator saved with the Strategy (especially when the indicator has had a breaking change). Click "Clear Drag and Drop Indicators" and rerun, or copy and paste the Strategy code into a new Strategy window.


You're using Visual Studio or SharpDevelop to create a compiled strategy (which runs successfully in Wealth-Lab's built-in editor), the DLL files have been placed to WL6 main folder, but when WL6 is launched, the loading of the newly created DLL is crashing WL6.


If you had the IDE to add all the stubs automatically (code completion) into the StrategyHelper class, by default they throw an exception. Be sure to replace the stubs with your code.


Wealth-Lab crashes after putting a compiled Strategy library in main program folder with a similar error:

System.ArgumentException was unhandled
  Message=Empty path name is not legal. (...)
       at System.IO.FileStream.Init...
       at System.IO.FileStream..ctor...


If using 32-/64-bit installations of Wealth-Lab, verify that you didn't mix references to the Wealth-Lab assemblies from a different "bitness".

Strategy compiles but produces a specific runtime error


When executing a Strategy with successfully compiled code (only), you're getting error message(s) in the debug log that read like this:

Unable to cast object of type 'WealthLab.DataSeries' to type 'WealthLab.Indicators.MACD'.

The message may vary depending on the Indicator used in your code.

Solution 1:

This error can happen when a Strategy is being executed in non-native time scale. For example, the DataSet is Daily and you select "60 Minute" from the Data Loading control before executing the code. However, you don't have the intraday data already available with on demand updates turned off. Therefore this message indicates that you don't have available data for one of the symbols in the DataSet in requested time frame (e.g. intraday minute-based). This obviously applies to "lower" time scales because Wealth-Lab would easily upscale from Daily to Weekly, for instance.

  1. Create a DataSet in required time scale (e.g. 30-minute)
  2. Download the full set of data
  3. Execute the Strategy

Remember to create and update a DataSet in desired time frame prior to operating a Strategy.

Solution 2:

Sometimes this error can be caused by dragged and dropped indicators. Their settings are saved within the Strategy's XML file so to get rid of the exception you need to reset them. For that, focus on the Strategy's chart window and click the "Clear Drag and Drop Indicators" button.


You've created some valid code that compiles and should execute, but when you try running it, it produce the following error (only):

 Runtime error: Cannot convert 1936003584 Bars to Daily Scale


Runtime errors about bar conversion like this can be a sign of data error. Refer to How to delete (e.g. broken) data files? in FAQ on Data and Data Providers.


You've created some valid code that compiles and should execute, but when you try running it, it produce the following error (only):

Runtime error: Value of '7' is not valid for 'Value'. 'Value' should be between 'minumim' and 'maximum'.
at WealthLabPro.Chartform.q()
at WealthLabPro.Chartform.o()
at WealthLabPro.Chartform.b(Int32 A_0, Object A_1)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)


Close and re-open the strategy window or restart WL6.


Your otherwsie valid code that may run, produces the following error with certain Data Loading Range settings:

Cannot Synchronize, no overlapping Dates.


  1. The symbol you're trying to synchronize to the current symbol doesn't have any dates that correspond to the current symbol. For example, the data for stock "A" exists from 1950 to 1990, but for the stock "B" (the one you're charting) starts after 1990 - there's no overlap for synch.
  2. You have a Benchmark Buy & Hold symbol defined in Wealth-Lab's Preferences but symbols you're trying to backtest have no bars after the Benhcmark symbol's inception.
  3. If code uses SetContext (symbol) and the symbol is in lower case (e.g. aapl, try entering it in upper case (AAPL).


You're getting the following error when using PlotSeries:

Runtime error: Plotted DataSeries has fewer bars than the Symbol being charted.


For example, the error could arise when using this code:

DataSeries TheSeries = ATR.Series(Bars,5);

The mistake here is to use RestoreContext (which is N/A because you haven't changed the context) - actually, you needed to use RestoreScale instead.


  1. You have a long-running strategy.
  2. Or you have streaming charts and/or strategy windows that get some external symbol(s) data.

You get the following error message(s):

Runtime error: An executing Strategy blocked a streaming data update. The Strategy run was terminated.

The process cannot access the file: \Path\external symbol.WL


It's by design. The message is telling that Wealth-Lab is trying to update the Bars object while it was locked by one of your Streaming stategy windows. That could happen when a bar closes while one of your long-running Strategies is still executing or a streaming strategy is being initialized when Wealth-Lab is about to update the bar. To avoid a streaming crash, Wealth-Lab aborts the strategy to guarantee that it won't break streaming updates. Side-effect: multiple Strategy windows are essentially prevented from using the same external symbol.


You get the following error message:

Runtime error Bar number must be 5590 or greater at WealthLab Strategies MyStrategy Execute()...


This is like a getting an index out of bounds error. Your code violates the boundary by accessing a bar which does not exist. Make sure you're not accessing a value at a bar which is less than 0 or greater than Bars.Count.


You're getting the following error in Debug window when executing a Strategy:

"DataSeries do not have equal number of values for mathematical operation"


  • You can get it, for example, on a DataSet that has symbols no longer updated (stock delisted, merged, etc.).
  • Another possible scenario - suppose you have a 10-minute DataSet, you're switching its scale to 5-minute, but the data for some of the symbols are not available in 5 minute interval (and on demand update is turned off). Solution is simple: update the DataSet, making sure you have the data for all symbols in required time frame.
  • Also when you perform a math operation on two series, you need to make sure that your external series are synchronized before charting them or performing math operations.
  • You can get it when synchronizing to a recent IPO when you shift some DataSeries forward and the IPO symbol does not have enough data.


You're getting one of the following errors in Debug window when executing a Strategy on a compressed scale (e.g. 1-minute to 30-minute):

"Runtime error: Attempting to Deserialize an empty stream."

"Runtime error: Value cannot be null. at WealthLabPro.ChartForm... at WealthLabPro.MainModule.LoadExternalSymbol... at WealtLab.DataProviders..."


1. It can happen when creating a Strategy that makes a request to an external symbol and uses multiple timeframes. When Wealth-Lab couldn't find the symbol in the requested bar scale, the runtime error is triggered. Try using the overloaded call that allows to specify the DataSet that will be searched when your external symbol is requested.

//Bars s1 = GetExternalSymbol("csfb", true);
Bars s1 = GetExternalSymbol("your DataSet with CSFB name here", "csfb", true);

2. Another possibility is that you have checked "Benchmark Buy & Hold" in Wealth-Lab's Preferences (F12) > Backtest Settings. Disable that option.

Compiler error messages


You're getting an error message like these when compiling a Strategy:

CS0246 @ (5.1): The type or namespace name 'Community' could not be found (are you missing a using directive or an assembly reference?)
CS1513 @ (93.3):} expected. etc.


These are syntax and similar errors in your code. Use the MSDN (or other search engine) to find the error description and solution in MSDN e.g.

Index was out of range

If you're getting this "Index out of range" error message in Debug window when running a Strategy, this means you're actually violating the bounds in some way. For example:

  • accessing the data at an invalid bar number. Example: your trading loop starts at bar 3, and you're trying to compare the close of the bar with the close of the bar-4.
  • accessing the data that does not exist. Example: your DataSet contains the price data for a symbol that stopped trading, and you select the data range that goes beyond that date, and do not account for this fact in your Strategy.
  • accessing a Position that does not yet exist

If this message only happens with some symbols and not others, it is possible that a drawing object for that symbol (DRW file) and bar scale has got corrupt. To fix, click the Eraser button atop the Drawing Objects toolbar ("Clear Drawing Objects").

If using ASCII data, double check that it doesn't have duplicate entries (i.e. two rows for one date) and/or incorrect order of months.

Object reference not set to an instance of an object

Note: this is a pretty multifaceted error message - it can happen outside of a Strategy. But should you experience the run-time error in your Strategy telling you that "Object reference not set to an instance of an object", you need to know that there's a variable that has not been initialized, in other words it's null. Either you haven't assigned a value to some variable, or a method/function that you called has set the variable to null.

If "Benchmark Buy & Hold" symbol is defined and enabled in the Wealth-Lab's Preferences dialog, Backtest Settings, or your system uses an external symbol's data, you should make sure that the symbol name (or DataSet name) is valid and could be found in your DataSets. Entering a symbol that does not exist or has no data is a popular reason for getting this error message in backtests.

If it occurs on some particular symbol, it is also possible that a drawing object for that symbol and bar scale has got corrupt. To fix, click the Eraser button atop the Drawing Objects toolbar ("Clear Drawing Objects"). If this doesn't work then try reloading data (right click on the chart and select "Reload Chart History").

If the message reads "Object reference not set to an instance of an object. Unable to get Data on Demand for symbol: XXXX", uncheck "Update Data on Demand" in the Data Manager.

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.

Used under license from FMR Corp. Copyright 2008 FMR Corp. All rights reserved.

ScrewTurn Wiki. Some of the icons created by FamFamFam.