.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" 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 "BEANCOUNTER 1p" .TH BEANCOUNTER 1p "2022-05-25" "perl v5.34.0" "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" beancounter \- Stock portfolio performance monitor tool .SH "SYNOPSYS" .IX Header "SYNOPSYS" beancounter [options] command [command_arguments ...] .SH "COMMANDS" .IX Header "COMMANDS" .Vb 10 \& addindex index args add stock(s) to market index \*(Aqindx\*(Aq \& addportfolio sym:nb:fx:type:o:pp:pd ... \& add \*(Aqnb\*(Aq stocks of company with symbol \*(Aqsym\*(Aq \& that are listed in currency \*(Aqfx\*(Aq to the \& portfolio with optional \*(Aqtype\*(Aq and \*(Aqowner\*(Aq \& info, purchase price \*(Aqpp\*(Aq and date \*(Aqpd\*(Aq; \& see below for a complete example \& allreports combines dayendreport, status and risk \& addstock arg ... add stock(s) with symbol arg to the database \& advancement report on unrealized gains from lows \& backpopulate arg ... fill with historic data for given stock(s) \& checkdbconnection test if connection to db can be established \& dailyjob combines update, dayendreport, status + risk \& dayendreport reports p/l changes relative to previous day \& deactivate symbol ... set stock(s) inactive in stockinfo table \& delete arg ... delete given stock(s) from database \& destroydb delete the BeanCounter database \& fxbackpopulate arg ... fill with historic data for currency(ies) \& lsportfolio list portfolio data \& plreport run an portfolio p/l report rel. to any day \& quote arg ... report current data for given stock(s) \& retracement report unrealized losses from highs (drawdowns) \& risk display a portfolio risk report \& split arg ... split\-adjust price history and portfolio \& status status summary report for portfolio \& update update the database with day\*(Aqs data \& warranty display the short GNU GPL statement .Ve .SH "OPTIONS" .IX Header "OPTIONS" .Vb 10 \& \-\-help show this help \& \-\-verbose more verbose operation, debugging \& \-\-date date report for this date (today) \& \-\-prevdate date relative to this date (yesterday) \& \-\-currency fx set home currency \& \-\-restriction sql impose SQL restriction \& \-\-extrafx fx1,fx2,... additional currencies to load \& \-\-forceupdate date force db to store new price info with date \& \-\-rcfile file use different configuration file \& \-\-[no]fxupdate enforce/suppress FX update, default is update \& \-\-[no]commit enforce/suppress database update, default is commit \& \-\-[no]equityupdate enforce/suppress Equity update, default is update \& \-\-[no]ubcfx use/skip FX from UBC\*(Aqs Sauder school, default skip \& \-\-splitby arg split stock history + position by this factor [2] \& \-\-dbsystem system use db backend system, default is PostgreSQL \& \-\-dbname name use db name, default is beancounter .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBbeancounter\fR gathers and analyses stock market data to evaluate portfolio performance. It has several modes of operation. The first main mode is data gathering: both current data (e.g. end-of-day closing prices) and historical price data (to back-populate the database) can be retrieved both automatically and efficiently with subsequent local storage in a relational database system (either \&\fIPostgreSQL\fR, \fIMySQL\fR or \fISQLite\fR) though any other system with an \&\fI\s-1ODBC\s0\fR driver could be used). The second main mode is data analysis where the stored data is evaluated to provide performance information. Several canned reports types are already available. .PP Data is retrieved very efficiently in a single batch query per Yahoo! host from the Yahoo! Finance web sites using Finance::YahooQuote module (where version 0.18 or newer is required for proxy support). Support exists for North America (i.e. \s-1US\s0 and Canada), Europe (i.e. the Continent as well as Great Britain), several Asian stock markets, Australia and New Zealand. .PP \&\fBbeancounter\fR can aggregate the change in value for the entire portfolio over arbitrary time horizons (provided historical data has either been gathered or has been backpopulated). Using the powerful date-parsing routine available to Perl (thanks to the \fIDate::Manip\fR modules), you can simply say 'from six months ago to today' (see below for examples). .PP \&\fBbeancounter\fR has been written and tested under Linux. It should run under any standard Unix as long as the required Perl modules are installed, as as long as the database backend is found. .SH "EXAMPLES" .IX Header "EXAMPLES" .Vb 1 \& beancounter update \-\-forceupdate today \& \& This updates the database: it extends timeseries data (such as \& open, low, high, close, volume) with data for the current day, \& and overwrites static data (such as capital, price/earnings, ...) \& with current data. All stocks held in the database are updated \& (unless the \-\-restriction argument instructs otherwise). The \& \-\-forceupdate option lets the program corrects incorrect dates \& returned from Yahoo! (which happens every now and so often), but \& be careful to correct for this on public holidays. Note that \& the \-\-restriction argument will be applied to the portfolio table, \& whereas the overall selection comes from the stockinfo table. \& \& beancounter addportfolio IBM:100:USD:401k:joe:90.25:20000320 \e \& SPY:50:USD:ira:joe:142.25:20000620 \& \& This adds IBM to the 401k portfolio of Joe, as well as SP500 \& \*(AqSpiders\*(Aq to his IRA portfolio. The stocks are also added to the \& general stock info tables via an implicit call of the stockinfo \& command. \& \& beancounter addstock LNUX RHAT COR.TO \& \& This adds these three Linux companies to the database without adding \& them to any specific portfolios. \& \& beancounter backpopulate \-\-prevdate \*(Aq1 year ago\*(Aq \e \& \-\-date \*(Aqfriday 1 week ago\*(Aq IBM MSFT HWP \& \& This backpopulates the database with historic prices for three \& hardware companies. Note how the date specification is very general \& thanks to the underlying Date::Manip module. \& \& beancounter fxbackpopulate \-\-prevdate \*(Aq1 year ago\*(Aq \e \& \-\-date \*(Aqfriday 1 week ago\*(Aq CAD EUR GBP \& \& This backpopulates the database with historic prices for these \& three currencies. Note how the date specification is very general \& thanks to the underlying Date::Manip module. \& \& Unfortunately, Yahoo! is a little bone\-headed in its implementation \& of historic FX rates \-\- these are stored to only two decimals \& precision, just like stockprices. Unfortunately, convention is to \& use at least four if not six. Because of the limited information, \& risk from FX changes will be underestimated. \& \& beancounter plreport \-\-prevdate \*(Aq1 month ago\*(Aq \-\-date \*(Aqtoday\*(Aq \e \& \-\-restriction "owner=\*(Aqjoe\*(Aq" \& \& This calculates portfolio profits or losses over the last month. It \& also imposes the database restriction that only stocks owned by \& \*(Aqjoe\*(Aq are to be included. \& \& beancounter status \-\-restriction "type=\*(Aq401k\*(Aq" \& \& This shows a portfolio status report with the restriction that only \& stocks from the \*(Aq401k\*(Aq account are to be included. \& \& beancounter risk \-\-prevdate "6 month ago" \& \& This shows a portfolio risk report. This tries describes the \& statistically plausible loss which should be exceeded only 1 out \& of 100 times (see below for more details). \& \& beancounter dailyjob \-\-forceupdate today \& \& Run a complete \*(Aqjob\*(Aq: update the database, show a day\-end profit/loss \& report, show a portfolio status report and show a riskreport. In the \& update mode, override a potentially wrong date supplied by Yahoo! \& with the current date. \& \& beancounter split \-\-splitby 3 \-\-prevdate 1990\-01\-01 ABC CDE \& \& Split\-adjusts the (hypothetical) stocks ABC and CDE by a factor \& of three: price data in the database is divided by three, volume \& increased by 3 and similarly, in the portfolio shares are increased \& and cost is descreased. Default dates are \-\-prevdate and \-\-date \& which may need adjusting. .Ve .SH "TUTORIAL" .IX Header "TUTORIAL" The following few paragraphs will illustrate the use of \&\fBbeancounter\fR. We will set up two fictional accounts for two brothers Bob and Bill (so that we can illustrate the 'owner' column). The prices below are completely fictitious, as are the portfolios. .PP We suppose that \fBbeancounter\fR is installed and that the \&\fBsetup_beancounter\fR command has been run. We can then create a two-stock (computer hardware) portfolio for Bob as follows: .PP .Vb 2 \& beancounter addportfolio SPY:50:USD:401k:bob:142.25:20000620 \e \& IBM:100:USD:401k:bob:90.25:20000320 .Ve .PP Here we specify that 100 shares each of \s-1SPY\s0 and \s-1IBM,\s0 priced in \s-1US\s0 Dollars, are in Bob's portfolio which is tagged as a 401k retirement account. The (fictitious) purchase price and date are also given. .PP Let's suppose that Bill prefers networking equipment, and that he has a brokerage account in Canada: .PP .Vb 2 \& beancounter addportfolio CSCO:100:USD:spec:bill:78.00:19990817 \e \& NT.TO:200:CAD:spec:bill:cad:90.25:20000212 .Ve .PP Now we can backpopulate the database from 1998 onwards for all four stocks: .PP .Vb 1 \& beancounter backpopulate \-\-prevdate 19980101 CSCO IBM NT.TO SPY .Ve .PP With this historical data in place, we now compare how Bob's portfolio would have fared over the last 18 months: .PP .Vb 2 \& beancounter plreport \-\-prevdate \*(Aq18 months ago\*(Aq \e \& \-\-restriction "owner=\*(Aqbob\*(Aq" .Ve .PP Note how we use double quotes to protect the arguments, and how the \&\s-1SQL\s0 restriction contains a further single quote around the literal string. .PP We can also review the performance for Bill at the most recent trading day: .PP .Vb 1 \& beancounter dayendreport \-\-restriction "owner=\*(Aqbill\*(Aq" .Ve .PP or the status of holdings and their respective values: .PP .Vb 1 \& beancounter dayendreport \-\-restriction "owner=\*(Aqbill\*(Aq" .Ve .PP Similarly, a risk reports can be run on this portfolios per .PP .Vb 1 \& beancounter risk \-\-restriction "owner=\*(Aqbill\*(Aq" .Ve .SH "MORE DETAILED COMMAND DESCRIPTION" .IX Header "MORE DETAILED COMMAND DESCRIPTION" \&\fBaddportfolio\fR is the most important 'position entry' command. As with other commands, several arguments can be given at the same time. For each of these, records are separated using a colon and specify, in order, stock symbol, number of stocks held, currency, account type, account owner, purchase price and purchase date. Only the first three arguments are required, the others are optional. Executing \fBaddportfolio\fR implicitly executes \fBaddstock\fR. The account type column can be used to specify whether the account is, e.g., a tax-sheltered retirement account, or it could be used to denote the brokerage company is it held at. .PP \&\fBplreport\fR retrieves the most recent quotes(s). This is useful for illiquid securities which might not have traded that day, or if a public holiday occurred, or if there was a data error at Yahoo!. Two dates can be specified which determine the period over which the profit or loss is computed. This will fail if price data (or currency data in the case of foreign stocks data) data is not available for either of those two dates. This may be restrictive for foreign stocks where we cannot backpopulate due to lack of public data source for historical currency quotes. Major currencies can be retrieved from Yahoo!, but only to two decimals precisions. .PP \&\fBdayendreport\fR is similar to \fBplreport\fR but is always over a one-day period. It also uses only one date record by calculating performance given the 'previous close' data. .PP \&\fBstatus\fR shows holdings amounts, total position values, annualized returns in percentages and holding periods in days. Note that the annualized returns can appear excessive if, e.g., a ten-day return from a recently purchased stock is extrapolated to an annual time period. .PP \&\fBrisk\fR shows a portfolio risk report which describes the statistically plausible loss which should be exceeded only 1 out of 100 times. In other words, the loss estimate has a critical level of 99%. This risk level is estimated via two methods. The first is non-parametric and assumes no particular model or distribution; it computes the 1% quintile of the return distribution and displays it as well as the corresponding asset value at risk. The second method uses the standard Value-at-Risk (VaR) approach. This uses the 1% critical value of the Normal distribution and implicitly assumes a normal distribution for returns. See \f(CW\*(C`http://www.gloriamundi.org\*(C'\fR for more introduction and references. If the distribution of normalitty was perfectly true, both measures would coincide. A large difference between the two estimates would indicate that the return distribution might be rather non-normal. Another view of the riskiness of a given position is provided by the last column with the 'margVaR' heading. It shows the marginal Value-at-Risk. Marginal VaR is commonly defined as the risk contribution of the given position to the total portfolio, and calculated as the difference in the VaR of the full portfolio and the VaR of an otherwise identical portfolio with the given position removed. Note that calculating marginal VaR is fairly slow (on the order of O(n^3) ]. .PP \&\fBretracement\fR shows a 'drawdown' report. Drawdown is commonly defined as the percentage loss relative to the previous high. The default period is used, but can be altered with the \fB\-\-date\fR and \&\fB\-\-prevdate\fR options. The default period is also corrected for the actual holding period. In other words, if a stock has been held for two months, only those two months are used instead of the default of six months \*(-- but if the last months has been selected via \&\fB\-\-prevdate\fR then it is used. For short positions, the analysis is inverted and relative to the previous low. The report displays each stock, the number of shares held, the current price and holdings value. The next two columns show the maximum price attained in the examined period, and the percent decline relative to it. The last column shows the unrealized loss relative to the maximum price over the period. The aggregate holdings value, percent decline and unrealized loss are shown as well. .PP \&\fBadvancement\fR does the opposite of drawdown \*(-- it computes unrealized gains relative to the minimum price in the period. The discussion in the preceding paragraph applies `but inverted'. .PP \&\fBlsportfolio\fR simply lists the content of the portfolio table. A \s-1SQL\s0 restriction can be imposed. .PP \&\fBaddindex\fR adds stocks a the index table. Currently, no further analysis references this table. .PP \&\fBaddstock\fR adds stocks to the database. From then on data will be retrieved for the given symbol(s) and stored in the database whenever the \fBupdate\fR command is executed. .PP \&\fBbackpopulate\fR fills the database with historic prices for the given symbols and date period. Note that this works well for stocks and mutual fund. Options have no historic data stored. Currencies are stored with limited precision as noted above. .PP \&\fBquote\fR simply shows a price quote for the given symbol(s). .PP \&\fBupdate\fR updates the database with quotes for all stocks for the given day. No output is generated making the command suitable for \&\fBcron\fR execution. .PP \&\fBdailyjob\fR is a simple convenience wrapper around \fBupdate\fR, \&\fBdayendreport\fR, \fBstatus\fR and \fBrisk\fR, .PP \&\fBallreports\fR is a another covenience wrapper around \fBdayendreport\fR, \&\fBstatus\fR and \fBrisk\fR. .PP \&\fBdeactivate\fR will set the active column in stockinfo for the given symbol(s) to false thereby inhibiting any further updates of symbol(s). The existing data for symbol(s) is retained. Use this when a stock is acquired, delisted, or you simply want to stop tracking it \*(-- but do not want to purge the historical data. .PP \&\fBsplit\fR adjusts the price database, and the portfolio holdings, for stock splits. The default factor is 2, this can be adjusted with the option \fB\-\-splitby\fR. The dates arguments can be set with \fB\-\-prevdate\fR and \fB\-\-date\fR. .PP \&\fBdelete\fR removes the given symbols from the database. .PP \&\fBdestroydb\fR deletes the BeanCounter database. .PP \&\fBcheckdbconnection\fR simply opens and closes the database handle, and returns a specified exit code which can then be tested. This is used in the \fBsetup_beancounter\fR command. .PP \&\fBwarranty\fR display a short \s-1GNU\s0 General Public License statement. .SH "MORE DETAILED OPTION DESCRIPTION" .IX Header "MORE DETAILED OPTION DESCRIPTION" \&\fB\-\-currency\fR can be used to select a different \fIhome\fR currency. Instead of having all values converted to the default currency, the selected currency is used. .PP \&\fB\-\-date\fR allows to choose a different reference date. This is then be be used by commands working on a date, or date period, such as \&\fBplreport\fR, \fBdayendreport\fR, \fBbackpopulate\fR, \fBfxbackpopulate\fR or \&\fBstatus\fR. \fB\-\-prevdate\fR allows to choose a different start date for return calculations, or data gathering. .PP \&\fB\-\-restriction\fR can be used to restrict the database selection. The argument must be a valid part of valid \s-1SQL\s0 statement in the sense that existing columns and operators have to be employed. The argument to this option will be completed with a leading \fIand\fR. The \s-1SQL\s0 restriction will typcally be over elements of the \fIportfolio\fR table which comprises the columns \fIsymbol\fR, \fIshares\fR, \fIcurrency\fR, \&\fItype\fR, \fIowner\fR, \fIcost\fR and \fIdate\fR. A simple example would be \&\fIcurrency='\s-1CAD\s0'\fR. Note that this has to protected by double quotes \&\fI"I\fR on the command-line. .PP \&\fB\-\-extrafx\fR allows to gather data on additional currency rates beyond those automatically selected as shares are listed in them. A typical example would be for a European investor wanting to convert from the \&\s-1EUR\s0 in which the shares are listed into one of the member currencies which \fBbeancounter\fR would no longer retrieve as shares are no longer listed in these. .PP \&\fB\-\-forceupdate\fR allows to overwrite an potentially wrong date in the database update. Unfortunately, it appears that Yahoo! occasionally reports correct prices with an incorrect date such as the previous day's. In such a case, this option, along with an argument such as \&'today' can override the bad date datapoint and avoid a hole in the database. The downside of this approach is that it would \*(L"double\*(R" the previous data in the case of a public holiday, or even if it was run the weekend. A somewhat smarter comparison to previously stored data might prevent that, but would be more complex to implement. .PP \&\fB\-\-rcfile\fR allows to specify a resource file different from the default \fI~/.beancounterrc\fR. .PP \&\fB\-\-dbsystem\fR allows to switch to a different database backend. The default is \fBPostgreSQL\fR but \fBMySQL\fR and \fBSQLite\fR are also supported. For \fBSQLite\fR, the default is now version 3.* but the previous version \*(-- which is not binarily compatible \*(-- is supported as well with argument 'SQLite2'. .PP \&\fB\-\-dbname\fR allows to switch to an alternate database. The default is 'beancounter'. This can be useful for testing new features. .PP \&\fB\-\-fxupdate\fR is a boolean switch to enforece updates of \s-1FX\s0 rates during \&'update'. The default is 'true' but '\-\-nofxupdate' can be used to suppress the update of foreign exchange rates. .PP Similarly, \fB\-\-equityupdate\fR is a boolean switch to enforece, or suppress updates of Equity (i.e. stock) data during 'update'. The default is 'true' but '\-\-noequityupdate' can be used to suppress the update of foreign exchange rates. .PP \&\fB\-\-ubcfx\fR is a boolean switch to use the '\s-1PACIFIC\s0' \s-1FX\s0 rate service from the Sauder School at \s-1UBC.\s0 This is useful when the default \s-1FX\s0 rate service at Yahoo! is erratic, or unreliable. While the \s-1PACIFIC\s0 server provides a wider variety of exchange rates, Yahoo! can still be useful as it can provide more columns (open/high/low). However, during most of 2005, Yahoo! has been unrealiable for the exchange rates and has not provided historical \s-1FX\s0 data. On the other hand, the \s-1UBC\s0 service does not run on Canadian holidays so it cannot really server as a full substitute. Contributions for a new data acquisition, maybe via www.oanda.com would be welcome. .PP \&\fB\-\-splitby\fR can be used to set a stock split factor other than the default of 2. .PP \&\fB\-\-host\fR can be used to point to a machine containing the PostgreSQL or MySQL database. The machine can be remote, or it can be the actual machine \fBbeancounter\fR is running on. If a hostname is given, tcp/ip connection are used. If no hostname is given, the default value of \&'localhost' implies that local socket connections are used which may be easier to employ for less experienced adatabase users. .PP Also, \fB\-\-commit\fR is a boolean switch to suppress actual database updates if the negated \fB\-\-nocommit\fR is selected. This is useful mostly in debugging contexts. .PP The \fB\-\-verbose\fR and \fB\-\-debug\fR switches can be used in debugging an testing, and \fB\-\-help\fR triggers the display of help message. .SH "SYSTEM OVERVIEW" .IX Header "SYSTEM OVERVIEW" The following section details some of the database and configuration options. .SS "\s-1DATABASE REQUIREMENTS\s0" .IX Subsection "DATABASE REQUIREMENTS" \&\fBbeancounter\fR currently depends on either PostgreSQL, MySQL, SQLite (version 2 or 3) or any other database for which an \s-1ODBC\s0 driver is available (though the required tables would have to created manually in the \s-1ODBC\s0 case). Yet another \s-1DB\s0 backend could be added provided suitable Perl \s-1DBI\s0 drivers are available. For PostgreSQL, MySQL and SQLite, the \fBsetup_beancounter\fR script can create and initialize the database, form the required tables and fills them with some example data. It is a starting point for local modifications. .PP The connection to the database is made via a dedicated function in the \&\fBBeanCounter.pm\fR module, changes would only have to be made there. As of this writing the \fBPerl \s-1DBI\s0\fR (the database-independent interface for Perl) is used along the \s-1DBI\s0 drivers for PostgreSQL, MySQL, SQLite and \s-1ODBC.\s0 Ports for Oracle, Sybase, ... are encouraged. .SS "\s-1CONFIG FILE\s0" .IX Subsection "CONFIG FILE" A configuration file \fI~/.beancounterrc\fR is read if found. It currently supports the following options: .IP "\fIcurrency\fR to specify into which home currency holdings and profits/losses have to be converted" 8 .IX Item "currency to specify into which home currency holdings and profits/losses have to be converted" .PD 0 .IP "\fIhost\fR to specify the database server on which the \fBBeanCounter\fR database resides (this is needed only for the alternate connection via the DBI-Pg driver in case DBI-ODBC is not used)" 8 .IX Item "host to specify the database server on which the BeanCounter database resides (this is needed only for the alternate connection via the DBI-Pg driver in case DBI-ODBC is not used)" .IP "\fIuser\fR to specify the userid for the database connection; if needed. If not specified, the current user id is used." 8 .IX Item "user to specify the userid for the database connection; if needed. If not specified, the current user id is used." .IP "\fIpasswd\fR to specify the password for the database connection, if needed." 8 .IX Item "passwd to specify the password for the database connection, if needed." .IP "\fIdbsystem\fR to select a database backend, e.g. to switch from PostgreSQL to MySQL or SQLite or SQLite2 (the previous format of SQLite)." 8 .IX Item "dbsystem to select a database backend, e.g. to switch from PostgreSQL to MySQL or SQLite or SQLite2 (the previous format of SQLite)." .IP "\fIdbname\fR to select a different default database name other than the default of 'beancounter'" 8 .IX Item "dbname to select a different default database name other than the default of 'beancounter'" .IP "\fIproxy\fR to specify the address of a firewall proxy server if one is needed to connect to the Internet." 8 .IX Item "proxy to specify the address of a firewall proxy server if one is needed to connect to the Internet." .IP "\fIfirewall\fR to specify a firewallid:firewallpasswd combination, if needed." 8 .IX Item "firewall to specify a firewallid:firewallpasswd combination, if needed." .IP "\fIodbc\fR is a switch to turn \s-1ODBC\s0 connection on or off" 8 .IX Item "odbc is a switch to turn ODBC connection on or off" .IP "\fIdsn\fR to use a different data source name when \s-1ODBC\s0 is used" 8 .IX Item "dsn to use a different data source name when ODBC is used" .PD An example file \fIexample.beancounterrc\fR should have come with the sources (or the Debian package); please consult this file for more examples. .SS "\s-1ODBC CONFIGURATION\s0" .IX Subsection "ODBC CONFIGURATION" There are now several \s-1ODBC\s0 systems available for Linux / Unix. The following \fI~/.odbc.ini\fR work with the \fBiODBC\fR library and the \&\fBPostgreSQL\fR \s-1ODBC\s0 driver on my Debian GNU/Linux system: .PP .Vb 2 \& [ODBC Data Sources] \& beancounter = BeanCounter Database \& \& [beancounter] \& Driver = /usr/lib/libpsqlodbc.so \& Database = beancounter \& Servername = localhost \& \& [ODBC] \& InstallDir = /usr/lib .Ve .PP Alternatively, the \fBunixODBC\fR library can be used with the following scheme for \fI/etc/odbcinst.ini\fR (or \fI~/.odbcinst.ini\fR) to define the Postgres database drivers .PP .Vb 7 \& [PostgreSQL] \& Description = PostgreSQL ODBC driver for Linux and Windows \& Driver = /usr/lib/postgresql/lib/libodbcpsql.so \& Setup = /usr/lib/odbc/libodbcpsqlS.so \& Debug = 0 \& CommLog = 0 \& FileUsage = 1 .Ve .PP after which \fI/etc/odbc.ini\fR (or \fI~/.odbc.ini\fR) can be used to define actual data sources as follows: .PP .Vb 10 \& [PostgreSQL] \& Description = PostgreSQL template1 \& Driver = PostgreSQL \& Trace = No \& TraceFile = /tmp/odbc.log \& Database = template1 \& Servername = localhost \& UserName = \& Password = \& Port = 5432 \& Protocol = 6.4 \& ReadOnly = Yes \& RowVersioning = No \& ShowSystemTables= No \& ShowOidColumn = No \& FakeOidIndex = No \& ConnSettings = \& \& [beancounter] \& Description = Beancounter DB (Postgresql) \& Driver = Postgresql \& Trace = No \& TraceFile = \& Database = beancounter \& Servername = some.db.host.com \& UserName = \& Password = \& Port = 5432 \& Protocol = 6.4 \& ReadOnly = No \& RowVersioning = No \& ShowSystemTables= No \& ShowOidColumn = No \& FakeOidIndex = No \& ConnSettings = .Ve .SH "BUGS" .IX Header "BUGS" \&\fBFinance::BeanCounter\fR and \fBbeancounter\fR are so fresh that there are only missing features :) Seriously, check the \s-1TODO\s0 list. This code or its predecessors have been used by the author since the end of 1998. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIFinance::BeanCounter.3pm\fR, \fIsmtm.1\fR, \fIFinance::YahooQuote.3pm\fR, \&\fI\s-1LWP\s0.3pm\fR, \fIDate::Manip.3pm\fR, \fIStatistics::Descriptive.3pm\fR, \&\fIsetup_beancounter.1\fR, \fIupdate_beancounter.1\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" beancounter is (c) 2000 \- 2006 by Dirk Eddelbuettel .PP Updates to this program might appear at \&\fIhttp://dirk.eddelbuettel.com/code/beancounter.html\fR. .PP This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. There is \s-1NO\s0 warranty whatsoever. .PP The information that you obtain with this program may be copyrighted by Yahoo! Inc., and is governed by their usage license. See \&\fIhttp://www.yahoo.com/docs/info/gen_disclaimer.html\fR for more information. .PP Equivalently, foreign exchange rates from \fIhttp://fx.sauder.ubc.ca\fR are for academic research and teaching. See \&\fIhttp://fx.sauder.ubc.ca/about.html\fR for more details. .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" The Finance::YahooQuote module, originally written by Dj Padzensky (and on the web at \fIhttp://www.padz.net/~djpadz/YahooQuote/\fR as well as at \fIhttp://dirk.eddelbuettel.com/code/yahooquote\fR) serves as the backbone for data retrieval, which was also already very useful for the real-time ticker \fIhttp://dirk.eddelbuettel.com/code/smtm.html\fR.