This is Info file pm.info, produced by Makeinfo version 1.68 from the
input file bigpm.texi.


File: pm.info,  Node: Finance/Quote/ASX,  Next: Finance/Quote/DWS,  Prev: Finance/Quote,  Up: Module List

Obtain quotes from the Australian Stock Exchange.
*************************************************

NAME
====

   Finance::Quote::ASX	- Obtain quotes from the Australian Stock Exchange.

SYNOPSIS
========

     use Finance::Quote;

     $q = Finance::Quote->new;

     %stockinfo = $q->fetch("asx","BHP");	   # Only query ASX.
     %stockinfo = $q->fetch("australia","BHP"); # Failover to other sources OK.

DESCRIPTION
===========

   This module obtains information from the Australian Stock Exchange
http://www.asx.com.au/.  All Australian stocks and indicies are available.
Indexes start with the letter 'X'.  For example, the All Ordinaries is
"XAO".

   This module is loaded by default on a Finance::Quote object.  It's also
possible to load it explicity by placing "ASX" in the argument list to
Finance::Quote->new().

   This module provides both the "asx" and "australia" fetch methods.
Please use the "australia" fetch method if you wish to have failover with
other sources for Australian stocks (such as Yahoo).  Using the "asx"
method will guarantee that your information only comes from the Australian
Stock Exchange.

   Information returned by this module is governed by the Australian Stock
Exchange's terms and conditions.

LABELS RETURNED
===============

   The following labels may be returned by Finance::Quote::ASX: date, bid,
ask, open, high, low, last, close, p_change, volume, and price.

SEE ALSO
========

   Australian Stock Exchange, http://www.asx.com.au/

   Finance::Quote::Yahoo::Australia.


File: pm.info,  Node: Finance/Quote/DWS,  Next: Finance/Quote/Fidelity,  Prev: Finance/Quote/ASX,  Up: Module List

Obtain quotes from DWS (Deutsche Bank Gruppe).
**********************************************

NAME
====

   Finance::Quote::DWS	- Obtain quotes from DWS (Deutsche Bank Gruppe).

SYNOPSIS
========

     use Finance::Quote;

     $q = Finance::Quote->new;

     %stockinfo = $q->fetch("dwsfunds","847402");

DESCRIPTION
===========

   This module obtains information about DWS managed funds.

   Information returned by this module is governed by DWS's terms and
conditions.

LABELS RETURNED
===============

   The following labels may be returned by Finance::Quote::DWS: exchange,
name, date, price, last.

SEE ALSO
========

   DWS (Deutsche Bank Gruppe), http://www.dws.de/


File: pm.info,  Node: Finance/Quote/Fidelity,  Next: Finance/Quote/Tiaacref,  Prev: Finance/Quote/DWS,  Up: Module List

Obtain information from Fidelity Investments.
*********************************************

NAME
====

   Finance::Quote::Fidelity - Obtain information from Fidelity Investments.

SYNOPSIS
========

     use Finance::Quote;

     $q = Finance::Quote->new;

     %info = Finance::Quote->fetch("fidelity","FBGRX");
     %info = Finance::Quote->fetch("fidelity_direct","FBGRX");

DESCRIPTION
===========

   This module obtains information from Fidelity Investments,
http://www.fidelity.com/.  This module is loaded by default on the
Finance::Quote object.  It is also possible to load this module explicitly
by passing "Fidelity" as one of Finance::Quote->new()'s parameters.

   The "fidelity" fetch method may make use of failover modules.  The
"fidelity_direct" method will only obtain information directly from
Fidelity.

   Information returned by this module is governed by Fidelity
Investment's terms and conditions.

LABELS RETURNED
===============

   The following labels may be returned by Finance::Quote::Fidelity:
exchange, name, number, nav, change, ask, date, yield, price.

SEE ALSO
========

   Fidelity Investments, http://www.fidelity.com/

   Finance::Quote::Yahoo::USA;


File: pm.info,  Node: Finance/Quote/Tiaacref,  Next: Finance/Quote/Troweprice,  Prev: Finance/Quote/Fidelity,  Up: Module List

Obtain quote from TIAA-CREF.
****************************

NAME
====

   Finance::Quote::Tiaacref	- Obtain quote from TIAA-CREF.

SYNOPSIS
========

     use Finance::Quote;

     $q = Finance::Quote->new;

     %stockinfo = $q->fetch("tiaacref","TIAAreal");

DESCRIPTION
===========

   This module obtains information about TIAA-CREF managed funds.

   The following symbols can be used:

     Stock: 			CREFstok
     Money Market:		CREFmony
     Equity Index:		CREFequi
     Inf-Linked Bond:		CREFinfb
     Bond Market:		CREFbond
     Social Choice:		CREFsoci
     Global Equities:		CREFglob
     Growth:			CREFgrow
     TIAA Real Estate:		TIAAreal
     PA Stock Index:		TIAAsndx
     PA Select Stock:		TIAAsele

   This module is loaded by default on a Finance::Quote object.  It's also
possible to load it explicitly by passing "Tiaacref" in to the argument
argument list of Finance::Quote->new().

   Information returned by this module is governed by TIAA-CREF's terms
and conditions.

LABELS RETURNED
===============

   The following labels may be returned by Finance::Quote::Tiaacref:
symbol, exchange, name, date, nav, price.

SEE ALSO
========

   TIAA-CREF, http://www.tiaa-cref.org/


File: pm.info,  Node: Finance/Quote/Troweprice,  Next: Finance/Quote/Trustnet,  Prev: Finance/Quote/Tiaacref,  Up: Module List

Obtain quotes from T. Rowe Price
********************************

NAME
====

   Finance::Quote::Troweprice	- Obtain quotes from T. Rowe Price

SYNOPSIS
========

     use Finance::Quote;

     $q = Finance::Quote->new;

     %stockinfo = $q->fetch("troweprice","PRFDX"); # Can failover to other methods
     %stockinfo = $q->fetch("troweprice_direct","PRFDX"); # Use this module only.

DESCRIPTION
===========

   This module obtains information about managed funds from T. Rowe Price.
Information about T. Rowe Price funds is available from a variety of
sources.  The information source "troweprice" can be used if you don't
care which source you obtain information from.  If you wish to be
guaranteed of fetching information from T. Rowe Price directly, then the
information source "troweprice_direct" should be used.

LABELS RETURNED
===============

   Information available from T. Rowe Price may include the following
labels:  exchange, name, nav, date, price.

SEE ALSO
========

   T. Rowe Price website - http://www.troweprice.com/

   Finance::Quote::Yahoo::USA


File: pm.info,  Node: Finance/Quote/Trustnet,  Next: Finance/Quote/VWD,  Prev: Finance/Quote/Troweprice,  Up: Module List

Obtain unit trust prices from trustnet.co.uk
********************************************

NAME
====

   Finance::Quote::Trustnet	- Obtain unit trust prices from
trustnet.co.uk

SYNOPSIS
========

     use Finance::Quote;

     $q = Finance::Quote->new;

     %stockinfo = $q->fetch("unit_trusts","trust-name"); # Can failover to other methods
     %stockinfo = $q->fetch("trustnex","trust-name"); # Use this module only.

DESCRIPTION
===========

   This module obtains information about UK unit trust prices from
www.trustnet.co.uk.  The information source "unit_trusts" can be used if
the source of prices is irrelevant, and "trustnet" if you specifically
want to use trustnet.co.uk.

UNIT TRUST NAMES
================

   Unfortunately there is no unique identifier for unit trust names.
Therefore enough of the name should be given including spaces to yield a
unique match.  Trustnet sometimes uses abbreviated names, and the string
given should match the abbreviation.

   Consult http://www.trustnet.co.uk/ut/funds/perf.asp?sort=0 to find a
match for your unit trusts.

   Example "jupiter income"

LABELS RETURNED
===============

   Information available from Trustnet may include the following labels:
exchange method source name currency bid ask yield price.  In case of a
unit trust, "price" returns the offer (ask) price.  In case of an OIEC,
the unique price is returned in "bid", "ask" and "price".

SEE ALSO
========

   Trustnet website - http://www.trustnet.co.uk/

   Finance::Quote::Yahoo::USA


File: pm.info,  Node: Finance/Quote/VWD,  Next: Finance/Quote/Yahoo/Australia,  Prev: Finance/Quote/Trustnet,  Up: Module List

Obtain quotes from vwd Vereinigte Wirtschaftsdienste GmbH.
**********************************************************

NAME
====

   Finance::Quote::vwd	- Obtain quotes from vwd Vereinigte
Wirtschaftsdienste GmbH.

SYNOPSIS
========

     use Finance::Quote;

     $q = Finance::Quote->new;

     %stockinfo = $q->fetch("vwd","847402");

DESCRIPTION
===========

   This module obtains information from vwd Vereinigte Wirtschaftsdienste
GmbH http://www.vwd.de/. Many european stocks and funds are available, but
at the moment only funds are supported.

   Information returned by this module is governed by vwd's terms and
conditions.

LABELS RETURNED
===============

   The following labels may be returned by Finance::Quote::vwd: exchange,
name, date, price, last.

SEE ALSO
========

   vwd Vereinigte Wirtschaftsdienste GmbH, http://www.vwd.de/


File: pm.info,  Node: Finance/Quote/Yahoo/Australia,  Next: Finance/Quote/Yahoo/Base,  Prev: Finance/Quote/VWD,  Up: Module List

Fetch Australian stock quotes via Yahoo.
****************************************

NAME
====

   Finance::Quote::Yahoo::Australia - Fetch Australian stock quotes via
Yahoo.

SYNOPSIS
========

     use Finance::Quote;
     my $q = Finance::Quote->new;

     my %info = $q->fetch("yahoo_australia","BHP"); # Use this module only.
     my %info = $q->fetch("australia","BHP"); # Failover with other methods.

DESCRIPTION
===========

   This module allows information to be fetched from Yahoo abouts stocks
traded on the Australian Stock Exchange.  Information about indexes (such
as the All Ordinaries) are not available through this module, although if
information is requested from the "australia" source then these will
automatically failover to direct queries from the Australian Stock
Exchange.

   This module is loaded by default on a Finance::Quote object, although
it can be explicitly loaded by passing the argument "Yahoo::Australia" to
Finance::Quote->new().

   This module provides both the "australia" and "yahoo_australia" fetch
methods.  You should use the "australia" method if you wish to allow
failovers to other sources, and "yahoo_australia" if you only want to
obtain quotes from this module.

   Information obtained via this module is governed by Yahoo's terms and
conditions, see http://au.finance.yahoo.com/ for more details.

LABELS RETURNED
===============

   This module returns all the standard labels (where available) provided
by Yahoo, as well as the currency label.  See Finance::Quote::Yahoo::Base
for more information.

SEE ALSO
========

   Yahoo Australia, http://au.finance.yahoo.com/

   Finance::Quote::Yahoo::Base


File: pm.info,  Node: Finance/Quote/Yahoo/Base,  Next: Finance/Quote/Yahoo/Europe,  Prev: Finance/Quote/Yahoo/Australia,  Up: Module List

Common functions for fetching Yahoo info.
*****************************************

NAME
====

   Finance::Quote::Yahoo::Base - Common functions for fetching Yahoo info.

SYNOPSIS
========

   Base functions for use by the Finance::Quote::Yahoo::* modules.

DESCRIPTION
===========

   This module is not called directly, rather it provides a set of base
functions which other Yahoo-related modules can use.  If you're thinking
of writing a module to fetch specific information from Yahoo, then you
might wish to look through the source code for this module.

LABELS RETURNED
===============

   Most Yahoo functions will return a standard set of labels.  These
include (where available): symbol, name, last, date, time, net, p_change,
volume, bid, ask close, open, day_range, year_range, eps, pe, div_date,
div, div_yield, cap, ex_div, avg_vol.

SEE ALSO
========

   Finance::Quote::Yahoo::Australia, Finance::Quote::Yahoo::USA,
Finance::Quote::Yahoo::Europe.


File: pm.info,  Node: Finance/Quote/Yahoo/Europe,  Next: Finance/Quote/Yahoo/USA,  Prev: Finance/Quote/Yahoo/Base,  Up: Module List

Fetch quotes from Yahoo Europe
******************************

NAME
====

   Finance::Quote::Yahoo::Europe - Fetch quotes from Yahoo Europe

SYNOPSIS
========

     use Finance::Quote;
     $q = Finance::Quote->new;

     %info = $q->fetch("europe","12150.PA"); # Failover to other methods ok.
     %info = $q->fetch("yahoo_europe","12150.PA"); # Use this module only.

DESCRIPTION
===========

   This module fetches information from Yahoo Europe.  Symbols should be
provided in the format "SYMBOL.EXCHANGE", where the exchange code is one
of the following:

     PA - Paris
     BC - Barcelona
     BE - Berlin
     BI - Bilbao
     BR - Breme
     CO - Copenhagen
     D  - Dusseldorf
     F  - Frankfurt
     H  - Hamburg
     HA - Hanover
     L  - London
     MA - Madrid
     MC - Madrid (M.C.)
     MI - Milan
     MU - Munich
     O  - Oslo
     ST - Stockholm
     SG - Stuttgart
     VA - Valence
     DE - Xetra (was FX)

   This module provides both the "europe" and "yahoo_europe" methods.  The
"europe" method should be used if failover methods are desirable.  The
"yahoo_europe" method should be used you desire to only fetch information
from Yahoo Europe.

   This module is loaded by default by Finance::Quote, but can be loaded
explicitly by specifying the parameter "Yahoo::Europe" to
Finance::Quote->new().

   Information obtained by this module may be covered by Yahoo's terms and
conditions.  See http://finance.uk.yahoo.com/ for more details.

LABELS RETURNED
===============

   This module returns all the standard labels (where available) provided
by Yahoo.  See Finance::Quote::Yahoo::Base for a list of these.  The
currency label is also returned.

SEE ALSO
========

   Yahoo Europe, http://finance.uk.yahoo.com/


File: pm.info,  Node: Finance/Quote/Yahoo/USA,  Next: Finance/QuoteHist,  Prev: Finance/Quote/Yahoo/Europe,  Up: Module List

Obtain information about stocks and funds in the USA and Canada.
****************************************************************

NAME
====

   Finance::Quote::Yahoo::USA - Obtain information about stocks and funds
in the USA and Canada.

SYNOPSIS
========

     use Finance::Quote;

     $q = Finance::Quote->new;

     %info = $q->fetch("usa","SGI");

DESCRIPTION
===========

   This method provides access to financial information from a number of
exhcanges in the United States and Canada.  The following methods are
available:

     canada
     usa
     yahoo
     nyse
     nasdaq
     vanguard
     fidelity

   These methods all use the same information source, and hence can be
considered somewhat interchangable.  However, the method "yahoo" should be
passed to fetch if you wish to obtain information from any source that
Yahoo tracks.

   This method is loaded by default by Finance::Quote, although it can be
explicitly loaded by passing the argument "Yahoo::USA" to
Finance::Quote->new().

   Information returned by this module may be subject to Yahoo's terms and
conditions.  See http://finance.yahoo.com/ for more information.

LABELS RETURNED
===============

   This module returns all the standard labels that Yahoo provides, as
well as the currency label.  See Finance::Quote::Yahoo::Base for more
information.

BUGS
====

   Yahoo does not make a distinction between the various exchanges in the
United States and Canada.  For example, it is possible to request a stock
using the "NYSE" method and still obtain data even if that stock does not
exist on the NYSE but exists on a different exchange.

SEE ALSO
========

   Yahoo Finance, http://finance.yahoo.com/

   Finance::Quote::Base


File: pm.info,  Node: Finance/QuoteHist,  Next: Finance/QuoteHist/FinancialWeb,  Prev: Finance/Quote/Yahoo/USA,  Up: Module List

Perl module for fetching historical stock quotes.
*************************************************

NAME
====

   Finance::QuoteHist - Perl module for fetching historical stock quotes.

SYNOPSIS
========

     use Finance::QuoteHist;
     $q = new Finance::QuoteHist
        (
         symbols    => [qw(IBM UPS AMZN)],
         start_date => '01/01/1999',
         end_date   => 'today',
        );

     # Adjusted values
     foreach $row ($q->quote_get()) {
       ($symbol, $date, $open, $high, $low, $close, $volume) = @$row;
       ...
     }

     # Non adjusted values
     $q->adjusted(0);
     foreach $row ($q->quotes()) {
        ($symbol, $date, $open, $high, $low, $close, $volume, $adj_close) = @$row;
     }

     # Splits
     foreach $row ($q->splits()) {
        ($symbol, $date, $post, $pre) = @$row;
     }

     # Dividends
     foreach $row ($q->dividends()) {
        ($symbol, $date, $dividend) = @$row;
     }

     # Culprit
     $fetch_class = $q->quote_source('IBM');

DESCRIPTION
===========

   Finance::QuoteHist is a top level interface for fetching historical
stock quotes from the web.

   It is actually a front end to modules based on
Finance::QuoteHist::Generic, the main difference being that it has a
default lineup of web sites from which to attempt quote retrieval.

   Unless otherwise defined via the lineup attribute, this module will
select a lineup for you, the default being:

     Finance::QutoeHist::Yahoo
     Finance::QuoteHist::MotleyFool
     Finance::QuoteHist::FinancialWeb

   Once instantiated, this module behaves identically to the first module
in the lineup, sharing all of that module's methods.

   Most queries will likely be handled by the first module in the lineup.
If the site is down for some reason, or perhaps that site does not provide
quotes for defunct ticker symbols, then the other sites in the lineup will
be attempted.

   See `Finance::QuoteHist::Generic(3)' in this node for gory details on
all of the parameters and methods this module accepts. The basic interface
is noted below.

METHODS
=======

   The basic user interface consists of several methods, as seen in the
example above. Those methods are:

quotes()
     Returns a list of rows (or a reference to an array containing those
     rows, if in scalar context). Each row contains the Symbol, Date,
     Open, *High*, Low, Close, and Volume for that date. Optionally, if
     non-adjusted values were requested, their will be an extra element at
     the end of the row for the *Adjusted* closing price.

dividends()
     Returns a list of rows (or a reference to an array containing those
     rows, if in scalar context). Each row contains the Date and amount of
     the *Dividend*, in that order.

splits()
     Returns a list of rows (or a reference to an array containing those
     rows, if in scalar context). Each row contains the Date, *Post* split
     shares, and *Pre* split shares, in that order.

quote_source($ticker)
dividend_source($ticker)
split_source($ticker)
     Each of these methods displays which site-specific class actually
     retrieved the information, if any, for a particular ticker symbol.

adjusted($boolean)
     Sets whether adjusted or non-adjusted quotes are desired. Quotes are
     pre-adjusted by default.

DISCLAIMER
==========

   The data returned from these modules is in no way guaranteed, nor are
the developers responsible in any way for how this data (or lack thereof)
is used. The interface is based on URLs and page layouts that might change
at any time. Even though these modules are designed to be adaptive under
these circumstances, they will at some point probably be unable to
retrieve data unless fixed or provided with new parameters. Furthermore,
the data from these web sites is usually not even guaranteed by the web
sites themselves, and oftentimes is acquired elsewhere. See the
documentation for each site-specific module for more information regarding
the disclaimer for that site.

AUTHOR
======

   Matthew P. Sisk, <`sisk@mojotoad.com'>

COPYRIGHT
=========

   Copyright (c) 2000 Matthew P. Sisk. All rights reserved. All wrongs
revenged. This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

SEE ALSO
========

   Finance::QuoteHist::Generic(3), Finance::QuoteHist::Yahoo(3),
Finance::QuoteHist::MotleyFool(3), Finance::QuoteHist::FinancialWeb(3),
perl(1).


File: pm.info,  Node: Finance/QuoteHist/FinancialWeb,  Next: Finance/QuoteHist/Generic,  Prev: Finance/QuoteHist,  Up: Module List

Site-specific class for retrieving historical stock quotes.
***********************************************************

NAME
====

   Finance::QuoteHist::FinancialWeb - Site-specific class for retrieving
historical stock quotes.

SYNOPSIS
========

     use Finance::QuoteHist::FinancialWeb;
     $q = new Finance::QuoteHist::FinancialWeb
        (
         symbols    => [qw(IBM UPS AMZN)],
         start_date => '01/01/1999',
         end_date   => 'today',
        );

     foreach $row ($q->quotes()) {
       ($symbol, $date, $open, $high, $low, $close, $volume) = @$row;
       ...
     }

DESCRIPTION
===========

   Finance::QuoteHist::FinancialWeb is a subclass of
Finance::QuoteHist::Generic, specifically tailored to read historical
quotes from the FinancialWeb web site (*http://www.financialweb.com*).
FinancialWeb does not offer information regarding dividends or splits.

   For quote queries, at the time of this writing, the Financial web site
utilizes only start dates, and returns a years worth of data if available.
The quote_urls() method provides all the URLs necessary given the date
range. These are automatically utilized by the native methods of
Finance::QuoteHist::Generic.

   Please see `Finance::QuoteHist::Generic(3)' in this node for more
details on usage and available methods. If you just want to get historical
quotes and are not interested in the details of how it is done, check out
`Finance::QuoteHist(3)' in this node.

METHODS
=======

   The basic user interface consists of a single method, as shown in the
example above. That method is:

quotes()
     Returns a list of rows (or a reference to an array containing those
     rows, if in scalar context). Each row contains the Symbol, Date,
     Open, *High*, Low, Close, and Volume for that date. Quote values are
     pre-adjusted for this site.

REQUIRES
========

   Finance::QuoteHist::Generic

DISCLAIMER
==========

   The data returned from these modules is in no way guaranteed, nor are
the developers responsible in any way for how this data (or lack thereof)
is used. The interface is based on URLs and page layouts that might change
at any time. Even though these modules are designed to be adaptive under
these circumstances, they will at some point probably be unable to
retrieve data unless fixed or provided with new parameters. Furthermore,
the data from these web sites is usually not even guaranteed by the web
sites themselves, and oftentimes is acquired elsewhere.

   In the case of FinancialWeb, as of September 13, 2000, their statment
reads, in part:

     This data may be used for PERSONAL USE ONLY. Any
     redistribution of this data, including publishing it
     in whole or in part, or publishing any calculations
     derived from it, on the internet I<(sic)> or in any
     other public forum, is illegal.

   There you have it. If you feel like you might have concerns with this
then first double check the statement on their web site:

     http://www.financialweb.com/

   If you still have concerns, then use another site-specific historical
quote instance, or none at all.

   Above all, play nice.

AUTHOR
======

   Matthew P. Sisk, <`sisk@mojotoad.com'>

COPYRIGHT
=========

   Copyright (c) 2000 Matthew P. Sisk. All rights reserved. All wrongs
revenged. This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

SEE ALSO
========

   Finance::QuoteHist::Generic(3), Finance::QuoteHist(3), perl(1).


File: pm.info,  Node: Finance/QuoteHist/Generic,  Next: Finance/QuoteHist/MotleyFool,  Prev: Finance/QuoteHist/FinancialWeb,  Up: Module List

Base class for retrieving historical stock quotes.
**************************************************

NAME
====

   Finance::QuoteHist::Generic - Base class for retrieving historical
stock quotes.

SYNOPSIS
========

     package Finance::QuoteHist::MyFavoriteSite;
     use strict;
     use vars qw(@ISA);
     use Finance::QuoteHist::Generic;
     @ISA = qw(Finance::QuoteHist::Generic);

     sub quote_urls {
       # This method should return the set of URLs necessary to extract
       # the quotes from this particular site given the list of symbols
       # and date range provided during instantiation. See
       # Finance::QuoteHist::MotleyFool for a basic example of how to do
       # this, or Finance::QuoteHist::Yahoo for a more complicated
       # example.
     }

DESCRIPTION
===========

   This is the base class for retrieving historical stock quotes. It is
built around LWP::UserAgent, and by default it expects the returned data
to be in HTML format, in which case the quotes are gathered using
HTML::TableExtract. Support for CSV (Comma Separated Value) data is
included as well.

   In order to actually retrieve historical stock quotes, this class
should be subclassed and tailored to a particular web site.  In
particular, the quote_urls() method should be overridden, and provide
however many URLs are necessary to retrieve the data over a list of
symbols within the given date range.  Different sites have different
limitations on how many quotes are returned for each query. See
Finance::QuoteHist::MotleyFool, Finance::QuoteHist::FinancialWeb, and
Finance::QuoteHist::Yahoo for some examples of how to do this.

   For more complicated sites, such as Yahoo, more methods are available
for overriding that deal with things such as splits and dividends.

METHODS
=======

new()
     Returns a new Finance::QuoteHist::Generic object.  Valid attributes
     are:

    start_date
    end_date
          Specify the date range from which you would like historical
          quotes.  These dates get parsed by the `ParseDate()' method in
          Date::Manip, so see `Date::Manip(3)' in this node for more
          information on valid date strings.  They are quite flexible, and
          include such strings as '1 year ago'. Date boundaries can also
          be dynamically set with methods of the same name.

    symbols
          Indicates which ticker symbols to include in the search for
          historical quotes. Passed either as a string (for single ticker)
          or an array ref for multiple tickers.

    reverse
          Indicates whether each batch of rows from each URL provided in
          quote_urls() should be reversed from top to bottom.  Some sites
          present historical quotes with the newest quotes on the top.
          Since the rows from each URL are eventually catenated, if the
          overall order of your rows is important you might want to pay
          attention to this flag. If the overall order is not that
          important, then ignore this flag. Typically, site-specific sub
          classes of this module will take care of setting this
          appropriately. The default is 0.

    attempts
          Sets how persistently the module tries to retrieve the quotes.
          There are two places this will manifest. First, if there are
          what appear to be network errors, this many network connections
          are attempted for that URL. Secondly, for quotes only, if a
          document was successfully retrieved, but it contained no quotes,
          this number of attempts are made to retrieve a document with
          data. Sometimes sites will report a temporary internal error via
          HTML, and if it is truly transitory this will usually get around
          it. The default is 3.

    lineup
          Passed as an array reference (or scalar for single site), this
          list indicates which Finance::QuoteHist::Generic sub classes
          should be invoked in the event this class fails in its attempt
          to retrieve historical quotes. In the event of failure, the
          first class in this list is invoked with the same parameters as
          the original class, and the remaining classes are passed as the
          lineup to the new class. This sets up a daisy chain of
          redundancy in the event a particular site is hosed. See
          `Finance::QuoteHist(3)' in this node to see an example of how
          this is done in a top level invocation of these modules. This
          list is empty by default.

    quote_precision
          Sets the number of decimal places to which quote values are
          rounded. This might be of particular significance if there is
          auto-adjustment taking place (which is only under particular
          circumstances currently...see *Note Finance/QuoteHist/Yahoo:
          Finance/QuoteHist/Yahoo,). Setting this to 0 will disable the
          rounding behavior, returning the quote values as they appear on
          the sites (assuming no auto-adjustment has taken place). The
          default is 4.

    verbose
          When set, many status messages are printed to STDERR indicating
          progression through URLs and lineup invocations.

    quiet
          When set, certain failure messages are suppressed from appearing
          on STDERR. These messages would normally appear regardless the
          setting of the verbose flag.

   The following methods are the primary user interface methods; methods
of interest to developers wishing to make their own site-specific instance
of this module will find information on overriding methods further below.

quotes()
     Retrieves historical quotes for all provided symbols over the
     specified date range. Depending on context, returns either a list of
     rows or an array reference to the same list of rows.

dividends()
splits()
     If available, retrieves dividend or split information for all provided
     symbols over the specified date range. If there are no site-specific
     subclassed modules in the lineup capable of getting dividends or
     splits, the user will be notified on STDERR unless the quiet flag was
     requested during object creation.

start_date(date_string)
end_date(date_string)
     Set the date boundaries of all queries. The date_string is
     interpreted by the Date::Manip module.

clear_cache()
     When results are gathered for a particular date range, whether they be
     via direct query or incidental extraction, they are cached. This cache
     is cleared by invoking this method directly, by resetting the boundary
     dates of the query, or by changing the `adjusted()' setting.

quote_source(ticker_symbol)
dividend_source(ticker_symbol)
split_source(ticker_symbol)
     After query, these methods can be used to find out which particular
     subclass in the lineup fulfilled the corresponding request.

   The following methods are the primary methods of interest for
developers wishing to make a site-specific subclass. For simple quote
retrievals, the quote_urls() method is typically all that is necessary.
For splits, dividends, and more complicated data parsing conditions beyond
HTML tables, the other methods could be of interest (see the
Finance::QuoteHist::Yahoo module as an example of the more complicated
behavior). If a new target type is ever defined in addition to quote,
split, and *dividend*, then corresponding methods (`TARGET_urls()',
`TARGET_get()', `TARGET_symbols()') should be provided when appropriate.

quote_urls()
     When a site supports historical stock quote queries, this method
     should return the list of URLs necessary to retrieve all historical
     quotes from a particular site for the symbols and date ranges
     provided.

dividend_urls()
     If a site supports direct dividend queries, this method should provide
     the list of URLs necessary for the symbol and date range involved.
     Currently this is only implemented by the Yahoo subclass.

split_urls()
     If a site supports direct split queries, this method should provide
     the list of URLs necessary. Currently no sites support this type of
     query (splits are gathered from the regular quote output from Yahoo).

quote_get()
dividend_get()
split_get()
     All three of these methods invoke `target_get()' with the relevant
     target information. The analogous methods, quotes(), dividends(), and
     splits(), should automatically take care of finding these based on
     the presence of the corresponding `TARGET_urls()' method. If the
     `TARGET_urls()' method is not available, then they will look for ways
     to utilize the `TARGET_extract()' method.

split_extract()
dividend_extract()
     These extraction methods are not provided by default. When present in
     a site-specific subclass, they are invoked on a per-row basis during
     direct (i.e., via URLs provided by a `TARGET_urls()' method) queries
     of other target types; it is passed an array reference representing a
     table row, and should return another array reference representing
     successfully extracted dividend/split information. When a successful
     extraction occurs, that row is filtered from the target query
     results. See the Yahoo subclass for an example of its use.
     Theoretically there could be a `quote_extract()' method as well, but
     it is redundant at this point and therefore never used.

adjusted($boolean)
     Return or set whether results should be returned as adjusted or
     non-adjusted values. *Adjusted* means that the quotes have been
     retroactively adjusted in terms of the current share price, such as
     for splits. The sites represented so far by site-specific subclassing
     all offer pre-adjusted data by default, and most offer nothing else.
     One significant exception is Yahoo, which provides non-adjusted
     quotes in HTML, but adjusted for CSV, the default mode of transmission
     for the Yahoo module. Pre-adjusted quote values can be requested from
     capable sites by providing a true value to this method. By default,
     adjusted values are always returned.

     If non-adjusted values have been requested, and a site in the lineup
     that does not provide non-adjusted values ends up fulfilling the
     request, a warning is issued to STDERR (unless quiet was specified as
     a parameter to new()). Currently, Yahoo is the only supported site
     that provides non-adjusted values, but they have to be specifically
     requested.

     There are a couple of points to note that could be significant;
     QuoteHist will automatically notice if a quote source has an "Adj"
     column - one that represents an adjusted closing value. If present,
     all other values, including volume, will be adjusted based on the
     ratio of the represented closing value and the adjusted value. This
     might actually occur with the Yahoo module if, for example, you
     request splits() before you request quotes(). The split data is only
     available in HTML mode; QuoteHist caches initial queries and will
     gather the quote information represented in the HTML. It will notice
     the adjusted close column, and automatically normalize the rest of the
     quote information. If non-adjusted data is desired, you must pass 0 to
     this method. The justification for this is that there will be a common
     expectation for quote data returned from different sites in the
     lineup, even if there are small deviations due to things such as
     Yahoo adjusting for *dividends* as well as splits, so there could be
     slight variations across sites.

ua()
     Accessor method for the LWP::UserAgent object used to process
     HTTP::Request for individual URLs.

   Most of the methods below are utilized during a call to `target_get()'.
Average subclasses will probably have little need of them, but they are
included here just in case.

target_get($target)
     Returns an array reference to the rows that result from a particular
     TARGET query; this is where the network transaction and data
     extraction take place. It will gather the results from each URL
     provided in the corresponding TARGET_urls() method, perform the
     primary and secondary data extraction, and return the catenated
     results as a list. For example, the quote_get() method will call this
     method with 'quote' as the TARGET; during its execution, the methods
     quote_urls() and `quote_labels()' will be invoked to tailor the
     quote-specific retrieval and extraction.

fetch($mode, $url, @new_request_args)
     Returns the web page located at `$url', using request method $mode
     (i.e., GET or POST). The `@new_request_args' list gets passed as
     arguments to the HTTP::Request::new method that handles the request at
     the behest of the LWP::UserAgent accessible via the ua() method.

method
     Returns the method under which HTTP::Request objects are created for
     use by the LWP::UserAgent. By default, this returns 'GET'.

has_non_adjusted($boolean)
     Indicator method that specifies whether a particular site subclass is
     capable of providing non-adjusted quote values. This is assumed to be
     false by default; Yahoo is a significant exception.

rows($data_string)
     Given an data string, returns the extracted rows as either an array or
     array reference, depending on context. The data string is parsed based
     on the type of parser registered for the data type; currently this is
     either HTML via HTML::TableExtract, or CSV using an internal parser.
     If parsing HTML, the corresponding target labels are passed along to
     the HTML::TableExtract class. Rows falling outside of the date range
     specified for the object are discarded.

parse_method($mode, $parse_sub)
     Retrieve or set the reference or name of the parsing routine for the
     specified TARGET. Currently parse methods are registered by default
     for the 'html' and 'csv' modes.

parse_mode($mode)
     Retrieve or set the current parse mode.

html_table_parser($data_string, @column_labels)
     HTML table parser routine registered by default. `column_labels' are
     optional, and will default to the labels provided by the
     `TARGET_labels()' method, where TARGET is the current target mode.

csv_parser($data_string, @column_labels)
     CSV parser routine registered by default. `column_labels' are
     optional, but when present represent the labels that might appear in
     the beginning of the CSV data. They are reordered based on the
     default `column_labels' specified for HTML output.

date_in_range($date)
     Given a date string, test whether it is within the range specified by
     the current start_date and end_date.

dates($start_date, $end_date)
     Returns a list of business days between and including the provided
     boundary dates. If no arguments are provided, start_date and end_date
     default to the currently specified date range.

DISCLAIMER
==========

   The data returned from these modules is in no way guaranteed, nor are
the developers responsible in any way for how this data (or lack thereof)
is used. The interface is based on URLs and page layouts that might change
at any time. Even though these modules are designed to be adaptive under
these circumstances, they will at some point probably be unable to
retrieve data unless fixed or provided with new parameters. Furthermore,
the data from these web sites is usually not even guaranteed by the web
sites themselves, and oftentimes is acquired elsewhere. See the
documentation for each site-specific module for more information regarding
the disclaimer for that site.

   Above all, play nice.

AUTHOR
======

   Matthew P. Sisk, <`sisk@mojotoad.com'>

COPYRIGHT
=========

   Copyright (c) 2000 Matthew P. Sisk.  All rights reserved. All wrongs
revenged. This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

SEE ALSO
========

   Finance::QuoteHist(3), HTML::TableExtract(3), Date::Manip(3),
perlmodlib(1), perl(1).


File: pm.info,  Node: Finance/QuoteHist/MotleyFool,  Next: Finance/QuoteHist/SiliconInvestor,  Prev: Finance/QuoteHist/Generic,  Up: Module List

Site-specific class for retrieving historical stock quotes.
***********************************************************

NAME
====

   Finance::QuoteHist::MotleyFool - Site-specific class for retrieving
historical stock quotes.

SYNOPSIS
========

     use Finance::QuoteHist::MotleyFool;
     $q = new Finance::QuoteHist::MotleyFool
        (
         symbols    => [qw(IBM UPS AMZN)],
         start_date => '01/01/1999',
         end_date   => 'today',
        );

     foreach $row ($q->quotes()) {
       ($symbol, $date, $open, $high, $low, $close, $volume) = @$row;
       ...
     }

DESCRIPTION
===========

   Finance::QuoteHist::MotleyFool is a subclass of
Finance::QuoteHist::Generic, specifically tailored to read historical
quotes from the Motley Fool web site (*http://www.fool.com/*). Motley Fool
does not currently supply information on dividend distributions or splits.

   For quote queries in particular, at the time of this writing, the
Motley Fool web site utilizes start and end dates, but never returns more
than a month worth of data for a particular symbol. The quote_urls()
method provides all the URLs necessary given the date range and symbols.
These are automatically utilized by the native methods of
Finance::QuoteHist::Generic.

   Please see `Finance::QuoteHist::Generic(3)' in this node for more
details on usage and available methods. If you just want to get historical
quotes and are not interested in the details of how it is done, check out
`Finance::QuoteHist(3)' in this node.

METHODS
=======

   The basic user interface consists of a single method, as shown in the
example above. That method is:

quotes()
     Returns a list of rows (or a reference to an array containing those
     rows, if in scalar context). Each row contains the Symbol, Date,
     Open, *High*, Low, Close, and Volume for that date. Quote values are
     pre-adjusted for this site.

REQUIRES
========

   Finance::QuoteHist::Generic

DISCLAIMER
==========

   The data returned from these modules is in no way guaranteed, nor are
the developers responsible in any way for how this data (or lack thereof)
is used. The interface is based on URLs and page layouts that might change
at any time. Even though these modules are designed to be adaptive under
these circumstances, they will at some point probably be unable to
retrieve data unless fixed or provided with new parameters. Furthermore,
the data from these web sites is usually not even guaranteed by the web
sites themselves, and oftentimes is acquired elsewhere.

   In the case of The Motley Fool, as of September 13, 2000, their
statement reads, in part:

     We do our best to get you timely, accurate information,
     but we reserve the right to be late, wrong, stupid, or
     even foolish. Use this data for your own information,
     not for trading. The Fool and its data or content
     providers (such as S&P Comstock, BigCharts, AFX, or
     Comtex) won't be liable for any delays or errors in the
     data, or for any losses you suffer because you relied
     upon it.

   There you have it. If you feel like you might have concerns with this
then first double check the statement on the bottom of this page:

     http://quote.fool.com/historical/historicalquotes.asp

   In addition, you might want to read their disclaimer:

     http://www.fool.com/help/disclaimer.htm

   If you still have concerns, then use another site-specific historical
quote instance, or none at all.

   Above all, play nice.

AUTHOR
======

   Matthew P. Sisk, <`sisk@mojotoad.com'>

COPYRIGHT
=========

   Copyright (c) 2000 Matthew P. Sisk. All rights reserved. All wrongs
revenged. This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

SEE ALSO
========

   Finance::QuoteHist::Generic(3), Finance::QuoteHist(3), perl(1).


File: pm.info,  Node: Finance/QuoteHist/SiliconInvestor,  Next: Finance/QuoteHist/Yahoo,  Prev: Finance/QuoteHist/MotleyFool,  Up: Module List

Site-specific class for retrieving historical stock quotes.
***********************************************************

NAME
====

   Finance::QuoteHist::SiliconInvestor - Site-specific class for
retrieving historical stock quotes.

SYNOPSIS
========

     use Finance::QuoteHist::SiliconInvestor;
     $q = Finance::QuoteHist::SiliconInvestor->new
        (
         symbols    => [qw(IBM UPS AMZN)],
         start_date => '01/01/1999',
         end_date   => 'today',
        );

     foreach $row ($q->quotes()) {
       ($symbol, $date, $open, $high, $low, $close, $volume) = @$row;
       ...
     }

DESCRIPTION
===========

   Finance::QuoteHist::SiliconInvestor is a subclass of
Finance::QuoteHist::Generic, specifically tailored to read historical
quotes from the Silicon Investor web site
(*http://www.siliconinvestor.com/*). Silicon Investor does not currently
supply information on dividend distributions or splits.

   For quote queries in particular, at the time of this writing, the
Silicon Investor web site utilizes start and end dates, returns data 200
entries at a time. The quote_urls() method provides all the URLs necessary
given the date range and symbols. These are automatically utilized by the
native methods of Finance::QuoteHist::Generic.

   Please see `Finance::QuoteHist::Generic(3)' in this node for more
details on usage and available methods. If you just want to get historical
quotes and are not interested in the details of how it is done, check out
`Finance::QuoteHist(3)' in this node.

METHODS
=======

   The basic user interface consists of a single method, as shown in the
example above. That method is:

quotes()
     Returns a list of rows (or a reference to an array containing those
     rows, if in scalar context). Each row contains the Symbol, Date,
     Open, *High*, Low, Close, and Volume for that date. Quote values are
     pre-adjusted for this site.

REQUIRES
========

   Finance::QuoteHist::Generic

DISCLAIMER
==========

   The data returned from these modules is in no way guaranteed, nor are
the developers responsible in any way for how this data (or lack thereof)
is used. The interface is based on URLs and page layouts that might change
at any time. Even though these modules are designed to be adaptive under
these circumstances, they will at some point probably be unable to
retrieve data unless fixed or provided with new parameters. Furthermore,
the data from these web sites is usually not even guaranteed by the web
sites themselves, and oftentimes is acquired elsewhere.

   In the case of The Silicon Investor, as of November 27, 2000, their
statement reads, in part:

     All information provided by S&P ComStock, Inc. ("ComStock") and its
     affiliates (the "ComStock Information") on Silicon Investor World
     Wide Web site is owned by or licensed to ComStock and its affiliates
     and any user is permitted to store, manipulate, analyze, reformat,
     print and display the ComStock Information only for such user's
     personal use. In no event shall any user publish, retransmit,
     redistribute or otherwise reproduce any ComStock Information in any
     format to anyone, and no user shall use any ComStock Information in
     or in connection with any business or commercial enterprise,
     including, without limitation, any securities, investment,
     accounting, banking, legal or media business or enterprise.

   There you have it. If you feel like you might have concerns with this
then first double check the statement on the bottom of this page:

     http://www.siliconinvestor.com/misc/terms.html

   If you still have concerns, then use another site-specific historical
quote instance, or none at all.

   Above all, play nice.

AUTHOR
======

   Matthew P. Sisk, <`sisk@mojotoad.com'>

COPYRIGHT
=========

   Copyright (c) 2000 Matthew P. Sisk. All rights reserved. All wrongs
revenged. This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

SEE ALSO
========

   Finance::QuoteHist::Generic(3), Finance::QuoteHist(3), perl(1).


File: pm.info,  Node: Finance/QuoteHist/Yahoo,  Next: Finance/YahooChart,  Prev: Finance/QuoteHist/SiliconInvestor,  Up: Module List

Site-specific subclass for retrieving historical stock quotes.
**************************************************************

NAME
====

   Finance::QuoteHist::Yahoo - Site-specific subclass for retrieving
historical stock quotes.

SYNOPSIS
========

     use Finance::QuoteHist::Yahoo;
     $q = new Finance::QuoteHist::Yahoo
        (
         symbols    => [qw(IBM UPS AMZN)],
         start_date => '01/01/1999',
         end_date   => 'today',
        );

     # Adjusted values
     foreach $row ($q->quotes()) {
       ($symbol, $date, $open, $high, $low, $close, $volume) = @$row;
       ...
     }

     # Non adjusted values
     $q->adjusted(0);
     foreach $row ($q->quotes()) {
        ($symbol, $date, $open, $high, $low, $close, $volume, $adj_close) = @$row;
     }

     # Splits
     foreach $row ($q->splits()) {
        ($symbol, $date, $post, $pre) = @$row;
     }

     # Dividends
     foreach $row ($q->dividends()) {
        ($symbol, $date, $dividend) = @$row;
     }

DESCRIPTION
===========

   Finance::QuoteHist::Yahoo is a subclass of Finance::QuoteHist::Generic,
specifically tailored to read historical quotes, dividends, and splits
from the Yahoo web site (*http://charts.yahoo.com/*).

   For quotes and dividends, Yahoo can return data quickly in CSV format.
For quotes, non-adjusted values are available in HTML. Splits are only
found embedded in the non-adjusted HTML produced for quotes. Behind the
scenes, an HTML quote query is performed when splits are requested; quotes
are retained based on the first successful query type. Unless told
otherwise, via the `adjusted()' method, the non-adjusted quotes will be
automatically adjusted by applying the ratio derived from the adjusted
closing value and non-adjusted closing value. This does not apply if
quotes were retrieved using CSV.

   There are no date range restrictions on CSV queries for quotes and
dividends.

   For HTML queries, Yahoo takes arbitrary date ranges as arguments, but
breaks results into pages of 200 entries.

   The quote_urls() and `dividend_urls' methods provide all the URLs
necessary given the target, date range, and symbols, whether they be for
HTML or CSV data. These are automatically utilized by the native methods
of Finance::QuoteHist::Generic.

   Please see `Finance::QuoteHist::Generic(3)' in this node for more
details on usage and available methods. If you just want to get historical
quotes and are not interested in the details of how it is done, check out
`Finance::QuoteHist(3)' in this node.

METHODS
=======

   The basic user interface consists of four methods, as seen in the
example above. Those methods are:

quotes()
     Returns a list of rows (or a reference to an array containing those
     rows, if in scalar context). Each row contains the Symbol, Date,
     Open, *High*, Low, Close, and Volume for that date. Optionally, if
     non-adjusted values were requested, their will be an extra element at
     the end of the row for the *Adjusted* closing price.

dividends()
     Returns a list of rows (or a reference to an array containing those
     rows, if in scalar context). Each row contains the Symbol, Date, and
     amount of the *Dividend*, in that order.

splits()
     Returns a list of rows (or a reference to an array containing those
     rows, if in scalar context). Each row contains the Symbol, Date,
     *Post* split shares, and *Pre* split shares, in that order.

adjusted($boolean)
     Sets whether adjusted or non-adjusted quotes are desired. Quotes are
     pre-adjusted by default.

   There are some extra methods and overridden methods in the Yahoo class
that deserve a little explanation for developers interested in developing
a similar site-specific module:

source_type($type)
     Sets or returns the desired type of output from Yahoo. Valid settings
     are 'csv' and 'html'. By default this is 'csv', where possible, but
     will sometimes be set to 'html' in cases where there is no choice,
     such as when split information is requested. In these cases, the
     desired source type is temporarily saved for the duration of the query
     and restored afterwards.

   The following methods override methods provided by the
Finance::QuoteHist::Generic module; more of this was necessary than is
typical for a basic query site due to the variety of query types and data
formats available on Yahoo.

quote_urls()
dividend_urls()
     Provides the URLs necessary for direct quote and dividend queries;
     depending on the value returned by the `source_type()' method, these
     URLs are either for HTML or CSV data.

dividend_extract()
split_extract()
     The presence of these filters will lift dividend and split information
     from the regular HTML quote output of Yahoo. In the case of splits,
     this is the only way to get the information, hence there is no
     split_urls() method present.

split_get()
     The mere presence of the split_extract() method would normally be
     enough for extraction retrieval. In this case, however, the data must
     be in HTML format. By overriding the method, 'html' can be
     specifically (and temporarily) requested for the duration of the
     query since the split information is not present in the CSV formats.

csv_parser()
     Unfortunate hack. Yahoo just happens to return CSV data from direct
     dividend queries in a mangled format (the CSV separator is different
     for the header row vs. the rest of the rows). This corrects that
     before passing it along to the regular csv_parser() method.

REQUIRES
========

   Finance::QuoteHist::Generic

DISCLAIMER
==========

   The data returned from these modules is in no way guaranteed, nor are
the developers responsible in any way for how this data (or lack thereof)
is used. The interface is based on URLs and page layouts that might change
at any time. Even though these modules are designed to be adaptive under
these circumstances, they will at some point probably be unable to
retrieve data unless fixed or provided with new parameters. Furthermore,
the data from these web sites is usually not even guaranteed by the web
sites themselves, and oftentimes is acquired elsewhere.

   In the case of Yahoo, as of September 13, 2000, their statement reads,
in part:

     Historical chart data and daily updates provided by
     Commodity Systems, Inc. (CSI). Data and information is
     provided for informational purposes only, and is not
     intended for trading purposes. Neither Yahoo nor any of
     its data or content providers (such as CSI) shall be
     liable for any errors or delays in the content, or for
     any actions taken in reliance thereon.

   If you would like to know more, check out where this statement was
found:

     http://chart.yahoo.com/d

   Better yet, you might want to read their disclaimer page:

     http://www.yahoo.com/info/misc/disclaimer.html

   If you still have concerns, then use another site-specific historical
quote instance, or none at all.

   Above all, play nice.

AUTHOR
======

   Matthew P. Sisk, <`sisk@mojotoad.com'>

COPYRIGHT
=========

   Copyright (c) 2000 Matthew P. Sisk. All rights reserved. All wrongs
revenged. This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

SEE ALSO
========

   Finance::QuoteHist::Generic(3), Finance::QuoteHist(3), perl(1).


