.\" 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::Yahoo 3pm" .TH Finance::QuoteHist::Yahoo 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::Yahoo \- Site\-specific subclass for retrieving historical stock quotes. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 7 \& use Finance::QuoteHist::Yahoo; \& $q = new Finance::QuoteHist::Yahoo \& ( \& symbols => [qw(IBM UPS AMZN)], \& start_date => \*(Aq01/01/2009\*(Aq, \& end_date => \*(Aqtoday\*(Aq, \& ); \& \& # Values \& 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; \& } .Ve .SH "DESCRIPTION" .IX Header "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 (\fIhttp://table.finance.yahoo.com/\fR). .PP For quotes and dividends, Yahoo can return data quickly in \s-1CSV\s0 format. Both of these can also be extracted from \s-1HTML\s0 tables. Splits are extracted from the \s-1HTML\s0 of the 'Basic Chart' page for that ticker. .PP There are no date range restrictions on \s-1CSV\s0 queries for quotes and dividends. .PP For \s-1HTML\s0 queries, Yahoo takes arbitrary date ranges as arguments, but breaks results into pages of 66 entries. .PP Please see \fBFinance::QuoteHist::Generic\fR\|(3) 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 \&\fBFinance::QuoteHist\fR\|(3). .SH "METHODS" .IX Header "METHODS" The basic user interface consists of three 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. .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 \fBSymbol\fR, \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 \fBSymbol\fR, \fBDate\fR, \&\fBPost\fR split shares, and \fBPre\fR split shares, in that order. .PP 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. .IP "\fBurl_maker()\fR" 4 .IX Item "url_maker()" Returns a subroutine reference tailored for the current target mode and parsing mode. The routine is an iterator that will produce all necessary URLs on repeated invocations necessary to complete a query. .IP "\fBextractors()\fR" 4 .IX Item "extractors()" Returns a hash of subroutine references that attempt to extract embedded values (dividends or splits) within the results from a larger query. .IP "\fBlabels()\fR" 4 .IX Item "labels()" Includes the 'adj' column. .SH "REQUIRES" .IX Header "REQUIRES" Finance::QuoteHist::Generic .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. .PP If you would like to know more, check out the terms of service from Yahoo!, which can be found here: .PP .Vb 1 \& http://docs.yahoo.com/info/terms/ .Ve .PP If you still have concerns, then use another site-specific historical quote instance, or none at all. .PP Above all, play nice. .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\fR\|(3), \fBperl\fR\|(1).