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

Strategy Evolver Visualizer API

A Strategy Evolver Visualizer Extension adds a custom results tab to the Strategy Genetic Evolver in WealthLab 9. After an evolution session is stopped, each installed Strategy Evolver Visualizer can present the Evolver results in a different way, such as charts, rankings, metrics, or other custom analysis.

Build Environment

You can create a Strategy Evolver 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 Strategy Evolver Visualizer will be a class in this library that descends from StrategyEvolverVisualizerBase, 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 Strategy Evolver Visualizer, making it available in appropriate locations of the WL9 user interface.

Visual Studio 2026 Build Environment

ResultViewerBase

StrategyEvolverVisualizerBase 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 StrategyEvolverVisualizerBase 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 StrategyEvolverVisualizerBase. 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.

Accessing Evolver Results

Results

public StrategyEvolverResults Results

Returns the StrategyEvolverResults instance associated with the current evolution session. The Results object contains the complete Strategy Evolver output, including the most recent evolution run and any completed Apex runs. Use this property when your Visualizer needs access to the current Evolver results outside the immediate Populate call.

Initialization

public virtual void Initialize()

Override this method to perform any one-time initialization required by your Visualizer. For example, you might initialize controls, data structures, or other resources used to display Evolver results.

Cleanup

public virtual void Cleanup()

Override this method to release resources or perform other cleanup required by the Visualizer.

Populating the Visualizer

public virtual void Populate(
    StrategyEvolverResults results)

WealthLab calls Populate when the Visualizer needs to display the results of a Strategy Evolver session. The supplied StrategyEvolverResults contains the complete result set available to the Visualizer. Override this method to examine those results and update your Visualizer's user interface.

For example:

public override void Populate(
    StrategyEvolverResults results)
{
    // Examine Evolver results.

    // Update Visualizer controls.
}

Accessing Selected Performance Metrics

MetricNames

public List<string> MetricNames

Returns the names of the Performance Metrics used during the Strategy Evolver session. Use this collection when your Visualizer needs to determine which metrics were available for evaluating or ranking evolved Strategies.

Interacting with the Strategy Evolver Window

Host

public IStrategyEvolverHost Host

Returns the IStrategyEvolverHost representing the Strategy Evolver window that contains the Visualizer. Use this interface when your Visualizer needs to interact with the surrounding Evolver environment rather than only displaying static results.