GnuCash c935c2f+
Loading...
Searching...
No Matches
get_quotes.pl
Go to the documentation of this file.
1#!/usr/bin/perl -w
2
3# get_quotes.pl -- Addition to example Script quotes_historc.py. Reads online stock quotes to file INTC.
4#
5
6
20
21use Finance::QuoteHist;
22print "Will get stock quotes of $ARGV[0] and save it into the file $ARGV[0]\n";
23$fname = $ARGV[0];
24 open (MYFILE, ">$fname");
25 $q = Finance::QuoteHist->new
26 (
27 symbols => [($ARGV[0])],
28 start_date => '01/01/2000',
29 end_date => 'today',
30 );
31
32
33print "name,date, open, high, low, close, volume\n";
34foreach $row ($q->quotes()) {
35 ($name,$date, $open, $high, $low, $close, $volume) = @$row;
36 print MYFILE "$name,$date, $open, $high, $low, $close, $volume\n";
37 }
38
39close(MYFILE);
40
41