Long time readers know that I use Norgate Data for most of my backtesting. The data is clean, reliable and links easily with my backtesting software Amibroker.
Norgate Data also carries a long list of fundamental data points. The data is not historical but it can be used to set up some very powerful stock screens.
Together with the exploration function in Amibroker, it’s possible to scan thousands of stocks in just a few seconds. Let’s take a look at it step by step.
Step 1. Locate the metrics you want to use
The first step is to go to the Norgate Data web page and take a look at all the fundamental data points that are available. I counted roughly 160 in total not including metadata like float and shares outstanding.
The following screenshot shows just some of the fundamental data points that are available. All you need to do is note down the field name of the data point that you want to use. For example, if you want to use price-to-book just copy “price2bk”:
This data is supplied by Thomson Reuters and requires a Gold, Platinum or Diamond level subscription.
Once again, these are current data points. Getting historical fundamental data is a complex process and a different matter entirely. But with 160 current data points we can create some interesting screening criteria.
Step 2. Create an exploration
Let’s say you want to screen for S&P 500 stocks that are over a $10 billion market cap with a price-to-earnings between 0 and 10 and a price-to-sales between 0 and 5.
All you need to do is copy the relevant field names from the Norgate website and create a simple exploration in Amibroker.
To do this, click formula editor and give the document a name like “Simple Screen”.
You can then write a formula like below:
#include_once "Formulas\Norgate Data\Norgate Data Functions.afl" SetFormulaName("Simple Screen"); MarketCap = NorgateFundamentals("mktcap"); PE = NorgateFundamentals("peexclxor"); PS = NorgateFundamentals("ttmpr2rev"); Filter = MarketCap > 10000 AND PE > 0 AND PE < 10 AND PS > 0 AND PS < 5; AddColumn(MarketCap,"MarketCap",1.2); AddColumn(PE, "PE",1.2); AddColumn(PS, "PS",1.2);
In the formula above, the first line is required to access the appropriate data fields in the Norgate database.
We then give each data field an identifier name so that Amibroker can recognize it.
We set up the filter which is what Amibroker needs to run an exploration and the rules that we are interested in.
Then we set up the output using the AddColumn function and give each identifier an output name with two decimal points (1.2).
Once the code is set up, set the watchlist to the S&P 500 universe, the date range to “1 recent bar” and then run the exploration.
The output is generated in just a couple of seconds and you can sort the data by either of the columns.
As you can see from the screen grab below, when I ran the screen, there were 10 stocks in the S&P 500 matching our rules:
These 10 stocks all have a market cap over $10 billion, P/E under 10 and a P/S under 5. (In our recent research we found that a P/S under 5 produced significantly better long term returns).
Step 3. Create custom indicators
The great thing about using Amibroker and Norgate together is that we can now write formulas to create custom indicators or ratios. This is not possible on most other stock screeners.
For example, let’s say you want the PEG ratio which was popularised by Peter Lynch.
Unfortunately, there is no PEG ratio in the Norgate database but you can easily create it yourself.
All you need is a formula like this one:
PE = NorgateFundamentals("peexclxor"); Growth = NorgateFundamentals("epstrendgr")+0.01; PEG = PE / Growth; AddColumn(PEG, "PEG",1.2);
Here, P/E is the twelve month trailing figure from Norgate and Growth is the 5 year CAGR EPS growth rate. (You could alternatively use EBITDA growth rate, revenue growth rate or 3 year growth).
By dividing the P/E with the EPS growth rate we get one method of calculating the famous PEG ratio. Typically, a PEG less than one indicates an undervalued stock.
(Note that I have added a very small amount to the growth rate to avoid a division by zero warning).
Now, when we run the screen you can see that six of our 10 stocks have a PEG less than 1 and MPC has a negative PEG.
Going even further, we can create a scatter plot chart that shows the P/E ratio plotted against the EPS growth rate with the following formula:
#include_once "Formulas\Norgate Data\Norgate Data Functions.afl" SetFormulaName("Simple Screen"); PE = NorgateFundamentals("peexclxor"); Growth = NorgateFundamentals("epstrendgr")+0.01; PEG = PE / Growth; Filter = 1 ; AddColumn(PE, "PE",1.2); AddColumn(PEG, "PEG",1.2); AddColumn(Growth, "EPS Growth",1.2); Color = ColorHSB( 2 * Status("stocknum") % 255, 255, 255 ); XYChartAddPoint( "PE/EPS Growth", Name(), PE, GROWTH, Clr ); XYChartSetAxis("PE/EPS Growth", "P/E", "EPS GROWTH");
The next graphic shows this exploration applied to the S&P 100. The P/E ratio is plotted along the X axis and the EPS growth rate is plotted along the Y axis:
ADBE has a high P/E of 56 but an equally high growth rate of 62.7%. It shows up in the top left as a red dot.
Meanwhile CRM has a P/E of 595 and a growth rate of zero. You can see it as the yellow dot on the right hand side. A P/E of 595 with zero growth is typically an unattractive investment proposition.
Step 4. View analyst estimates
Another thing you can do with Norgate data is to access latest broker estimates (as recorded by Reuters).
There are many data fields to choose from such as EPS consensus estimates, revenue estimates, EPS surprises etc.
The following formula allows you to plot the analyst target price and the number of analysts/estimates covering the stock. I’ve then created a custom formula to show how far the target price is away from the current closing price and I’ve colored it red or green.
Targetprice = NorgateFundamentals("targetprice"); Numberofestimates = NorgateFundamentals("projepsnumofest"); Targetdis = ((targetprice - Close)/Close)*100; AddColumn(Close, "Close",1.2); AddColumn(targetprice, "Target Price",1.2); AddColumn(targetdis, "Target Dis",1.2,IIf( targetdis > 0, colorGreen, colorRed ) ); AddColumn(Numberofestimates, "# Estimates",1.0);
As you can see from the output below, our biggest stock Intel has a current closing price of $44.46 which is 25.99% below the consensus broker target of $56.02, based on 35 broker estimates. The target price is 26% above the current price so the target distance value is colored green:
Step 5. Get creative
You should now have an idea about what’s possible using Norgate data and Amibroker to screen for stocks. There’s no limit to your imagination about what you can create.
Here’s a screen grab of something that I have put together and still working on. You can click the image to get a bigger view:
There are plenty of good stock screeners on the internet such as Finviz and Yahoo! Finance. I use Finviz daily and it does a great job with a lot of metrics. However, it doesn’t have the ability to code new indicators or create truly customized screens.
Norgate data provides over 160 metrics which means you can build some in depth stock screens on thousands of stocks. Combine that with the ability to build custom indicators in Amibroker and you have a sophisticated solution for advanced stock screening.