Search Framework:
DataSet
Namespace: WealthLab.Core
Parent: Object

The DataSet class represents a DataSet in WL9, either created by the user using the New DataSet Wizard, or generated by a DataSet Provider. DataSet Providers can return instances of classes derived from DataSet, allowing them to customize behavior such as symbol membership, historical data retrieval, and supported scales. DataSet implements the IHistoryProvider and INamed interfaces.

Members
AllowReconfigure
public virtual bool AllowReconfigure

Returns whether the DataSet can be reconfigured. If the DataSet has an associated DataProvider, the default implementation returns the provider's AllowConfigurationOfExistingDataSets value. Otherwise, it returns true.


DataProvider
public DataProviderBase DataProvider

Returns or assigns the Historical Data Provider associated with the DataSet. If no provider has been explicitly assigned, the getter attempts to locate the provider specified by PreferredDataProviderName.


DataSetProvider
public object DataSetProvider

Contains a reference to the DataSet Provider associated with this DataSet, if any.


DSString
public string DSString

Contains configuration information associated with the DataSet. How the DSString is interpreted depends on the Historical Data Provider or DataSet Provider that created the DataSet.


DynamicDateRanges
public List<DateRange> DynamicDateRanges

Contains DateRange instances that specify the periods during which particular symbols belong to a dynamic DataSet. Each DateRange identifies its symbol through its Symbol property. WL9 uses these ranges to restrict backtest trading to periods when a symbol was actually a member of the DataSet.


GlyphResource
public virtual string GlyphResource

Returns or assigns the name of an embedded resource used to represent the DataSet in the WL9 DataSets tree. If no resource was explicitly assigned, the associated DataProvider glyph is used. If no DataProvider is available, WL9 uses its default DataSet glyph.


IsDynamic
public bool IsDynamic

Returns true if the DataSet is dynamic. A user-created DataSet is dynamic when IsDynamicEnabled is true and DynamicDateRanges contains at least one entry. DataSet-derived classes created by DataSet Providers can also indicate that they are dynamic.


IsDynamicEnabled
public bool IsDynamicEnabled

Indicates whether the Dynamic option was enabled when the DataSet was created in the New DataSet Wizard.


IsHidden
public bool IsHidden

Determines whether the DataSet should be hidden from the normal WL9 user interface.


IsUserCreated
public bool IsUserCreated

Returns true if the DataSet was created by the user in WL9, typically through the New DataSet Wizard, and false if it was created by a DataSet Provider.


Name
public string Name

Contains the name of the DataSet.


PreferredDataProviderName
public string PreferredDataProviderName

Contains the name of the preferred Historical Data Provider for this DataSet. WL9 will attempt to use this provider when obtaining historical data for the DataSet.


QualifiedName
public string QualifiedName

Returns a name that can uniquely identify the DataSet when multiple DataSet Providers produce DataSets having the same Name. If PreferredDataProviderName is assigned, the returned value consists of Name, a semicolon, and PreferredDataProviderName. Otherwise, it returns Name.


ReadOnlySymbols
public bool ReadOnlySymbols

Determines whether the user is permitted to modify the symbols in the DataSet.


ShouldReturnOwnData
public virtual bool ShouldReturnOwnData

Returns whether the DataSet is responsible for providing its own historical data. The default implementation returns false, causing WL9 to use its normal Historical Data Provider mechanism. Override this property to return true in a DataSet-derived class that implements its own historical data retrieval.


SortedSymbols
public List<string> SortedSymbols

Returns the DataSet's symbols sorted alphabetically.


Symbols
public List<string> Symbols

Contains the symbols in the DataSet. Assigning this property replaces the existing symbol list and sorts the supplied symbols alphabetically.


SymbolString
public string SymbolString

Gets or sets the DataSet's Symbols as a single storage-formatted string. Setting this property parses the string and replaces the current symbol list.


TradableSymbols
public virtual List<string> TradableSymbols

Returns the symbols that are currently tradable. The default implementation returns Symbols. Override this property to return a subset of the DataSet symbols, for example to exclude decommissioned securities. WL9 uses this property in areas such as the Strategy Monitor.



Methods
AllowConfigurationOfExistingDataSets
public bool AllowConfigurationOfExistingDataSets()

Returns whether the DataSet can be reconfigured based on its associated Historical Data Provider. If no provider is associated with the DataSet, the method returns true.


GetDataProvider
public DataProviderBase GetDataProvider(bool useDefaultWD)

Returns the Historical Data Provider associated with the DataSet and initializes it if required. If no provider is associated and useDefaultWD is true, the method attempts to use the WealthData provider. If useDefaultWD is false and no provider is associated, it returns null.


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

Override this method when ShouldReturnOwnData returns true to provide historical data for the specified symbol and scale. Return a BarHistory containing the requested data. The startDate, endDate, and maxBars parameters describe the requested range, and cb contains additional data request options. The base implementation returns null.


Parse
public static DataSet Parse(string s)

Creates and returns a DataSet from its legacy persisted string representation. This method is deprecated.


ParseXML
public static DataSet ParseXML(string xml)

Creates and returns a DataSet by deserializing the XML representation supplied in xml.


Persist
public string Persist()

Returns a legacy string representation of the DataSet suitable for persistence. This method is deprecated.


PersistXML
public string PersistXML()

Serializes the DataSet to XML and returns the resulting string.


PostDataLoad
public virtual void PostDataLoad(BarHistory bh)

WL9 calls this method after historical data has been loaded for a symbol in the DataSet. The default implementation applies matching entries in DynamicDateRanges to the supplied BarHistory by calling its AddExecutableRange method. Override this method to perform additional post-processing, but call base.PostDataLoad(bh) to retain the dynamic DataSet behavior.


SupportsScale
public virtual bool SupportsScale(HistoryScale scale)

Returns whether a DataSet that supplies its own historical data supports the specified scale. The default implementation returns true. Derived DataSet classes that override ShouldReturnOwnData can override this method to restrict the supported scales.