GnuCash
2.6.99
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
optional
python-bindings
example_scripts
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
## @file
7
# @brief Addition to example Script quotes_historic.py. Reads online stock quotes to file INTC.
8
# @author Peter Holtermann
9
# @date January 2011
10
# @ingroup python_bindings_examples
11
#
12
# Call this script before calling @code
13
# python quotes_historic.py
14
# @endcode
15
#
16
# For explanation of use have a look at the wiki:
17
# http://wiki.gnucash.org/wiki/Stocks/get_prices
18
#
19
# @cond PERL
20
21
use Finance::QuoteHist;
22
print
"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
33
print
"name,date, open, high, low, close, volume\n"
;
34
foreach $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
39
close(MYFILE);
40
41
## @endcond
Generated by
1.8.6