Search Framework:
Namespace: WealthLab.Core
Parent: Object

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.

public string DSString

Contains a string that represents configuration information about the DataSet. How the DSString is interpreted depends on how it was created. Historical Data Providers and DataSet Providers use the DSString to configure the DataSet as it is read from the local file system. This configuration ultimately determines the Symbols contained in the DataSet.

public bool IsDynamic

Returns true if the DataSet has any entries defined in its DynamicDateRanges property.

public bool IsUserCreated

Returns true if the DataSet was created by the user in WL8, via the New DataSet Wizard, and false if it was created by a DataSet Provider.

public string Name

Contains the name of the DataSet, either entered by the user in the New DataSet Wizard, or assigned by a DataSet Provider.

public List<string> Symbols

A List of strings that contains the symbols in the DataSet.

public string SymbolString

Accesses the Symbols of the DataSet a single, comma-delimited string.

Members for Derived Classes
public Dictionary<string, DateRange> DynamicDateRanges

A Dictionary of DateRange instances, keyed by symbol, that represents the date ranges that specific symbols should be considered part of the DataSet. If an entry does not exist for a symbol, that symbol is considered to be part of the DataSet at any point in time. The WL8 backtester uses these values to only allow trades to occur within the specified date ranges. In this way, WL8 can model actual stock market indices, where symbols enter and leave the index at different points in time.

public virtual BarHistory GetHistory(string symbol, HistoryScale scale, DateTime startDate, DateTime endDate, int maxBars, GetHistoryControlBlock cb)

If ShouldReturnOwnData is overridden to return true, override this method to return historical data for the specified symbol and scale, in the form of a BarHistory instance, for the specified date range. If maxBars is non-zero, return this many bars of data. Otherwise, use the startDate and endDate parameters to determine the date range.

public Bitmap Glyph

You can assign a System.Drawing.Bitmap that will be used to represent the DataSet in the WL8 DataSet tree. By default, WL8 uses the Glyph of the associated Historical Data Provider, or a generic image if none is available.

public virtual void PostDataLoad(BarHistory bh)

WL8 calls this method after GetHistory. The default implementation assigns the DataSet's DynamicDateRanges to the BarHistory instance by calling its AddExecutableRange method. You can override this method to perform any further processing required, but be sure to call base.PostDataLoad to retain the base functionality.

public string PreferredDataProviderName

In a DataSet Provider, you can assign a value to this DataSet property to associate the DataSet with a specific Historical Data Provider. WL8 will attempt to use the provider first when getting data for this DataSet.

public bool ReadOnlySymbols

Determines if the symbols in the DataSet can be modified by the user.

public virtual bool ShouldReturnOwnData

Override this method to return true if the DataSet should be responsible for returning its own historical data. If left at the default of false, WL8 will use its built-in mechanism of selected Historical Data Providers when obtaining historical data for this DataSet. If true, you should also implement the SupportsScale property and GetHistory methods.

public virtual bool SupportsScale(HistoryScale scale)

If ShouldReturnOwnData is overridden to return true, override this property to indicate if the DataSet supports returning historical data for the specified scale.

public virtual List<string> TradableSymbols

By default this returns the same List of strings as the Symbols property. You can override this property to return a subset of this list, indicating which symbols are currently tradable. You can, for example, leave out decomissioned stock symbols. This property is used in the WL8 Strategy Monitor to activate only the tradable symbols.