Is it possible to display an industry index for a stock symbol?

Hello everyone,

I've been using Telechart as my EOD data source for use with AB 6.20.1. Telechart's sector / industry classifications is based on the Morningstar / Hemscott system whereas AB's seems to use the Yahoo classification.

Is there a way to display an index representing the stocks in an AB category, eg Symbols -> Basic Industries -> Agricultural Chemicals? This industry consists of about 20 stocks, and it also includes the Morningstar industry index MG435. However this index is wrong, because it corresponds to the Morningstar industry classification Insurance Brokers. I would like to plot the stock's industry classification on the same chart as the stock itself.

Is this the best way to display industry indices? Should I manually modify the assignment for all the "MGxxx" tickers, so that the example above MG435 is correctly assigned to the correct AB category. If so, which one? Finance -> Life Insurance or -> Property Casualty Insurers or -> Speciality Insurers. I've read the manual which explain categories, including the section which explains how the symbol assignment is now automatic. However, these MGxxx symbols don't seem to be included. Which is strange because there seems to be a one-to-one MGxxx symbol assignment to each AB industry classification.

Another question. Is it still recommended to use Telechart as an EOD data source? They only provide a 32-bit API, which means I have to use 32-bit AB to make use of the TC2000 plugin for EOD charting, and 64-bit for RT charting, using the IB plugin. Would using another EOD data source solve my problem?

@polomora I am not familiar with the Telechart sevice, but if you are interested in U.S. or Australian End-of-Day data feed for AmiBroker, I would strongly endorse Norgate Premium data.

The sector classification is automatically built in to the data feed and there are many many Index symbols that correspond to sectors so that you can easily plot the stock's industry as well as the stock. Below are a couple of example's of what automatically comes with your data (no work by the user to organize any of this).

image

And for exploration I have posted this before depending on what classification you are interested in,

Filter = 1;
AddColumn(SectorID(), "Sector number", 1.0);
AddTextColumn( SectorID( 1 ), "Sector name" );
AddTextColumn( GicsID( 0 ), "Gics Code");
AddTextColumn( GicsID( 1 ), "Gics Name");
AddColumn(IndustryID( 0 ), "Industry ID", 1.0);
AddTextColumn( IndustryID( 1 ), "Industry name" );

image

2 Likes

Thanks portfoliobuilder for the reply.

I had seen your earlier post, when searching around the forum, looking for a solution.

Just a question about Norgate Premium data. Is the index assignment for a given stock also automatic? For example, the industry I gave in the original post, Basic Industries -> Agricultural Chemicals. The stock CF is included as part of this industry. If AB is currently displaying this stock, does the AFL
MGTicker = GetBaseIndex();
give the symbol for the correct index? I would like to superimpose the industry index for the currently displayed stocks on its chart.

@polomora I do not think that information is included. I tried your line of code (new to me) and it did not return any value. In the "Information" tab for the stocks there is other info about the categories but no symbol included. The symbols are available in the appropriate "Sector" or "GICS" classification but it appears that you must determine the sector symbol on your own.

image

image

A stock's classification can relate to multiple indexes, so just just providing one symbol is not ideal.

AmiBroker doesn't allow a "base index" to be assigned programmatically to Sectors/Industries so this led us to think about a more useful solution to the issue.

We have some soon-to-be-released features in this area for US and Australian stocks.

Here's a peek at the preliminary documentation:

Determining the Industry Index Symbol for the Current Security

If you would like to retrieve the industry index symbol for the current security (for instance, to find other stocks with the same industry classification), you can use the NorgateCurrentIndustryIndexSymbol function as follows:

indexsymbol = NorgateCurrentIndustryIndexSymbol("< index family >", < level > ,"< index type >");
where:
< index family > can be $SPX, $SP1500 (for US stocks) or $XJO or $XKO (Australian stocks)
< level > is an integer from 1 to 4 denoting the level of the index
< indextype > is either PR (price return) or TR (total return)

For example, to determine the S&P 1500 Level 4 (Sub-Industry) price return index applicable to the current symbol, you would use:
indexsymbol = NorgateCurrentIndustryIndexSymbol("$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 have no value.

Using the example of Walt Disney Co (NYSE:DIS),
for the parameters:

$SPX,1,PR you'd get $SPXD (i.e. S&P 500 Consumer Discretionary Sector Index)
$SPX,4,PR you'd get $SPXENTE (i.e. S&P 500 Movies & Entertainment SubIndustry Index)
$SP1500,1,PR you'd get $SP1500DTR (i.e. S&P 500 Consumer Discretionary Sector Index).
$SP1500,1,TR you'd get $SP1500DTR (i.e. S&P 500 Consumer Discretionary Sector Total Return Index).
$SP1500,4,PR you'd get $SP1500ENTE (i.e. S&P 1500 Movies & Entertainment SubIndustry Index)
$SP1500,4,TR you'd get $SP1500ENTETR (i.e. S&P 500 Movies & Entertainment SubIndustry Total Return Index).

1 Like

This feature, when implemented, sounds exactly what I'm looking for.
Do you have a comparison of features NorgateData vs Telechart?

No - we don't directly compare or review competitors products. We will have a free trial capability for this new system, so you'll be able to try it for 3 weeks prior to purchasing a subscription.

Hi NorgateData.
Sounds great, also something I have been looking into for an algorithm I have been working on.
Can you let us know when this might be available?

Hi Derek,

This feature was in the initial release of Norgate Data on June 2018.

Details about how we integrate with AmiBroker and documentation on the usage are shown here:
https://norgatedata.com/ndu-overview.php
https://norgatedata.com/amibroker-database-layout-content.php
https://norgatedata.com/amibroker-usage.php

For this particular feature, we have two mechanisms - one which allows you to get the index symbol if the stock is in the index, and another that allows you to get the index symbol if the classification matches. Further details here:
https://norgatedata.com/amibroker-usage.php#industryindex

Cheers,
Richard.

1 Like

Hi Richard, I am using Norgate Data for the Australian market. All Australian codes use the suffix ".au" . I am aiming to source sector data to do an exploration. I have been able to source the Index code but not the sector value.

An extract of code is as follows:

#include_once "Formulas\Norgate Data\Norgate Data Functions.afl"


_SECTION_BEGIN("Exploration");
{
if( Status( "Action" ) == actionExplore );  //SetSortColumns( -5 );
Filter = 1;

AddColumn( Foreign("$XVI.au","C"), "$XVI.au",1.2,colordefault,colorDefault,50 );
AddColumn (Foreign(NorgateIndustryIndex("$XJO.au", 1 ,"PR"),"C"), "Sector", 1.2,colordefault,colorDefault,50 );
AddtextColumn( NorgateIndustryIndex("$XJO.au", 1 ,"PR"), "Index");
}

This exploration then produces this exploration:
EXPLORATION

Under the Index column it shows $XSJ, etc.

In the sector Column this is blank, i.e isn't picking up values.

As noted above the chart for the index is $XSJ.au.

My question is "is the lack of the ".au" in the exploration why no value is picked up by

AddColumn (Foreign(NorgateIndustryIndex("$XJO.au", 1 ,"PR"),"C"), "Sector", 1.2,colordefault,colorDefault,50 );

If this is so, can you suggest the appropriate coding.

Thanks for any guidance

I have had a response from Norgate. Richard Dale advises

It should be showing the .au suffix there - it looks like we have a bug in that area.

For now, you should manually add ".au" to the end. We'll develop a fix and test it over the next week or so, and I'll let you know when that is released.

I have altered the 2 lines of code by adding +".au"

Thanks Richard for your support :smiley: