The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Finance::YahooJPN::QuoteHist - fetch historical quotes of Japanese stock markets

SYNOPSIS

  use Finance::YahooJPN::QuoteHist;
  
  # get the quotes of Sony Corp. at Tokyo market.
  my @quotes = Finance::YahooJPN::QuoteHist->quotes('6758.t');
  
  my $quotes = join "\n", @quotes;
  print $quotes;

DESCRIPTION

Historical quotes data is basis for analyzing stock market. In Japan, standard quotes data is indicated as a set of data: four prices (open, high, low, close) and volume of each day. This module provides user a list of historical quotes of a company.

METHODS

quotes($symbol [, 'start' => $start] [, 'noadjust' => 1])

This class method automatically new(), fetch() and extract() then output().

See the descriptions about the following methods for the attributes: $symbol, start and noadjust.

new($symbol)

Constructor class method. A stock $symbol should be given with four numbers followed by market extension (dot `.' and one alphabet). (ex. `6758.t' )

For more information about market extensions, see http://help.yahoo.co.jp/help/jp/fin/quote/stock/quote_02.html.

fetch(['start' => $start])

This object method fetches the stock's historical quotes pages of Yahoo-Japan-Finance from the $start date to the current date.

A $start date should be given in the format `YYYY-MM-DD' (ex. `2003-08-14'). Be careful, don't forget to quote the word, because bare word 2000-01-01 will be conprehend by Perl as '2000 - 1 - 1 = 1998'. This attributes is omittable. The default value of $start is '1980-01-01'.

You cannot specify the end date. Because, to find the splits you must scan all of the quotes from the start date. Without the splits data, estimattion of adjustment for the splits cannot do exactly.

extract(['noadjust' => 1])

This object method extracts the stock's historical quotes data from the fetched pages of Yahoo-Japan-Finance.

The noadjust option can turn on/off the function of value adjustment for the splits. If you omit this option or set this value '0', adjustment function is effective (default). If you set this value other than '0', adjustment function is ineffective.

output()

This object method returns the extracted quotes as a list.

NOTES

The mudule calculates adjusted values originally including closing price. The only adjusted values which Yahoo presents are closing prices, and those numbers are not rounded but cut for decimal fractions. For this reason, I decided to ignore Yahoo's adjusted values (that's why some adjusted closing prices are different from Yahoo's).

For non-Japanese users: this program includes some Japanese multi-byte character codes called `EUC-JP' for analyzing Yahoo-Japan-Finance's HTML pages.

AUTHOR

Masanori HATA <lovewing@geocities.co.jp> (Saitama, JAPAN)

COPYRIGHT

Copyright (c)2001-2003 Masanori HATA. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.