Tony,
Well there are two ways that I know
of.
Option 1 - The first option is quite
simple if all you want to do is to display a symbol’s StockConsultant information
when the stock is selected in AmiBroker. Here’s the process:
1) Replace the symbol code in the URL with
{t}. For example, using the URL below, it would be:
http://www.stockconsultant.com/consultnow/basicplus.cgi?ID=sample&symbol={t}&62695#ttop
2) In AB, select the menu item Symbol à Categories à
Markets. Select each market (NYSE, AMEX, etc) and paste the URL
string above into “URLs Profile” box.
3) In AB, select View à Profile.
4) Now, every time you click a symbol in
AB, it brings up the StockConsultant site with the symbol selected.
I do the same thing with a StockCharts
chart set to display 5 days of one-minute data with certain selected
indicators. Works great!
Option 2 - The second way (which is what I
think you want to do) is fairly complex and a bit expensive, but it’s
doable. It involves using a product called Internet Macros.
Option 2a – This is a manual option.
Essentially, you would scan data twice. The first scan would be to get a first-cut
list of symbols. In AB you can add code to your scan that will save symbols
to a text file. You would use this text file as an input list to
download to a product called Internet Macros. You would run
Internet Macros to “screen scrape” the relevant data from StockConsoluntant.com
and save it to a file. Then you would run AmiBroker again to load and use
the data from the text file.
Option 2b - Alternatively, you could use
something like Visual Studio to create a DLL that you would call from an AmiBroker
scan. You would pass a symbol to the DLL. The DLL would then pass
the symbol to Internet Macros. Internet Macros would call up
StockConsultant.com and capture the data. Instead of saving it to a
file, it would be passed back to the DLL. Then the data would be passed
back to AmiBroker which would use it in the scan.
Option 2c - Another possibility would be similar
to the above, but you would Internet Macros from an embedded Java script in a AmiBroker
scan.
There are several problems with the
Internet Macros approach. The biggest is cost. The “cheap”
Pro version of Internet Macros is $199. The Scripting version
(which I have) is $499. The Pro version is pretty manual and allows
you to save data to a file and to run IM macros from the IM interface. The
Scripting version allows you to call it from a DLL or Script. Good
product but pricy.
The big problem with Option 2a or 2b is
that dynamically retrieving data from the web directly to a scan would be
sloooooooow. It’s not the AB scan or the DLL (or script or
whatever). It’s the web. It’s very slow for this
purpose.
It turns out that one of my to-do’s
is to retrieve data from several web sites using Internet Macros.
My approach would be something like Option 2. The only difference
is that I’d probably use a DLL and Internet Macros to download and save
data for a first-cut list of symbols. Then, I’d read the data into
an array in a DLL. Then the AB scan would retrieve data from the
DLL array. This would be much faster. But it is
still complex. So it’s a bit farther down my to-do list.
I hope this helps.
Regards,
Dan.
p.s. Actually, there’s a third
possibility. If you are using Windows XP Pro, you set up your own web
site on your workstation and create an Active Server Page page as your local home
page. In the ASP page you would have several links that you dynamically
change depending on the symbol you passed to it as a parameter. You
would use the “Request.QueryString” function to retrieve the
parameter and dynamically create your links. Then you could access StockConsultant,
StockCharts, IBD or almost any web page.
Below is some of the prototype code that I’ve
created. One problem that I found with this approach is that I
typically go have to needs. Sometimes, I simply want to retrieve the same
web page over and over for multiple symbols. Other times, I want to
examine a stock closely by looking at the same symbol on multiple web
pages. My plan is to set, save and read a cookie that
defaults to the mode I want. This is another to-do that’s on
the back burner for a while.
<h2>Links
for Data:</h2>
<a
href=""
UCase(Request.QueryString("Symbol"))%>&ss=YES">IBD
Stock Checkup</a>
<br><br>
<a href=""
UCase(Request.QueryString("Symbol"))%>,uu[e,a]jaclyiay[d15][pb21!b50!b200!i!f][vc60][iUj[$spx]!Lc21!Lg10]&pref=G">Stock
Charts - 15 Days / 1 Minute Chart</a>
<br>
<a
href=""
UCase(Request.QueryString("Symbol"))%>,uu[e,a]jaclyiay[d5][pb21!b50!b200!i!f][vc60][iUj[$spx]!Lc21!Lg10]&pref=G">Stock
Charts - 5 Days / 1 Minute Chart</a>
<br><br>
<a
href=""
UCase(Request.QueryString("Symbol"))%>&Refer=http://clearstation.etrade.com/cgi-bin/details%3fSymbol%3d<%Response.Write
UCase(Request.QueryString("Symbol"))%>">Clearstation
Fundamentals Profile</a>
<br><br>
<a
href=""
UCase(Request.QueryString("Symbol"))%>">Short
Squeeze</a>
<br><br>
<a
href=""
UCase(Request.QueryString("Symbol"))%>">Insider
Trading</a>
<br><br>
<a
href=""
UCase(Request.QueryString("Symbol"))%>">Institutional
Ownership</a>
<br><br>
<a
href=""
UCase(Request.QueryString("Symbol"))%>&pWidth=400&c=340">Interactive
Brokers - News</a><br>
<br><br>
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Tony Lei
Sent: Thursday, July 14, 2005 7:54
PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Script and
Stockconsultant website
Hi all,
Is there a way to retrieve information from the following website using a
script? Any ideas you would like to suggest as a start? Basically I
would like to add the support and resistance areas that have a rating of 8 - 10
and apply it to my scanner.
http://www.stockconsultant.com/consultnow/basicplus.cgi?ID=sample&symbol=MEE&62695#ttop
Scroll down to detailed chart.
Thanks in advance and it is awesome that I have met a group willing to help
each other out
Tony
qitrader
Please
note that this group is for discussion between users only.
To get support from AmiBroker please send an
e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
---- LSpots keywords ?>---- HM ADS ?>
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
---- LSpots keywords ?>
---- HM ADS ?>
YAHOO! GROUPS LINKS