Hello all,
I recently decided to subscribe to IBD's eTables, because as a growth stock investor, I like IBD rankings, they are pretty useful to me and make for good data in the interpretation window (kind of like a poor man's Marketsmith).
eTables is a little known jem, hardly costs a thing compared to subscribing to their paper or other products (less than 20USD a month) so it definitely has a lot of bang for the buck. The best thing is, you can download the data into text files, which makes it ripe for use in Amibroker.
The code is simple, and I probably should've used functions, but whatever, it works!
Step 1:
Download as much data from eTables as you can. I do this by running a batch file that opens chrome with URLs defined that download the IBD50, IBD8585 IBD New America, and then their regular stock tables ranked in different ways. You can't download their entire database, but the above covers all the stocks you should care about if you are a growth investor
BATCH FILE (save as .bat file somewhere convenient)
start Chrome "https://research.investors.com/etables/ViewText.aspx?tabView=IBD100&columnsort1=ibd100rank&columnsorttype1=ASC&columnsort2=&columnsorttype2=DESC&search=&filter="
start Chrome "https://research.investors.com/etables/ViewText.aspx?tabView=NEWAMERICA&columnsort1=comprating&columnsorttype1=DESC&columnsort2=&columnsorttype2=DESC&search=&filter=&listType="
start Chrome "https://research.investors.com/etables/ViewText.aspx?tabView=IBD8585&columnsort1=comprating&columnsorttype1=DESC&columnsort2=&columnsorttype2=DESC&search=&filter=&listType="
start Chrome "https://research.investors.com/etables/ViewText.aspx?tabView=STOCKTABLES&columnsort1=comprating&columnsorttype1=DESC&columnsort2=&columnsorttype2=DESC&search=&filter=&listType="
start Chrome "https://research.investors.com/etables/ViewText.aspx?tabView=STOCKTABLES&columnsort1=epsrank&columnsorttype1=DESC&columnsort2=comprating&columnsorttype2=DESC&search=&filter=&listType="
start Chrome "https://research.investors.com/etables/ViewText.aspx?tabView=STOCKTABLES&columnsort1=relst&columnsorttype1=DESC&columnsort2=comprating&columnsorttype2=DESC&search=&filter=&listType="
start Chrome "https://research.investors.com/etables/ViewText.aspx?tabView=STOCKTABLES&columnsort1=grpstr&columnsorttype1=DESC&columnsort2=comprating&columnsorttype2=DESC&search=&filter=&listType="
start Chrome "https://research.investors.com/etables/ViewText.aspx?tabView=STOCKTABLES&columnsort1=smr&columnsorttype1=DESC&columnsort2=comprating&columnsorttype2=DESC&search=&filter=&listType="
start Chrome "https://research.investors.com/etables/ViewText.aspx?tabView=STOCKTABLES&columnsort1=accdis&columnsorttype1=DESC&columnsort2=comprating&columnsorttype2=DESC&search=&filter=&listType="
start Chrome "https://research.investors.com/etables/ViewText.aspx?tabView=STOCKTABLES&columnsort1=sponrating&columnsorttype1=DESC&columnsort2=comprating&columnsorttype2=DESC&search=&filter=&listType="
When you run the batch file, chrome will open a tab for each instance and you'll automatically get the download dialog box for each download. Put them somewhere convenient and keep the path in mind for the AFL code in step 2.
Step 2:
Run this AFL to scrape all the text file, from the AFL window (no need for apx). Fix the code to enter your path where you downloaded above files from step 1.
/*
Scrape all IBD eTables and set static variables for all IBD prop ratings
Author: Michael Angelo Mustillo
Original Date: 2019/10/11
Revision NC
*/
/*
Update Log
----------
N/A
*/
//////////////////////////////////////////////////////////////////////////////////////
// Master Watchlist Prep
{
// Prepare Watchlist by clearing it
IBDMLList = CategoryFind("eTables_MasterList", categoryWatchlist);
// retrive comma-separated list of symbols in watch list
MLlist = CategoryGetSymbols( categoryWatchlist, IBDMLList );
//iterate through watchlist members and remove
for( i = 0; ( sym = StrExtract( MLlist, i ) ) != ""; i++ )
{
CategoryRemoveSymbol( sym, categoryWatchlist, IBDMLList );
}
}
//////////////////////////////////////////////////////////////////////////////////////
// IBD50 Table Scrape
//
{
// Prepare Watchlist by clearing it
IBD50List = CategoryFind("eTables_IBD50", categoryWatchlist);
// retrive comma-separated list of symbols in watch list
list = CategoryGetSymbols( categoryWatchlist, IBD50List );
//iterate through watchlist members and remove
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
CategoryRemoveSymbol( sym, categoryWatchlist, IBD50List );
}
// openfile
file = fopen("path/file", "r");
// Goto date and store for records
for(i = 0; i < 2; i++)
CL = fgets(file);
IBDSTDate = StrMid(CL, 11);
StaticVarSetText("IBDSTUpdateDate", IBDSTDate, True);
// prep file position for loop
for(i = 0; i < 2; i++)
CL = fgets(file);
// Loop to extract data of each IBD50 stock
for(i = 0; i < 50; i++)
{
for(j = 0; j < 2; j++)
CL = fgets(file);
// Extract ticker
DirtyTicker = StrMid(CL, 26, 6);
// Clean up ticker
char = "";
Ticker = "";
j = 0;
while(char != ")")
{
char = StrMid(DirtyTicker, j++, 1);
if (char != ")")
Ticker = Ticker + char;
}
// Extract Summary
Raw = StrMid(CL, 30);
StaticVarSetText(Ticker + "_Brief", Raw, True);
// Goto Data Line
CL = fgets(file);
// Get IBD50 ranking
Raw = StrMid(CL, 0, 2);
IBD50Rank = StrToNum(Raw);
StaticVarSet(Ticker + "_IBD50Rank", IBD50Rank, True);
// Get Composite Rating
Raw = StrMid(CL, 8, 2);
CR = StrToNum(Raw);
StaticVarSet(Ticker + "_CR", CR, True);
// Get EPS Rating
Raw = StrMid(CL, 26, 2);
EPS = StrToNum(Raw);
StaticVarSet(Ticker + "_EPS", EPS, True);
// Get RS Rating
Raw = StrMid(CL, 34, 2);
RS = StrToNum(Raw);
StaticVarSet(Ticker + "_RS", RS, True);
// Get IGRS Rating
Raw = StrMid(CL, 42, 2);
IGRS = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_IGRS", IGRS, True);
// Get SMR Rating
Raw = StrMid(CL, 57, 2);
SMR = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_SMR", SMR, True);
// Get Acc/Dis Rating
Raw = StrMid(CL, 65, 2);
AD = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_AD", AD, True);
// Get Sponsorship Rating
Raw = StrMid(CL, 74, 2);
Spon = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_Spon", Spon, True);
// Get P/E
Raw = StrMid(CL, 142, 4);
PE = StrToNum(Raw);
StaticVarSet(Ticker + "_PE", PE, True);
// Get Last Quarter Sales
Raw = StrMid(CL, 158, 4);
LQSales = StrToNum(Raw);
StaticVarSet(Ticker + "_LQSales", LQSales, True);
// Get Last Quarter EPS
Raw = StrMid(CL, 170, 4);
LQEPS = StrToNum(Raw);
StaticVarSet(Ticker + "_LQEPS", LQEPS, True);
// Get Consecutive Quarters of +15% EPS
Raw = StrMid(CL, 182, 4);
CQEPS15 = StrToNum(Raw);
StaticVarSet(Ticker + "_CQEPS15", CQEPS15, True);
// Get Current Quarter EPS Estimated Change
Raw = StrMid(CL, 194, 4);
CQEPSEst = StrToNum(Raw);
StaticVarSet(Ticker + "_CQEPSEst", CQEPSEst, True);
// Get Current Year EPS Estimated Change
Raw = StrMid(CL, 206, 4);
CYEPSEst = StrToNum(Raw);
StaticVarSet(Ticker + "_CYEPSEst", CYEPSEst, True);
// Get Pretax Margin
Raw = StrMid(CL, 218, 4);
PTMargin = StrToNum(Raw);
StaticVarSet(Ticker + "_PTMargin", PTMargin, True);
// Get Return on Equity
Raw = StrMid(CL, 226, 4);
ROE = StrToNum(Raw);
StaticVarSet(Ticker + "_ROE", ROE, True);
// Add ticker to watchlist
CategoryAddSymbol(Ticker, categoryWatchlist, IBD50List);
CategoryAddSymbol(Ticker, categoryWatchlist, IBDMLList);
}
// Close IBD50 file
fclose(file);
}
//////////////////////////////////////////////////////////////////////////////////////
// IBD8585 Table Scrape
//
{
// Prepare Watchlist by clearing it
IBD8585List = CategoryFind("eTables_IBD8585", categoryWatchlist);
// retrive comma-separated list of symbols in watch list
list = CategoryGetSymbols( categoryWatchlist, IBD8585List );
//iterate through watchlist members and remove
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
CategoryRemoveSymbol( sym, categoryWatchlist, IBD8585List );
}
// openfile
file = fopen("path/file", "r");
// Goto date and store for records
for(i = 0; i < 2; i++)
CL = fgets(file);
IBDSTDate = StrMid(CL, 11);
StaticVarSetText("IBDSTUpdateDate", IBDSTDate, True);
// prep file position for loop
for(i = 0; i < 4; i++)
CL = fgets(file);
// Loop to extract data of each IBD8585 stock
loop = True;
while(loop)
{
// Extract ticker
DirtyTicker = StrMid(CL, 26, 6);
// Clean up ticker
char = "";
Ticker = "";
j = 0;
while(char != ")")
{
char = StrMid(DirtyTicker, j++, 1);
if (char != ")")
Ticker = Ticker + char;
}
// Extract Summary
Raw = StrMid(CL, 30);
StaticVarSetText(Ticker + "_Brief", Raw, True);
// Flag that stock is in IBD8585
StaticVarSetText(Ticker + "_inIBD8585", "Yes", True);
// Goto Data Line
CL = fgets(file);
// Get Composite Rating
Raw = StrMid(CL, 0, 2);
CR = StrToNum(Raw);
StaticVarSet(Ticker + "_CR", CR, True);
// Get EPS Rating
Raw = StrMid(CL, 18, 2);
EPS = StrToNum(Raw);
StaticVarSet(Ticker + "_EPS", EPS, True);
// Get RS Rating
Raw = StrMid(CL, 26, 2);
RS = StrToNum(Raw);
StaticVarSet(Ticker + "_RS", RS, True);
// Get IGRS Rating
Raw = StrMid(CL, 34, 2);
IGRS = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_IGRS", IGRS, True);
// Get SMR Rating
Raw = StrMid(CL, 49, 2);
SMR = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_SMR", SMR, True);
// Get Acc/Dis Rating
Raw = StrMid(CL, 57, 2);
AD = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_AD", AD, True);
// Get Sponsorship Rating
Raw = StrMid(CL, 66, 2);
Spon = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_Spon", Spon, True);
// Get P/E
Raw = StrMid(CL, 134, 4);
PE = StrToNum(Raw);
StaticVarSet(Ticker + "_PE", PE, True);
// Get Last Quarter Sales
Raw = StrMid(CL, 150, 4);
LQSales = StrToNum(Raw);
StaticVarSet(Ticker + "_LQSales", LQSales, True);
// Get Last Quarter EPS
Raw = StrMid(CL, 162, 4);
LQEPS = StrToNum(Raw);
StaticVarSet(Ticker + "_LQEPS", LQEPS, True);
// Get Consecutive Quarters of +15% EPS
Raw = StrMid(CL, 174, 4);
CQEPS15 = StrToNum(Raw);
StaticVarSet(Ticker + "_CQEPS15", CQEPS15, True);
// Get Current Quarter EPS Estimated Change
Raw = StrMid(CL, 186, 4);
CQEPSEst = StrToNum(Raw);
StaticVarSet(Ticker + "_CQEPSEst", CQEPSEst, True);
// Get Current Year EPS Estimated Change
Raw = StrMid(CL, 198, 4);
CYEPSEst = StrToNum(Raw);
StaticVarSet(Ticker + "_CYEPSEst", CYEPSEst, True);
// Get Pretax Margin
Raw = StrMid(CL, 210, 4);
PTMargin = StrToNum(Raw);
StaticVarSet(Ticker + "_PTMargin", PTMargin, True);
// Get Return on Equity
Raw = StrMid(CL, 218, 4);
ROE = StrToNum(Raw);
StaticVarSet(Ticker + "_ROE", ROE, True);
// Add ticker to watchlist
CategoryAddSymbol(Ticker, categoryWatchlist, IBD8585List);
CategoryAddSymbol(Ticker, categoryWatchlist, IBDMLList);
// go to next ticker
for(j = 0; j < 2; j++)
CL = fgets(file);
if(StrMatch(CL, "*About IBD eTables*"))
loop = False;
}
// Close IBD8585 file
fclose(file);
}
//////////////////////////////////////////////////////////////////////////////////////
// IBD New America Table Scrape
//
{
// Prepare Watchlist by clearing it
IBDNAList = CategoryFind("eTables_IBDNewAm", categoryWatchlist);
// retrive comma-separated list of symbols in watch list
list = CategoryGetSymbols( categoryWatchlist, IBDNAList );
//iterate through watchlist members and remove
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
CategoryRemoveSymbol( sym, categoryWatchlist, IBDNAList );
}
// openfile
file = fopen("path/file", "r");
// Goto date and store for records
for(i = 0; i < 2; i++)
CL = fgets(file);
IBDSTDate = StrMid(CL, 11);
StaticVarSetText("IBDSTUpdateDate", IBDSTDate, True);
// prep file position for loop
for(i = 0; i < 4; i++)
CL = fgets(file);
// Loop to extract data of each IBD8585 stock
loop = True;
while(loop)
{
// Extract ticker
DirtyTicker = StrMid(CL, 26, 6);
// Clean up ticker
char = "";
Ticker = "";
j = 0;
while(char != ")")
{
char = StrMid(DirtyTicker, j++, 1);
if (char != ")")
Ticker = Ticker + char;
}
// Extract Summary
Raw = StrMid(CL, 30);
StaticVarSetText(Ticker + "_Brief", Raw, True);
// Flag that stock is in IBD8585
StaticVarSetText(Ticker + "_inIBDNA", "Yes", True);
// Goto Data Line
CL = fgets(file);
// Get Composite Rating
Raw = StrMid(CL, 0, 2);
CR = StrToNum(Raw);
StaticVarSet(Ticker + "_CR", CR, True);
// Get EPS Rating
Raw = StrMid(CL, 18, 2);
EPS = StrToNum(Raw);
StaticVarSet(Ticker + "_EPS", EPS, True);
// Get RS Rating
Raw = StrMid(CL, 26, 2);
RS = StrToNum(Raw);
StaticVarSet(Ticker + "_RS", RS, True);
// Get IGRS Rating
Raw = StrMid(CL, 34, 2);
IGRS = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_IGRS", IGRS, True);
// Get SMR Rating
Raw = StrMid(CL, 49, 2);
SMR = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_SMR", SMR, True);
// Get Acc/Dis Rating
Raw = StrMid(CL, 57, 2);
AD = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_AD", AD, True);
// Get Sponsorship Rating
Raw = StrMid(CL, 66, 2);
Spon = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_Spon", Spon, True);
// Get P/E
Raw = StrMid(CL, 134, 4);
PE = StrToNum(Raw);
StaticVarSet(Ticker + "_PE", PE, True);
// Get Last Quarter Sales
Raw = StrMid(CL, 150, 4);
LQSales = StrToNum(Raw);
StaticVarSet(Ticker + "_LQSales", LQSales, True);
// Get Last Quarter EPS
Raw = StrMid(CL, 162, 4);
LQEPS = StrToNum(Raw);
StaticVarSet(Ticker + "_LQEPS", LQEPS, True);
// Get Consecutive Quarters of +15% EPS
Raw = StrMid(CL, 174, 4);
CQEPS15 = StrToNum(Raw);
StaticVarSet(Ticker + "_CQEPS15", CQEPS15, True);
// Get Current Quarter EPS Estimated Change
Raw = StrMid(CL, 186, 4);
CQEPSEst = StrToNum(Raw);
StaticVarSet(Ticker + "_CQEPSEst", CQEPSEst, True);
// Get Current Year EPS Estimated Change
Raw = StrMid(CL, 198, 4);
CYEPSEst = StrToNum(Raw);
StaticVarSet(Ticker + "_CYEPSEst", CYEPSEst, True);
// Get Pretax Margin
Raw = StrMid(CL, 210, 4);
PTMargin = StrToNum(Raw);
StaticVarSet(Ticker + "_PTMargin", PTMargin, True);
// Get Return on Equity
Raw = StrMid(CL, 218, 4);
ROE = StrToNum(Raw);
StaticVarSet(Ticker + "_ROE", ROE, True);
// Add ticker to watchlist
CategoryAddSymbol(Ticker, categoryWatchlist, IBDNAList);
CategoryAddSymbol(Ticker, categoryWatchlist, IBDMLList);
// go to next ticker
for(j = 0; j < 2; j++)
CL = fgets(file);
if(StrMatch(CL, "*About IBD eTables*"))
loop = False;
}
// Close IBDNA file
fclose(file);
}
//////////////////////////////////////////////////////////////////////////////////////
// IBD Top Stock table list (repeat for as many as possible as you want but don't forget to edit the
// batch file! (or make it a function which is smarter :) )
{
// openfile
file = fopen("path/file", "r");
// Goto date and store for records
for(i = 0; i < 2; i++)
CL = fgets(file);
IBDSTDate = StrMid(CL, 11);
StaticVarSetText("IBDSTUpdateDate", IBDSTDate, True);
// prep file position for loop
for(i = 0; i < 4; i++)
CL = fgets(file);
// Loop to extract data of each IBD Stock Tables stock
loop = True;
while(loop)
{
// Extract ticker
DirtyTicker = StrMid(CL, 26, 6);
// Clean up ticker
char = "";
Ticker = "";
j = 0;
while(char != ")")
{
char = StrMid(DirtyTicker, j++, 1);
if (char != ")")
Ticker = Ticker + char;
}
// Extract Summary
Raw = StrMid(CL, 30);
StaticVarSetText(Ticker + "_Brief", Raw, True);
// Goto Data Line
CL = fgets(file);
// Get Composite Rating
Raw = StrMid(CL, 0, 2);
CR = StrToNum(Raw);
StaticVarSet(Ticker + "_CR", CR, True);
// Get EPS Rating
Raw = StrMid(CL, 18, 2);
EPS = StrToNum(Raw);
StaticVarSet(Ticker + "_EPS", EPS, True);
// Get RS Rating
Raw = StrMid(CL, 26, 2);
RS = StrToNum(Raw);
StaticVarSet(Ticker + "_RS", RS, True);
// Get IGRS Rating
Raw = StrMid(CL, 34, 2);
IGRS = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_IGRS", IGRS, True);
// Get SMR Rating
Raw = StrMid(CL, 49, 2);
SMR = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_SMR", SMR, True);
// Get Acc/Dis Rating
Raw = StrMid(CL, 57, 2);
AD = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_AD", AD, True);
// Get Sponsorship Rating
Raw = StrMid(CL, 66, 2);
Spon = StrTrim(Raw, " ");
StaticVarSetText(Ticker + "_Spon", Spon, True);
// Get P/E
Raw = StrMid(CL, 134, 4);
PE = StrToNum(Raw);
StaticVarSet(Ticker + "_PE", PE, True);
// Get Last Quarter Sales
Raw = StrMid(CL, 150, 4);
LQSales = StrToNum(Raw);
StaticVarSet(Ticker + "_LQSales", LQSales, True);
// Get Last Quarter EPS
Raw = StrMid(CL, 162, 4);
LQEPS = StrToNum(Raw);
StaticVarSet(Ticker + "_LQEPS", LQEPS, True);
// Get Consecutive Quarters of +15% EPS
Raw = StrMid(CL, 174, 4);
CQEPS15 = StrToNum(Raw);
StaticVarSet(Ticker + "_CQEPS15", CQEPS15, True);
// Get Current Quarter EPS Estimated Change
Raw = StrMid(CL, 186, 4);
CQEPSEst = StrToNum(Raw);
StaticVarSet(Ticker + "_CQEPSEst", CQEPSEst, True);
// Get Current Year EPS Estimated Change
Raw = StrMid(CL, 198, 4);
CYEPSEst = StrToNum(Raw);
StaticVarSet(Ticker + "_CYEPSEst", CYEPSEst, True);
// Get Pretax Margin
Raw = StrMid(CL, 210, 4);
PTMargin = StrToNum(Raw);
StaticVarSet(Ticker + "_PTMargin", PTMargin, True);
// Get Return on Equity
Raw = StrMid(CL, 218, 4);
ROE = StrToNum(Raw);
StaticVarSet(Ticker + "_ROE", ROE, True);
// go to next ticker
for(j = 0; j < 2; j++)
CL = fgets(file);
CategoryAddSymbol(Ticker, categoryWatchlist, IBDMLList);
if(StrMatch(CL, "*About IBD eTables*"))
loop = False;
}
// Close ST file
fclose(file);
}
Note that uses a watchlist called IBDMLList. Make sure it exists before hand.
This AFL will make the watchlist empty when run, scrape all the rankings into permanent static vars, then add all found tickers into IBDMLList.
Step 3:
Now I simply run an analysis to get all the data into an easy to use table. It looks for uptrending stocks (Minervini style) and filters low scoring stocks based on IBD Composite rating and trend points assigned. It also adds the columns to the list with all the good stuff. I usually rank them by RS and dump them into another watchlist for review.
// Generate IBD Table
// determine parameters
SMA200 = MA(C, 200);
SMA150 = MA(C, 150);
SMA050 = MA(C, 50);
High52pct = (C/HHV(C, 253)-1)*100;
Low52pct = (C/LLV(C, 253)-1)*100;
SMAV50 = MA(V,50);
RS = StaticVarGet(Name() + "_RS");
CR = StaticVarGet(Name() + "_CR");
// determine trend template status
x1 = iif(C > SMA150 OR IsEmpty(SMA150), 1, 0);
x2 = iif(C > SMA200 OR IsEmpty(SMA200), 1, 0);
x3 = iif(SMA150 > SMA200 OR IsEmpty(SMA200), 1, 0);
x4 = iif(SMA200 > Ref(SMA200, -20) OR IsEmpty(SMA200), 1, 0);
x5 = iif(SMA050 > SMA150 OR IsEmpty(SMA150), 1, 0);
x6 = iif(SMA050 > SMA200 OR IsEmpty(SMA200), 1, 0);
x7 = iif(C > High52pct*0.75, 1, 0);
x8 = iif(C > Low52pct*1.25, 1, 0);
Score = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8;
Filter = Score > 6 AND CR > 93;
AddColumn(C, "Price");
AddColumn((C/Ref(C,-1)-1)*100, "% $ Ch", 1.1);
AddColumn((V/SMAV50-1)*100, "% Vol ch", 1.0);
AddColumn(High52pct, "% 52 WkHigh", 1.1);
AddColumn(CR, "CR", 1);
AddColumn(StaticVarGet(Name() + "_EPS"), "EPS", 1);
AddColumn(RS, "RS", 1);
AddTextColumn(StaticVarGetText(Name() + "_IGRS"), "IndGrp RS", 1);
AddTextColumn(StaticVarGetText(Name() + "_SMR"), "SMR", 1);
AddTextColumn(StaticVarGetText(Name() + "_AD"), "A/D", 1);
AddTextColumn(StaticVarGetText(Name() + "_Spon"), "Spon", 1);
AddColumn(StaticVarGet(Name() + "_PE"), "P/E Ratio", 1);
AddColumn(StaticVarGet(Name() + "_LQEPS"), "Last Qtr EPS %", 1);
AddColumn(StaticVarGet(Name() + "_CQEPS15"), "Consec Qtr EPS>15%", 1);
AddColumn(StaticVarGet(Name() + "_CYEPSEst"), "Curr Yr EPS %", 1);
AddColumn(StaticVarGet(Name() + "_LQSales"), "Last Qtr Sales %", 1);
AddColumn(StaticVarGet(Name() + "_PTMargin"), "Pretax Margin", 1);
AddColumn(StaticVarGet(Name() + "_ROE"), "ROE", 1);
AddColumn(StaticVarGet(Name() + "_IBD50Rank"), "IBD50 Rank", 1);
AddTextColumn(StaticVarGetText(Name() + "_inIBD8585"), "IBD8585", 1);
AddTextColumn(StaticVarGetText(Name() + "_inIBDNA"), "IBD New Am", 1);
AddColumn(Score, "Score", 1.0);
Step 4:
Next is to get the data into the interpretation window. I added these lines into the chart. I want to colorcode them based on value in the future, but was too lazy/busy.
printf(EncodeColor(colorBlack));
printf("Composite Rating: " + StaticVarGet(Name() + "_CR") + "\n");
printf("EPS Rating: " + StaticVarGet(Name() + "_EPS") + "\n");
printf("RS Rating: " + StaticVarGet(Name() + "_RS") + "\n\n");
printf("Ind Grp RS Rating: " + StaticVarGet(Name() + "_IGRS") + "\n\n");
printf("SMR Rating: " + StaticVarGet(Name() + "_SMR") + "\n");
printf("A/D Rating: " + StaticVarGet(Name() + "_AD") + "\n");
printf("Sponsorship Rating: " + StaticVarGet(Name() + "_Spon") + "\n\n");
printf("P/E: " + StaticVarGet(Name() + "_PE") + "\n\n");
printf("Last Qtr EPS Growth: " + StaticVarGet(Name() + "_LQEPS") + "%%\n");
printf("Consecutive 15%%+ EPS Growth: " + StaticVarGet(Name() + "_CQEPS15") + "\n");
printf("Curr Qtr EPS Est Growth: " + StaticVarGet(Name() + "_CQEPSEst") + "%%\n");
printf("Curr Year EPS Est Growth: " + StaticVarGet(Name() + "_CYEPSEst") + "%%\n\n");
printf("Last Qtr Sales Growth: " + StaticVarGet(Name() + "_LQSales") + "%%\n");
printf("Pretax Margin: " + StaticVarGet(Name() + "_PTMargin") + "%%\n");
printf("Return on Equity: " + StaticVarGet(Name() + "_ROE") + "%%\n");
printf("\n");
printf("IBD50 Ranking: " + StaticVarGet(Name() + "_IBD50Rank") + "\n");
printf("IBD 85-85: " + StaticVarGet(Name() + "_inIBD8585") + "\n");
printf("IBD New America: " + StaticVarGet(Name() + "_inIBDNA") + "\n");
Note that since I kept track of whether the stock appears int the IBD50 (and save the rank as a static var), IBD8585, New America, I list this too in the interpretation.
That's basically it! Easy as pie but why reinvent the wheel twice
Here is what it looks like: