Wealth-Lab Usage


Wealth-Lab strategies are performed against DataSets which directly reference Norgate Data's watchlists. Watchlists can be created and managed in NDU or within Wealth-Lab when you create a new DataSet.

Show illustration on how to create a new DataSet from Norgate Data with "S&P 500 Current & Past" constituents.

Indicators, Dividends and Security Information

Making use of Historical Index Constituents

In the Execute() method, add the following code:

	var indexConstituent = NorgateIndexConstituentTimeSeries.Series(Bars, "S&P 500");

Either the index name (eg. "S&P 500") or the index symbol ("$SPX") can be specified. Details of the Historical Index Constituent coverage can be found in the Data Content Tables.

In the part of Execute() where you analyze conditions to enter a position, you can check to see whether the stock was in the index on the current bar, by incorporating a very simple condition into your buy signal:

	&& indexConstituent[bar] == 1

Determining when a US stock was listed on a major exchange

Some US stocks have had periods where they were not listed by a major exchange and only tradeable as OTC/Pink Sheet stocks.

In backtesting, you can elect to only trigger a trade if the stock was listed on a major exchange (NYSE, Nasdaq, NYSE American, NYSE Arca, Cboe BZX, IEX) on the signal date by using the class NorgateMajorExchangeListedTimeSeries as follows:

In the Execute() method, add the following code:

	var majorExchangeListed = NorgateMajorExchangeListedTimeSeries.Series(Bars);

In the part of Execute() where you analyze conditions to enter a position, you can check to see whether the stock was in the index on the current bar, by incorporating a very simple condition into your buy signal:

	&& majorExchangeListed[bar] == 1

Referencing Distributions/Dividends

In your "Price & Volume Adjustment" settings, you can remove the effect of any distributions/dividends received by adjusting the price and volume on a proportional basis. This methodology simulates re-investing the dividend on the day prior to the ex-date and mirrors the methodology used in Total Return indices. To change this setting, click Data Manager, select the Norgate Data tab and select "Capital reconstructions, special distributions and ordinary cash dividends" as shown below:

However, if you would prefer to track the dividends separately instead, you should use a price adjustment method that does not include the dividends you wish to track (e.g. if you want to track ordinary dividends only, then set your adjustment method to capital+special), then use select File -> Preferences, cick on Backtest Settings and tick the field "Apply dividends to backtest results when using Portfolio Simulation Mode" and select NorgateDividendTimeSeriesOnExDate.

Referencing Security Information

The following Symbol properties are built into Wealth-Lab and automatically populated by the Norgate Data Extension, and can be queried within your code using:

PropertyC# TypeDescription
SecurityType enumType of Security (Stock, Future)
DoubleThe point value represents how much profit is gained when a single futures contract moves up one full point.
DoubleThe mininum tick increment for a futures contract
DoubleFor futures, the initial margin required to open a position of 1 contract.

Additional metadata for each security is availble, using methods provided inside the static class MetaData, including:

The following Security Information methods are available for querying:

MethodC# TypeDescription
DateTimeSecond last bar of trading for any delisted/expired security
For example usage see Note (1)
DateTimeLast bar of trading for any delisted/expired security
StringSummary of the company's operations
StringDate when the Business Summary was last updated
StringSummary of the company's most recent reported financials
StringWeb site of company
StringCountry of Domicile
IntegerUnique identifier of securities
StringReturns the classification for the given classification scheme
StringReturns the classification and level for the given classification scheme
StringReturns the classification name for the given classification scheme
StringReturns the classification name and level for the given classification scheme
StringReturns the detailed description of the classification, given a classification scheme
StringReturns the detailed description and level of the classification, given a classification scheme
StringReturns the symbol for the industry index applicable to the given security
For example usage see Note (2)
DoubleReturns the current number of shares outstanding
DoubleReturns the current number of shares available to trade as free float
StringReturns the exchange name of the security
StringReturns the trading currency of the security
StringReturns the base type of the security
StringReturns the sub type 1 of the security
StringReturns the sub type 2 of the security
StringReturns the sub type 3 of the security
DoubleReturns the lowest ever tick size for a futures contract


(1) To obtain the SecondLastQuotedDate, you would use the following:
	var slqd = MetaData.SecondLastQuotedDate(Bars.Symbol);

Supported classification schemes include ThomsonReutersBusinessClassification, GICS, NorgateDataFuturesClassification and NorgateDataCashCommoditiesClassification.

(2) To retrieve the industry index symbol for the current security (for instance, to compare the current stock against its applicable industry index), you can use the CurrentIndustryIndexSymbol method as follows:

	var indexsymbol = MetaData.CorrespondingIndustryIndex(Bars.Symbol," < index family > ", < level > ,"< index type >");
where: For example, to determine the S&P 1500 Level 4 (Sub-Industry) price return index applicable to the current symbol, you would use:
	var indexsymbol = MetaData.CorrespondingIndustryIndex(Bars.Symbol,"$SP1500",4,"PR");

If the current symbol has no applicable classification or there is no industry index present at the given level, then indexsymbol in the example above will be empty.

Referencing Fundamental Data

Fundamental data provided by Norgate can be referenced using the GetFundamentalItem in-built call within Wealth-Lab. For example, to retrieve the current fundamental value, use:
	var a = GetFundamentalItem(Bars.Count-1, Bars.Symbol, "<fundamental field>"); 

Further information on the fundamental fields are shown here.

Referencing the Original Unadjusted Close

If your trading system needs to reference the original unadjusted closing price of a security, you can use the following -

	var originalClose = NorgateOriginalCloseTimeSeries.Series(Bars);

Then within your code, you can reference the current bar's original close with:

For example, you could add a condition into your buy formula to only trade stocks that close above $2 with:
	&& originalClose[bar] > 2

Additional Time Series functions provided

NorgateDividendTimeSeries and NorgateDividendYieldTimeSeries are also provided, and can be called in the same manner as NorgateOriginalCloseTimeSeries.

Next page: Wealth-Lab FAQ