Overview:

Getstock is a script designed to automate the download of stock symbols from
the CRSO stock door. It ASSUMES that your stock portfolio has already been
configured, that you are compressing your portfolio before downloading, and
that you are using Zmodem as your download protocol. In addition, Icom should
be configured for "Auto Zmodem Receive". With these parameters configured,
you are ready to use getstock.

Getstock has three modes of operation: current, historical, and batch.
Current mode will download the most recent stock data for your portfolio.
Historical mode is used to download stock data for a previous day. Batch mode
is used to download stock data for a number of days, based on information
from an input file. Details for these three modes will be discussed shortly.


Installation:

If you are using the @icom installation script, just select the "Install"
option from the main menu. Otherwise, copy "getstock.scr" and "*.stk" into
your script directory. The documentation isn't copied by the install script
so you'll have to copy it yourself if you want to keep it.


Configuration:

Assuming that you have set up your portfolio profile as discussed above,
getstock only requires one piece of information: the name of the file that
gets downloaded. If you are familiar with the stock door, you already know
that the stock door creates a unique file name for you to download. For
historical data, getstock can rename the downloaded file to the format
YYYYMMDD.ZIP. This simplifies finding data for a particular day if you gather
stock data for a few days before processing.

If you know the name of your download file, you can use the "Configure"
option of the install script to configure getstock. The configure option
will prompt you for the name of the file that gets downloaded. As an example,
I entered "6ecb0b50.zip" without the quotes to configure getstock for my
downloads.

If you don't know the name of your stock download file, just run getstock
in current mode (see below) to grab a sample portfolio. Then run a job
which contains "CC: @getstock configure". This will invoke the configuration
mode for getstock and you will be prompted for the name of the download
file. Note that when in configuration mode, getstock does not perform a
stock download.

That's all the configuration necessary to use getstock. Note that you can run
getstock in any of its modes without configuring it. Getstock just won't
rename the downloaded files.


Modes of Operation:

As described above, getstock has three modes of operation. Each of these is
detailed as follows:

Current Mode - This mode will download the most recent stock data for your
               portfolio. Since the most recent data might not be the current
               day, the downloaded file is not renamed. To run getstock in
               current mode, just call it in your job with no parameters. For
               example: "CC: @getstock".

Historical Mode - When running getstock in historical mode, you need to pass
               it the date of the stock stat that you would like to retrieve.
               This date MUST be in the format YYYY/MM/DD (year/month/day).
               An example call from an Icom job would be:
               "CC: @getstock 1993/11/02". This would download the portfolio
               data for November 2, 1993. This date, by the way, is the
               earliest date available for stock data to be retrieved through
               the stock door. Earlier dates are ignored.

               If getstock has been configured, the downloaded file will be
               renamed to YYYYMMDD.ZIP. For the above example, the stock
               portfolio will be renamed to 19931102.ZIP. This might look
               messy but it simplifies directory listings by sorting stock
               files from oldest to newest.

Batch Mode   - This mode allows you to download stock data for a number of
               days without entering and exiting the stock door after each
               download. This is the only mode I actually use, because I
               prefer to grab my stock data on a weekly basis. In order to
               run getstock in batch mode, you must first create a text file
               that contains the dates for which you want data retrieved.

               Each entry must be in the format YYYY/MM/DD, with one entry
               per line only. You can put comments in the file if you want
               since they get discarded as invalid dates. An example file
               might be:

               1993/11/02
               1993/12/03
               1994/01/04

               This will instruct getstuct to download stock data for November
               2nd 1993, December 3rd 1993, and January 4th 1994.

               After creating the file, copy if to your script directory,
               usually \icom\scr. Then, in your job, you call getstock and
               pass it the name of the data file, preceding with an '@' sign.
               For example, if you have a file called "lastweek.stk", you
               would add the following to your job:

               "CC: @getstock @lastweek.stk"

               The '@' sign preceeding the name of the file you want getstock
               to use is manditory. I have included data files that will
               allow you to download stock data for every business day from
               November 2nd 1993 to April 30th 1994 as part of this package.
               They should get you caught up pretty quick!


Caveits:

When getstock is running in historical or batch mode, it will validate each
date used prior to downloading data from the stock door. It cannot, however,
determine if the date passed was for a trading day. If getstock is run with
with a date for which there is no stock data, it will get stuck in an endless
loop (well, it times out after 10 minutes). This is easy to overcome if you
check the stock door for valid dates prior to runing the script in batch
mode.

However, I have noticed an annoying bug in the stock door that will cause
major grief, even if you know that stock data exists for a particular day.
If today is May 1st, for example, all historical data for Apr 1, Mar 1, Feb 1
and so on won't be available from the door. And yet they'll all be there on
May 2nd (you'll all data for the second day of each month in that case). This
means that any batch data files (including mine) that you create may work
one day but crash on another. Really annoying!!!

Also, don't try running this script with any version of Icom before 2.01B6.
It won't work!


Payment Options:

As a lot of work went into this script, please send me:

A) A billion dollars
B) Your winning Lotto 6/49 ticket
C) 10,000 shares of Newbridge stock
D) One beer truck (full)
E) Your tax refund (ha, ha, ha, ha...)
F) Canadian Tire money
G) Monopoly money

Oh forget it! It's yet another FREE script.

Enjoy!

P.S. Please send any comments, criticisms, enhancements to:

Internet/Usenet:   michael.livsey@canrem.com
FidoNet:           1:229/15
RIME/RelayNet:     ->CRS
