GET-QUOTE

For version 0.7.2, 3 June 2000


Introduction

This manual documents version 0.7.2 of the get-quote utility.

get-quote is an utility which fetches stock data from on line sites, mainly Yahoo.com, and the various national Yahoos. It can be configured to fetch the desired stocks value, in one-shot or in polling mode. It computes stock variations if the user gives an initial stock value, both on per-stock basis or on portfolio-basis. For more advanced users, it's possible to use non-preconfigured Yahoo sites, providing the complete URL infos.

get-quote works in text mode, and produce an output (both on terminal, and on file, if requested) whose format can be easily imported by other programs, such as historical databases or graphical analysis software.

The rest of this manual is organized as follows. The first part presents a series of configurations (section Tutorial) which show almost all the possible program usages, then there's a complete reference (section get-quote Reference) of the program options, individually explaned, and a final section (section Installation and Customization) to explain how to install and customize the program.

Tutorial

This Chapter describes the use of get-quote utility using a series of examples, of increasing complexity. See section get-quote Reference, for a complete description of each used flag.

This tutorial chapter is structured as follows.

section Fetch one stock to get the plain value of 1 stock while section Fetch more stocks is the same for more than one stock; section Fetch and do some value variation computations and section Fetch and do some value variation computations show how to have the program do some value variation computation, and finally section Fetch using various currency show how to use differents currency.

The final sections, section Fetch in polling mode and section Output options, show some global program configurations for polling or setting output mode, while the last one, section Fetch from not preconfigured Yahoo sites, show how to fetch data from a not preconfigured site.

The program is tipically invoked by get-quote, which is a script calling the program iget-quote with the user's configuration. In the tutorial we will invoke iget-quote directly.

Fetch one stock

The basic usage of get-quote is simple. A typical invoking to iget-quote looks like:

# iget-quote -m NASDAQ -i AMZN

"AMZN",52.4375,"4/25/2000","4:01PM",+2.625,51.8125,54.125,50.25,7150400,
Tue Apr  4 23:23:19 2000 GMT,1.0,
PORTFOLIO,Tue Apr  4 23:23:19 2000 GMT,-1.0000,-1.0000,-0.00%

The first argument, -m, is the market name. The complete supported market list can be seen invoking the command with the -h flag. The main supported markets are NASDAQ (US), SBF (France), Xetra (Germany), London (UK), Milan (Italy), FEF (an italian SIM the author was interested in).

The second argument, -i, is the stock name we are interested in: this name is the symbol used by the indicated market. To find the correct symbol, you can use the look up engine from the Yahoo site, to have the symbol from the name. For example the NASDAQ uses literal symbols (AMAZON.COM is AMZN), while the SBF (France) uses a numeric symbol (NICOX is 7413.PA: 7413 is the code, PA stands for Paris). The conventions depends on the market.

The output is in the form of one line for each requested stock: the first block of data represents the info from yahoo databases "as is", in particular the 1st field is the stock name, and the second the current stock value. Then there's the time (as GMT) of the fetching operation, followed by the currency exchange coefficient (a coefficient of 1 indicates that the program uses the original currency).

Fetch more stocks

In the same command line you can ask for more than one stock.

iget-quote -m NASDAQ -i AMZN -n -m SBF -i 7413.PA

Just repeat the same syntax for all the stocks you want, dividing them with a -n (i.e. --next).

Fetch and do some value variation computations

You can use get-quote to have a look to the stock variation, from a given initial value.

iget-quote -m SBF -i 7413.PA -p 40 -q 1 -P 50 -Q 1

7413.PA,Fri May  5 20:39:57 2000 GMT,1.0,25.00%
PORTFOLIO,Fri May  5 20:39:57 2000,40.0000,50.0000,25.00%

As a general rule, the options referring to a stock are lower case letters if referred to the BUY operation, while are upper case letters if referred to a sell operation.

In this case you have: "BUY 1 stock (-q 1) for a price of 40 (-p 40) of 7413.PA on Paris stock market (-m SBF -i 7413.PA), and SELL it (-Q 1 is sell 1 stock) at a price of 50 (-P 50).

The program will compute a stock price variation of +25%: the variation is the last field of the line.

The same thing is accomplished in the following example:

iget-quote -m SBF -i 7413.PA -p 40 -q 1 -Q 1

where the selling price is not given: in this case the program will fetch the current price from Yahoo, and uses it to do the same computations.

Fetch and do some value variation computations with commission

You can set the commission price for each stock to compute the real variation for a BUY/SELL operation.

# iget-quote -m SBF -i "7413.PA" -p41.88 -q15 -f29.95 -c1.95 
                                 -P 50 -F29 -C1.9

7413.PA,Tue May  2 21:21:11 2000 GMT,1.0,9.13%
PORTFOLIO,Tue May  2 21:21:11 2000,659.3750,719.5750,9.13%

In this case we have a fix buy commission of 29.95 (-f), plus a percent commission of 0.195% (-c), i.e. the value of this buy operation is:

41.88 * 15 + 29.95 + (41.88 * 15) * 1.95 / 1000.

In the same way, in the sell operation, we have a fix commission of 29 (-F) and a percent commission of 0.19% (-C).

This BUY/SELL operation give us a 9.13% gain.

Fetch using various currency

If working on different market, it is possible to have the program computing the currency exchange:

iget-quote -m NASDAQ -i AMZN -p71.25 -q7 -f29.95 -t 0.9993 
-F19  -T "USDEUR=X"

in this case the BUY operation currency was USDollar, but I wanted to refer it to the Euro currency.

The exchange rate for the BUY operation was 0.9993 (-t), i.e. 1 Dollar = 0.9993 Euro, while the exchange for the SELL operation is fetched from Yahoo (-T), where the symbol "USDEUR=X" stands for USDollar to Euro exchange rate.

Using the currency converter of Yahoo site you can find the code for all the currency you are interested in.

Fetch in polling mode

To monitor some stock variation continually, you can use the -s option:

iget-quote -m NASDAQ -i AMZN -n -m SBF -i 7413.PA -s 300

where you ask the program to fetch the data every 300 seconds (5 minutes). The program will continue to fetch data until you kill it.

Output options

You can log the data to a file using the -o option: the program will write to file the same data that outputs on monitor.

iget-quote -m NASDAQ -i AMZN -n -m SBF -i 7413.PA -s 300 -o logging

The data is appended to the logging file, if it already exists.

Fetch from not preconfigured Yahoo sites

iget-quote -M "ca.finance.yahoo.com" -i AC

With the option -M we define the site to fetch data from: data can be fetched by any Yahoo site as they use all the same interface: NOTE that you cannot fetch data from an arbitrary site.

get-quote Reference

In this chapter we describe the options of iget-quote: as a general rule each option can be given in a short or verbose form, i.e. the help option can be activated as -h or as --help.

General options

These options control the global program behaviour, i.e. are not stock specific. If an option is repeated more than once, the last one is the valid one.

Stock definition options

These options define the stock information: each stock can have all the options you need in the order you want. If an option is repeted more than once, the last option is the valid one.

Output description

The output gives one line for each stock you asked info for, the informations are separated by commas. The line gives:

At the end of the stock information there's a line giving the global portfolio variation: this line is introduced by the id "PORTFOLIO" and gives

Debug options

In the normal use these option should not be needed, (anyway, if you have to trace a bug, and need them ...).

Installation and Customization

This chapter describes the installation and customization of get-quote: the latest version may be downloaded from the get-quote home page

The distributed program has been compiled and tested in a linux box, running RedHat 6.0, using the gcc compiler.

The program has been written in standard C.

The directory doc contains the documentation, both as source texi file and as final format (Postscript, PDF, HTML).

If you downloaded a precompiled package, the executable files are in the directory bin.

Installation on Unix

The provided Makefile compiles the iget-quote utility, which should be copied in a directory in the PATH, for example ~/bin. The provided get-quote shell script and the other scripts in the examples directory, are used to invoke the utility with the user requested options: the user should edit these files to define the info he/she wants See section Customizing the portfolio.

You can keep the scripts you need in the directory you want, or, by copying it in a directory in the PATH, you can have the information you want at hand.

Installation on non-Unix Systems

The iget-quote utility can be compiled for Windows boxes, using the Cygnus GCC cross compiler for Linux: in a Windows box, you can keep both iget-quote.exe and the get-quote script in the same directory.

Note that I don't use Windows, so I don't know if there will be additional problems (and Windows surely have many problems ...): for example the scripts in the examples directory must be renamed so to end with the .bat extension.

Customizing the portfolio

The iget-quote utility wants all the parameters it needs from command line: the simpler mode to use it is to write your own invoking script, copying the example program invocations reported in this manual, and adapting to your own needs. Obviously, you can have as many invoking scripts as you need: one for stock, one for portfolio, one for market, and so on. The name get-quote I used in this manual can be changed to reflect the info it computes, or in general your tastes!

Acknowledgments

The project of get-quote was accomplished on a Linux box, using the various tools from the GNU project, including texinfo.

The manual backbone structure was stolen by FFTW manual, a program by Matteo Frigo and Steven G. Johnson, downloaded from the FFTW home page

License and Copyright

get-quote is copyright (C) 2000 Gianluca Moro

get-quote is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. You can also find the GPL on the GNU web site.

The information that you obtain with this utility may be copyrighted by Yahoo! Inc., and is governed by their usage license.

See the Yahoo copyright for more information.

Other copyrights and conditions may apply to data fetched through this utility.

For more informations, contact the author (giammy@artemide.dei.unipd.it)

Concept Index

Jump to: - - c - d - f - g - h - i - l - o - p - s - t - w

-

  • -a
  • -A
  • -c, -c
  • -C, -C
  • -d
  • -f, -f
  • -F, -F
  • -h, -h
  • -i, -i
  • -I
  • -l
  • -M, -M, -M
  • -m, -m
  • -n, -n
  • -o, -o
  • -P, -P
  • -p, -p
  • -q, -q
  • -Q, -Q
  • -s, -s
  • -T, -T, -T
  • -t, -t, -t
  • -v
  • -w
  • -{}-anteriorOption
  • -{}-ApostOption
  • -{}-commissionbuy
  • -{}-Commissionsell
  • -{}-debug
  • -{}-fixcommissionbuy
  • -{}-Fixcommissionsell
  • -{}-help
  • -{}-idofstockMarket
  • -{}-IdofstockVerbose
  • -{}-longoutput
  • -{}-market
  • -{}-MarketSite
  • -{}-next
  • -{}-outputfilename
  • -{}-pricebuy
  • -{}-Pricesell
  • -{}-quantitybuy
  • -{}-Quantitysell
  • -{}-sleep
  • -{}-tocurrencybuy
  • -{}-Tocurrencysell
  • -{}-verbose
  • -{}-wget
  • c

  • compiler
  • customize
  • d

  • debug-options
  • documentation
  • f

  • fetch-commission
  • fetch-compute
  • fetch-currency
  • fetch-more-stocks
  • fetch-not-configured
  • fetch-one-stock
  • fetch-polling
  • g

  • gcc
  • general-options
  • get-quote
  • h

  • html
  • i

  • installation
  • l

  • linux
  • o

  • output
  • output-description
  • output-options
  • p

  • pdf
  • postscript
  • precompiled
  • s

  • stock-options
  • t

  • texi
  • Tutorial
  • w

  • Windows

  • This document was generated on 3 June 2000 using texi2html 1.56k.