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