Clone our Wealth-Lab 8 Extension Demo project on GitHub to get a head start in developing your own Extensions!

Performance Visualizer API

A Performance Visualizer Extension adds a custom tab to the Backtest Results section of the Strategy window in WealthLab 9. Performance Visualizers let you present backtest results in specialized ways, such as tables, charts, statistics, trade analysis, or other custom views.

Build Environment

You can create a Performance Visualizer in a .NET development tool such as Visual Studio 2026. Create a class library project that targets .NET10, then reference the WealthLab.WPF library DLL that you'll find in the WL9 installation folder.

Your Performance Visualizer will be a class in this library that descends from VisualizerBase, which is defined in the WealthLab.WPF library, in the WealthLab.WPF namespace. After you implement and build your library, simply copy the resulting assembly DLL into the WL9 installation folder. The next time WL9 starts up, it will discover your Performance Visualizer, making it available in appropriate locations of the WL9 user interface.

Visual Studio 2026 Build Environment

ResultViewerBase

VisualizerBase is derived from the ResultViewerBase base class, defined in WealthLab.WPF. ResultViewerBase is derived from the WPF UserControl. ResultViewerBase contains additional members that can be useful when developing Visualizers. In particular, the ViewerName and GlyphResource properties control the text and image that appear in the Visualizer's tab in WL8.

Creating the Files in Visual Studio

To get started, it's best to create a new UserControl in Visual Studio, which generates the boilerplate XAML and CS classes. Next, change the CS file so that your class derives from VisualizerBase instead of UserControl. You'll need to add WealthLab.WPF to the using clause.

Open the XAML file and add an XMLNS reference to the WealthLab.WPF library. Change the base class in the XAML from UserControl to VisualizerBase. Here an example of what part of such a XAML file will look like:

Creating a Visualizer in Visual Studio

Accessing the Host (WL9) Environment

The IHost interface provides access to the current WealthLab environment. Extensions can use it to retrieve application-level information and services, such as the location of the user's WealthLab data folder or the DataSets defined by the user.

You can access the current IHost instance from anywhere in your extension through the WLHost singleton and its Instance property. For example, the following code retrieves the path to the user's WealthLab data folder:

string folder = WLHost.Instance.DataFolder;

Use WLHost.Instance whenever your extension needs access to functionality exposed by the IHost interface.

Supporting Specific Strategy Types

public virtual bool AllowForStrategyType(
    StrategyTypes st)

Override this method if your Visualizer should be available only for certain Strategy types. WealthLab calls AllowForStrategyType when determining which Performance Visualizers should appear in the Backtest Results section. Return true for supported Strategy types and false for unsupported ones. If the current Strategy type is not supported, WealthLab does not add the Visualizer's tab to the Strategy window. The available values are defined by the StrategyTypes enum:

  • Code
  • BuildingBlock
  • Rotation
  • Compiled
  • MetaStrategy
  • TradeHistory

Initialization

public virtual void Initialize()

Override this method to perform any one-time initialization required by the Visualizer. For example, you might initialize controls, prepare data structures, or configure other resources used when displaying backtest results.

Visualizing Backtest Results

public virtual void Populate(
    Backtester backtester,
    Backtester backtesterBenchmark)

WealthLab calls Populate after a backtest completes and the Visualizer needs to display its results. Two Backtester instances are supplied. The backtester parameter contains the results of the Strategy backtest. The backtesterBenchmark parameter contains the results of the benchmark backtest, which represents a Buy & Hold backtest of the configured benchmark symbol. Use these Backtester instances to obtain the data required by your visualization. The Backtester class exposes information such as:

  • Positions and trades
  • Equity and drawdown information
  • Backtest settings
  • Performance Metrics
  • Other backtest results and statistics

Of particular importance is the Metrics property, which contains the Performance Metrics generated for the backtest. For example:

public override void Populate(
    Backtester backtester,
    Backtester backtesterBenchmark)
{
    // Obtain Strategy results from backtester.

    // Obtain benchmark results from
    // backtesterBenchmark.

    // Update the Visualizer UI.
}

Accessing the Current Backtest

public Backtester Backtester

Returns the Backtester containing the Strategy's current backtest results. Use this property when you need to access the Strategy backtest outside the immediate Populate call.

public Backtester BacktesterBenchmark

Returns the Backtester containing the benchmark Buy & Hold results. Use this property when your Visualizer needs to compare Strategy performance with the benchmark.

Interacting with the Strategy Window

public IStrategyHost ParentStrategyWindow

Returns the IStrategyHost for the Strategy window containing the Performance Visualizer. Use this interface when your Visualizer needs to interact with the surrounding Strategy window. For example, a Visualizer can use the StrategyHost to request that the Strategy window chart a particular symbol associated with a selected trade or result. This allows a Performance Visualizer to do more than display static information and integrate directly with the active Strategy window.