Norgate Data Norgate Data
 

Wealth-Lab 6.9 Norgate Data Extension Usage

The following instructions are for Wealth-Lab 6.9. To view the instructions for Wealth-Lab 8 go here.

DataSets

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

Note 1: The function does not return dates. Instead, it returns true or false (1 or 0) for index membership for any date.
Note 2: You will need either a Platinum or Diamond level subscription to access historical index constituent information. At Silver or Gold level, the function will always return 0.

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

Note 1: The function does not return dates. Instead, it returns true or false (1 or 0) for major exchange listing for any date.
Note 2: You will need either a Platinum or Diamond level subscription to access major exchange listing information. At Silver or Gold level, the function will always return 0.

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:

Bars.SymbolInfo.<property>
PropertyC# TypeDescription
SecurityType
SecurityType enumType of Security (Stock, Future)
PointValue
DoubleThe point value represents how much profit is gained when a single futures contract moves up one full point.
Tick
DoubleThe mininum tick increment for a futures contract
Margin
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
SecondLastQuotedDate
DateTimeSecond last bar of trading for any delisted/expired security
For example usage see Note (1)
LastQuotedDate
DateTimeLast bar of trading for any delisted/expired security
BusinessSummary
StringSummary of the company's operations
BusinessSummaryLastUpdate
StringDate when the Business Summary was last updated
FinancialSummary
StringSummary of the company's most recent reported financials
WebSite
StringWeb site of company
Domicile
StringCountry of Domicile
AssetId
IntegerUnique identifier of securities
Classification
StringReturns the classification for the given classification scheme
ClassificationAtLevel
StringReturns the classification and level for the given classification scheme
ClassificationName
StringReturns the classification name for the given classification scheme
ClassificationNameAtLevel
StringReturns the classification name and level for the given classification scheme
ClassificationDescription
StringReturns the detailed description of the classification, given a classification scheme
ClassificationDescriptionAtLevel
StringReturns the detailed description and level of the classification, given a classification scheme
CorrespondingIndustryIndex
StringReturns the symbol for the industry index applicable to the given security
For example usage see Note (2)
SharesOutstanding
DoubleReturns the current number of shares outstanding
SharesFloat
DoubleReturns the current number of shares available to trade as free float
Exchange
StringReturns the exchange name of the security
Currency
StringReturns the trading currency of the security
BaseType
StringReturns the base type of the security
Subtype1
StringReturns the sub type 1 of the security
Subtype2
StringReturns the sub type 2 of the security
Subtype3
StringReturns the sub type 3 of the security
LowestEverTickSize
DoubleReturns the lowest ever tick size for a futures contract

Notes:

(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:

	originalClose[bar] 
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