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

Event Provider API

An Event Provider Extension supplies date-based event data to WealthLab 9. Events represent information associated with a specific date and symbol. Examples include:

  • Fundamental events such as dividends, splits, and earnings
  • Analyst ratings
  • Chart or candlestick patterns
  • News events

Build Environment

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

Your Event Provider will be a class in this library that descends from EventProviderBase, which is defined in the WealthLab.Core library, in the WealthLab.Data 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 Event Provider, making it available in appropriate locations of the WL9 user interface.

Visual Studio 2026 Build Environment

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.

Configuring an Event Provider

EventProviderBase ultimately derives from Configurable, which provides the standard WealthLab configuration framework. By default, EventProviderBase uses a ConfigurableType of ParameterList, so the Event Provider is configured using Parameter instances contained in a ParameterList. Define these Parameters by overriding GenerateParameters.

Parameters can represent values such as user names, passwords, API keys, or other settings required by the Provider. WealthLab presents these Parameters in a configuration dialog and allows the user to enter values of the appropriate types.

You can alternatively use a ConfigurableType of VanillaString. In that case, your Provider works directly with the Configuration string instead of Parameter instances. If you use VanillaString and require a custom configuration interface, see Providing User Interfaces for WealthLab Components.

Descriptive Properties

The Configurable base class provides descriptive properties that determine how your Event Provider appears in WealthLab. The most important properties to override are:

  • Name
  • GlyphResource
  • Description
  • URL

Initialization

public virtual void Initialize()

Override this method to perform any initialization required before your Event Provider begins servicing requests.

Returning Event Data

public abstract List<string> ItemNames

Override this property to return the names of the event types supported by your Provider. These names should correspond to the Name property of the EventDataPoint instances that your Provider creates. For example, a Provider that supplies stock splits and dividends might return:

public override List<string> ItemNames =>
    new List<string>
    {
        "Split",
        "Dividend"
    };
protected abstract void GetNewEventData(
    BarHistory bh,
    DateTime lastUpdateDate)

WealthLab calls this method when it needs to obtain new event data for the supplied BarHistory. The lastUpdateDate parameter indicates the most recent date for which event data is already available when persistent storage is being used. If lastUpdateDate is not DateTime.MinValue, your implementation should normally retrieve only events that occurred after that date. Your implementation should obtain event data from its source, create an EventDataPoint instance, or an instance of a class derived from EventDataPoint, for each event, and add the resulting objects to:

bh.EventDataPoints

using its Add method. For example, the general pattern is:

protected override void GetNewEventData(
    BarHistory bh,
    DateTime lastUpdateDate)
{
    // Obtain events from the underlying source.

    // For each event:
    EventDataPoint eventItem = new EventDataPoint();

    // Configure eventItem here.

    bh.EventDataPoints.Add(eventItem);
}

WealthLab can call GetNewEventData concurrently from multiple threads while processing symbols in parallel. For this reason, avoid relying on mutable class-level state inside this method unless that state is properly synchronized. Prefer local variables whenever possible.

Persistent Storage

public virtual bool UsesPersistentStorage

The default value is false. Override this property and return true to use WealthLab's built-in persistent storage mechanism for event data. Persistent storage is especially useful when your Provider retrieves data from a remote service because previously downloaded events can be retained locally instead of being requested again.

protected abstract List<EventDataPoint> ConvertEventItems(
    EventDataCollection fdc)

When persistent storage is enabled, WealthLab stores previously retrieved events as EventDataPoint instances. When that information is read back, WealthLab supplies it to your Provider in an EventDataCollection. If your Provider uses custom classes derived from EventDataPoint, override ConvertEventItems to convert the stored items back into the appropriate derived types. Typically, your implementation will examine each EventDataPoint's Name and create the corresponding derived instance. For example:

protected override List<EventDataPoint> ConvertEventItems(
    EventDataCollection fdc)
{
    List<EventDataPoint> result = new();

    foreach (EventDataPoint item in fdc)
    {
        switch (item.Name)
        {
            case "Dividend":
                // Convert to custom DividendEventDataPoint.
                break;

            case "Split":
                // Convert to custom SplitEventDataPoint.
                break;
        }
    }

    return result;
}

Custom Storage

public virtual EventDataCollection ReadFromStorage(
    string symbol,
    bool metaDataOnly)

public virtual void WriteToStorage(
    string symbol,
    List<EventDataPoint> lst)

By default, WealthLab handles persistence for you. Override these methods if your Event Provider needs to use its own storage mechanism.

ReadFromStorage should return the persisted event data for the specified symbol. WriteToStorage should persist the supplied EventDataPoint instances for the symbol.

If you replace the built-in storage mechanism, you should also consider overriding GetSymbols, described below.

Bulk Provider Updates

public override bool SupportsBulkUpdate

Determines whether the Event Provider supports Provider-wide updates from the WealthLab Data Manager. A bulk update allows WealthLab to update event data for multiple symbols in one operation. By default, SupportsBulkUpdate returns the value of UsesPersistentStorage. If your Provider uses WealthLab's built-in persistent storage, you can normally leave this property unchanged and use the built-in bulk update behavior. If you use a custom update or storage mechanism, override the methods below.

public override void PerformBulkUpdate(
    IBulkUpdateHost updateHost)

Override this method to perform a Provider-wide update. Use the supplied IBulkUpdateHost instance to communicate progress and status back to WealthLab while the update is running.

public override void CancelBulkUpdate()

WealthLab calls this method when the user cancels a bulk update. Override it to stop your Provider-specific update process as soon as practical.

public virtual List<string> GetSymbols()

Returns the symbols for which the Event Provider already has persisted event data. The default implementation works with WealthLab's built-in persistent storage. If you override ReadFromStorage and WriteToStorage to use your own persistence mechanism, also override GetSymbols to return the symbols available in that storage.