The Backtester class executes WealthLab 9 backtests and provides access to the resulting positions, transactions, equity curves, performance metrics, and other simulation information. The Backtester instance for a running C# Strategy is available through the Backtester property of UserStrategyBase. The Backtester contains the underlying trading methods used by UserStrategyBase. Strategy code will normally call the equivalent UserStrategyBase methods directly.
The BacktestSettings class contains the settings and preferences that control how WealthLab 9 conducts a backtest, including commissions, slippage, interest, dividends, futures handling, position matching, signal ordering, and multi-currency simulation.
The BarData class represents a single bar of market data, including open, high, low, close, volume, bid, ask, symbol, timestamp, and source information.
The BarGlyphBase class is the base class for small chart glyphs that appear above or below individual bars. BarGlyphs are commonly used to visually represent events such as dividends, splits, earnings, or chart patterns. BarGlyphBase derives from PlotBase, so it also inherits PlotBase's chart access, configuration, coordinate conversion, and rendering functionality.
The BarHistory class represents historical price and volume data for a market. Code-based Strategies receive a BarHistory instance in Initialize, Execute, and other Strategy methods. A bar contains open, high, low, close, and volume values. BarHistory exposes these through the Open, High, Low, Close, and Volume properties, each of which is a TimeSeries synchronized with the inherited DateTimes collection.
BarHistoryCompressor is a static utility class containing methods that compress a BarHistory from a more granular scale to a less granular scale. For example, you can use ToWeekly to compress a daily BarHistory into weekly bars. Compression preserves the first Open, highest High, lowest Low, last Close, and sums Volume for each resulting bar. Named TimeSeries registered with the source BarHistory are also carried into the compressed BarHistory. If you want to use data calculated from a compressed BarHistory on a chart or Strategy running at the original scale, synchronize the resulting TimeSeries back to the original scale using TimeSeriesSynchronizer.
BarHistorySynchronizer is a static utility class containing the Synchronize method, which synchronizes a BarHistory to the DateTimes of another TimeSeriesBase. The master can be either a TimeSeries or another BarHistory because both derive from TimeSeriesBase. This is useful when data has been compressed or otherwise exists at a different scale than the Strategy or chart. For example, you can compress daily data to weekly bars and then synchronize the weekly BarHistory back to the original daily BarHistory for plotting. When the source and master use different markets, BarHistorySynchronizer also accounts for market time-zone differences for intraday data.
This Deep Learning utility class accepts Model training Inputs and Outputs and returns batches of data according to the specified batch size. The batching operation occurs in the class constructors.
The BrokerAccount class represents an account associated with a connected Broker Provider. It contains account balances, Broker-reported Positions, currency balances, Portfolio Sync Live Positions, Strategy Positions, and other account-specific information.
Contains all of the properties of a visual chart theme, including colors and settings information.
Contains the information for a tooltip to be displayed on the chart.
This UserControl-derived class provides properties and methods that allow it to integrate into the WL8 multiple document interface (MDI) user interface.
Contains the functionality for an object to support configuration. A Configurable object has a Name property, implementing the INamed interface. Its configuration is automatically persisted as a string in WL8's settings file, and is contained in the Configuration parameter. The ConfigurationType property determines whether the configuration string is an object-specific, plain vanilla format, or represents a persisted ParameterList. In the latter case, the object's Parameters property contains its parameters.
The CustomSettingsPanel class allows Historical Data Provider extension authors to define their own configuration user interface for their Provider in the Data Manager.
Contains the information to be displayed in a row in the WL8 Data Panel. If you are building a Data Panel ScoreCard Extension, you'll create instances of DataPanelItem objects and add them to the List returned in the GetItems method.
The DataSet class represents a DataSet in WL8, either created by the user using the New DataSet Wizard, or from a DataSet Provider. DataSet Providers can return instances of classes that derive from DataSet, in addition to instances of plain vanilla DataSets themselves. Therefore, the DataSets class contains several properties and methods that a DataSet Provider author can override when creating a derived class.
Represents a range of date/time values.
Covers a list of DateTime extension methods that assist with typical trading functions related to date and time. Call these methods like any other DateTime method using the method syntax. The first parameter, always this DateTime, specifies the type that the method operates on. See the examples for usage details.
Represents a component line in a chart drawing object.
These are the various enumerated types used throughout the WealthLab .NET Framework.
Contains a list of EventDataPoint instances which were read from persistent storage, and passed to an Event Data Provider's ConvertEventItems method.
The EventDataPoint class represents a single piece of event data, such as a fundamental data item (dividend, split, earlings), analyst rating, or chart pattern. WealthLab supports several Event Data Providers, both included out of the box and available via extensions. Each provider supplies its own set of historical event data. You can access this event data by using the EventDataPoints property or the GetEventDataPoints method of the BarHistory class.
The Handle class is used to represent the handles of a chart drawing object. The user can typically grab a handle and drag it across the chart with the mouse.
A static class that converts BarHistory data into a Heikin-Ashi version.
Represents a point of data on a WL8 chart.
The HistoryScale class represents a data time scale, for example daily, weekly, or 5-minute intraday scales.
The IBulkUpdateHost interface is used to communicate back to WL8 during a Provider Update, and is part of the Historical Data Provider extension API.
This interface allows WL8 to communicate with a chart in a ChildWindow instance. The WealthLab.WPF Chart class implements IChart. If you are implementing a ChildWindow in a Wealth-Lab extension, and it contains a chart, you can override the Chart property to return an instance of this interface.
Create a class derived from WPF UserControl, and implement this interface to provide a Custom Settings Editor Panel for a WL8 component such as a Historical Data Provider or a Broker Provider. In order for your component to locate and use the Custom Editor, you'll also need to create a class derived from ObjectEditorBase, with the same Name as your component, and return an instance of the Editor in that class' GetCustomSettingsEditor method.
The ICustomSettingsHost interface lets a CustomSettingsPanel created by a Historical Data Provider communicate changes back to the WL8 Data Manager.
The IHost interface is used to communicate various aspects of the WL8 environment to Strategies and WL8 Extensions. You can always get the singleton instance of the IHost interface by accessing WLHost.Instance.
The IMetricsReportHost interface is used in the ScoreCard extension API, and helps ScoreCards define a layout for their performance reports. It is passed to the ScoreCard as a parameter of the LayoutMetricsReport method.
IndicatorBase is the base class for indicators in WealthLab. It is derived from TimeSeries, and basically contains a list of floating point double Values keyed off a list of DateTimes. The class contains additional methods and properties that let it work with the indicator management subsystem of WealthLab, and will be most useful for developers creating their own custom indicators.
The IOptimizationHost interface allows Optimization Visualizers to communicate back to their host Optimization (Strategy) window.
The IOptimizerHost instance allows Optimizers (classes derived from the OptimizerBase base class) to communicate their progress back to their host.
The IStrategyHost interface allows Strategy Evolver Visualizers to communicate back to their host Strategy Evolver window.
The IStrategyHost interface allows Performance Visualizers to communicate back to their host Strategy window.
This interface provides properties and methods that let you hook into the WL8 window that is hosting a child window, typically created by an extension.
LineUtils is a static class of function that aid with projecting trendlines.
Represents a drawing object (such as a trend line, Fibonacci retracement, or note) that was placed on the chart. WL8 saves manually drawn chart objects by symbol and HistoryScale (Daily, Weekly, etc).
The MarketDetails class contains information about a market, such as the US Stock Market, or the Cryptocurrency markets. Historical Data Providers in WealthLab can create MarketDetails instances and assign them to symbols, or you can make such assignments yourself using the Markets & Symbols tool.
The MarketHours class represents the open and close times of a market, and is used to represent market trading hours in the MarketDetails class.
MarketManager is a static utility class that manages information about markets and symbols in WealthLab. It contains a list of MarketDetail instances in the Markets property. This contains information about the various markets such as US stocks, Forex, or Cryptocurrencies. It also contains a list of SymbolInfo instances in the Symbols property that contain information about symbols, such as their associated market, margin, and point values. The MarketManager is intended to be used primarily by developers of custom Historical Data Provider adapters. These adapters may need to install new markets (MarketDetail instances) into the MarketManager, or new symbols (SymbolInfo instances).
Contains the set of performance metrics for a particular optimization run, and other details about the run.
A List of OptimizationResult instances that contains some helper methods.
Base class for StrategyOptimizer and WFOOptimizer.
An OptionChain organizes an option chain's strikes and expirations for a single underlier symbol and provides methods to find specific strikes and expirations. public double PreviousStrike(double price, DateTime expiration, bool useWeekly)
The OptionGreek class contains fields to hold a single set of greeks for an option symbol. Not all fields will be used by every historical providers that support options.
OptionsHelper is a static class with methods to assist with converting and parsing option symbols with different formats.
OptionSymExp holds a list strikes for an expiration date.
OptionSynthetic is a static class with methods to obtain the calculated BarHistory of a synthetic option contract as well as OptionGreek calculations using the Black-Scholes model. An estimate of implied volatility is required as an input. The calculations are only truly representative of actual option pricing if the implied volatility is known. OptionSynthetic is useful for devoloping strategies that trade options.
The Parameter class represents a configurable parameter, and it most often used in C# Coded Strategies and custom indicators (derived from IndicatorBase). Each Parameter instance has a Name, a Type (see ParameterTypes in the Enums reference) and a default Value. In C# Coded Strategies, Parameters are used to optimize a Strategy. In these cases, the Parameter instances have their MinValue, MaxValue and StepValue properties defined to specify the optimization range. In custom indicator development, the Parameters are used when an indicator is drag and dropped onto a chart or in a Building Block Strategy. The user can change the value of the Parameter using the user interface in WealthLab or on the web site.
The ParameterList class descends from List
The PeakTrough class represents a peak or trough that was detected in time series data by the PeakTroughCalculator utility class.
The PeakTroughCalculator is a utility class the calculates peaks and troughs in the source time series data. Peaks and troughs are calculated by observing when the data moves by a certain reversal amount, which can be expressed as either percent or point value. The result is a list of PeakTrough objects available via the PeakTroughs property. Due to the nature of this calculation, the detection of peaks and troughs always happens a little after the fact. The resulting PeakTrough instances provide both the point at which the peak trough began (the PeakTroughIndex property) as well as the point at which it was detected (the DetectedAtIndex property).
PenBrushFactory is a static class that can return WPF Pen and Brush objects that are styled to the currently selected WL8 Theme. Additionally, the Pens and Brushes are cached so that multiple requests for the same objects will not incur unnecessary processing.
The base class for any object that can be plotted on the WL8 Chart.
The Position class represents a long (result of a buy order) or short (result of a sell short order) position that was generated by the backtester.
A List containing Position instances, with additional utility members.
Represents the position sizing that was established for a backtest.
Derived from WPF UserControl, serves as a base class for WL8 Visualizers.
Contains the information saved from an optimization run.
The SettingsManager can manage a set of values of varying type that are keyed by strings. It has a built-in mechanism to automatically save its contents to a file on the user's local machine. SettingsManager is thread-safe.
The Strategy class holds the strategy code and other metadata information about the strategy. The Backtester class will have an instance of the Strategy being tested, and it may be useful to access some Strategy properties, for example, to ensure that the intended PositionSize is selected or to find the Benchmark symbol.
%Warning!%
Do not modify a Strategy's Properties in Strategy code. Doing so may cause your computer to overheat and the WealthLab police may knock on your door.
Contains the set of performance metrics for a particular Strategy Evolver run, and other details about the run. This property will contain the message field from any Exception that was thrown during the optimization run, or null if no Exception was thrown.
A List of StrategyEvolverResult instances that contains some helper properties and methods. The list will contain instances for all generations of an Evolver run. It will contain the instances of both the Strategies that made it through the selected Evolver Filter, and ones that were filtered out. Since each Evolver run typically includes 20 candiate Strategies, if there were 10 generations processed then the list would contain 200 StrategyEvolverResult entries.
Executes optimization runs for Optimizers. Optimizer extensions call the ExecuteOptimizationRun method to execute a run, and Optimization Visualizers access the Results from this class to represent optimization performance results.
The SymbolInfo class represents information about a single tradable instrument, keyed by the Symbol property. If Futures Mode is enabled in WealthLab, the Margin, PointValue, and other futures related properties are factored into backtesting. SymbolInfo instances can be created in a Historical Data Provider, and you can define your own in WealthLab's Markets & Symbols tool.
TabPage is a user interface class derived from the WPF UserControl. It contains additional properties and methods that allow it to be installed as a new tab page in the WL8 Preferences tool. A custom WL8 Extension (WL8ExtensionBase) can override its PreferencePages property to return instances that are added to the Preferences tool tab control.
The Tick class represents a tick, or single trade, in a market data stream.
The TimeSeries class manages a series of numeric double values keyed off a list of DateTimes. The two primary properties of TimeSeries are:
TimeSeriesBase is an abstract class that contains the plumbing for working with a time series keyed off a list of DateTimes. It exposes this list through the DateTimes property, which is a List<DateTime>. Two important concrete classes derive from TimeSeriesBase:
TimeSeriesCompressor is a static utility class containing methods that let you compress a TimeSeries instance from one scale down to a more compressed scale. For example, you can call TimeSeriesCompressor.ToWeekly to compress a daily TimeSeries into a weekly one. If you want to be able to plot a compressed TimeSeries onto the chart, you would need to first expand it back to the original scale. You can use the TimeSeriesSynchronizer utility class to accomplish this.
TimeSeriesSynchronizer is a static utility class containing the Synchronize method, allowing you to synchronize a TimeSeries instance with another time series (either a TimeSeries or BarHistory instance). It is useful when you want to plot time series in one scale on a chart based on another scale (for example, weekly to daily).
The Transaction class represents the result of an order (buy, sell, sell short, or cover short) that was placed either during a simulated backtest, or in the WealthLab Order Manager. When developing a C# Coded Strategy, you obtain a Transaction instance as a result of the PlaceTrade method. You can modify certain properties of the Transaction, such as Quantity, to implement customized position sizing in your trading Strategy.
The TrendLine class represents a trend line within a time series data source. It expresses two points via the properties Index1, Value1 and Index2, Value2. The PeakTroughCalculator contains methods that return TrendLine instances based on the generated peaks and troughs.
UserStrategyBase represents a trading Strategy in WealthLab. When you work with C# Code-Based Strategies, you are actually coding a custom class that is derived from UserStrategyBase. The class provides properties and methods that let you control the logic of the trading system, including placing orders and examining the current state of the system. You hook into the trading system logic by overriding several virtual methods in UserStrategyBase. These methods pass as a parameter the instance of the BarHistory object that contains the historical data to backtest. The following are the most important methods:
Generates a Volume Profile, which is a distribution of horizontal lines (represented by instances of the VolumeProfileItem class) distributed along the Y-axis of the chart. Each Volume Profile line has a horizontal length determined by the total volume that ocurred within its min/max range using a specified lookback period.

Represents a single horizontal line in a Volume Profile. The VolumeProfile class maintains a list of VolumeProfileInstances in its Items property.
Executes walk-forward optimizations (WFO). This class compiles the results of the WFO for use by Optimization Visualizers.
Contains the performance results of a single walk-forward optimization run, and also other information about that run.
Represents a color in a platform-independent way.
Represents a font in a platform-independent way.

