GuiButtons: Ticker-based links for IBD

Hello all,

Thought I'd post some useful GUI Buttons I added to my chart. With these buttons, you should be able to access most Stock Lookup Pages and their always superb-looking charts (I still use IBD charts to check the chart of the stock live as I only have EOD data in Amibroker).

Also the reason I say most is that for the Stock Lookup, the market, company name and symbol are all used in the URL, so I depend on the company name in Amibroker being identical to the one used by IBD. For the most part they are, but I have remove and trim some words from the name in Amibroker, as you'll see in the code. So I'm not sure this works on all stocks, but seems to be pretty reliable.

The Stock Lookup page is obviously useful for those who like CANSLIM or mix tech and fundie data into their systems. Note this seems to require either a regular subscription eIBD, but it also works with a simple and cheaper eTables subscription. You can see other ways I exploit eTables in Amibroker, here.

Here's the code I insert into my chart formula:

	// IBD Stock Lookup
	ISLButton = 3;
	
	GuiButton( "IBD Stock Lookup", ISLButton, 110, 20, 100, 20, notifyClicked );
	GuiEnable(ISLButton, True);

	if (GuiGetEvent(0,0) == ISLButton)
	{
		if (MarketID() == 1)
			ISLMkt = "nyse";
		else if (MarketID() == 2)
			ISLMkt = "nasdaq";
		else
			GuiEnable(ISLButton, False);
			
		ISLticker 	= Name();
		ISLComp     = StrReplace(FullName(), "Common", ""  );
		ISLComp     = StrReplace(ISLComp,    "Class" , "Cl");
		ISLComp		= StrReplace(ISLComp,    " ",      "-" );

		ISLURL 		= "https://research.investors.com/stock-checkup/" + ISLMkt + "-" + ISLComp + ISLticker + ".aspx";
		ShellExecute("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", ISLUrl, "C:\\Program Files (x86)\\Google\\Chrome\\Application\\");
	}
	
	// IBD Daily Chart
	IDCButton = 4;
	
	GuiButton( "IBD Daily Chart", IDCButton, 210, 20, 100, 20, notifyClicked );
	GuiEnable(IDCButton, True);

	if (GuiGetEvent(0,0) == IDCButton)
	{
		ISLURL 		= "https://research.investors.com/ibdchartsenlarged.aspx?cht=pvc&type=daily&symbol=" + Name();
		ShellExecute("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", ISLUrl, "C:\\Program Files (x86)\\Google\\Chrome\\Application\\");
	}

Let me know if you see anything wrong! You can also modify the URL, e.g. to get a weekly chart instead, as you wish.

Take care,
Mike

2 Likes

I like this Mike. Quick and handy and I would definitely use it. I do get an error from the IBD website when using the IBD STOCK LOOKUP Gui button but I think it may have to do with the full names in my db. I can see it populate the URL for a split second before the error and for instance, when looking up NTES, I could see that in the URL it had "netease,-inc". I had looked at a few others but still had the same issues but couldnt see the problem like I did on that one. The daily chart GUI worked fine though.

2 Likes

Cool if you can compile a list of tickers that don't work, let me know.

I know a lot of ADR are called ADS between nomenclatures, so those might all be broken.

1 Like