.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Finance::QuoteHist 3pm" .TH Finance::QuoteHist 3pm "2021-03-12" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Finance::QuoteHist \- Perl module for fetching historical stock quotes. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 7 \& use Finance::QuoteHist; \& $q = Finance::QuoteHist\->new \& ( \& symbols => [qw(IBM UPS AMZN)], \& start_date => \*(Aq01/01/2009\*(Aq, # or \*(Aq1 year ago\*(Aq, see Date::Manip \& end_date => \*(Aqtoday\*(Aq, \& ); \& \& # Quotes \& foreach $row ($q\->quotes()) { \& ($symbol, $date, $open, $high, $low, $close, $volume) = @$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(\*(AqIBM\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Finance::QuoteHist is a top level interface for fetching historical stock quotes from the web. .PP It is actually a front end to modules based on Finance::QuoteHist::Generic, the main difference being that it has a default \fIlineup\fR of web sites from which to attempt quote retrieval. If the prospect of mixing data from multiple sites seems scary to you, then use one of the site-specific modules directly. .PP Unless otherwise defined via the \fIlineup\fR attribute, this module will select a \fIlineup\fR for you, the default being: .PP .Vb 2 \& Finance::QutoeHist::Yahoo \& Finance::QutoeHist::Google .Ve .PP Once instantiated, this module behaves identically to the first module in the \fIlineup\fR, sharing all of that module's methods. .PP 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. .PP See \fBFinance::QuoteHist::Generic\fR\|(3) for gory details on all of the parameters and methods this module accepts. The basic interface is noted below. .SH "METHODS" .IX Header "METHODS" The basic user interface consists of several methods, as seen in the example above. Those methods are: .IP "\fBquotes()\fR" 4 .IX Item "quotes()" Returns a list of rows (or a reference to an array containing those rows, if in scalar context). Each row contains the \fBSymbol\fR, \fBDate\fR, \&\fBOpen\fR, \fBHigh\fR, \fBLow\fR, \fBClose\fR, and \fBVolume\fR for that date. Optionally, if non-adjusted values were requested, their will be an extra element at the end of the row for the \fBAdjusted\fR closing price. .IP "\fBdividends()\fR" 4 .IX Item "dividends()" Returns a list of rows (or a reference to an array containing those rows, if in scalar context). Each row contains the \fBDate\fR and amount of the \fBDividend\fR, in that order. .IP "\fBsplits()\fR" 4 .IX Item "splits()" Returns a list of rows (or a reference to an array containing those rows, if in scalar context). Each row contains the \fBDate\fR, \fBPost\fR split shares, and \fBPre\fR split shares, in that order. .ie n .IP "source($ticker, $target)" 4 .el .IP "source($ticker, \f(CW$target\fR)" 4 .IX Item "source($ticker, $target)" Each of these methods displays which site-specific class actually retrieved the information, if any, for a particular ticker symbol and target such as 'quote' (default), 'dividend', or 'split'. .SH "DISCLAIMER" .IX Header "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. .SH "AUTHOR" .IX Header "AUTHOR" Matthew P. Sisk, <\fIsisk@mojotoad.com\fR> .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2000\-2021 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. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBFinance::QuoteHist::Generic\fR\|(3), \fBFinance::QuoteHist::Yahoo\fR\|(3), \fBperl\fR\|(1).