SMTM(1p)
π SMTM(1p) β User Contributed Perl Documentation π
okay bestie, sit down, we're talking about smtm today. it's the manual page for the girlies who want their stock ticker AND their vibes immaculate. this is part 1 of 2, so hydrate, don't leave yet π
β¨ NAME β¨
smtm β display and update a configurable ticker of global stock quotes π¦
πΈ SYNOPSYS πΈ
smtm [options] [stock_symbol ...]
(yes, the original spells it SYNOPSYS, and yes, we're keeping it exactly like that. it's iconic, it's a choice, we respect it π)
π OPTIONS π
here's the whole menu of levers you can pull. no skipping, every single one is here:
--time minβ how many minutes to wait before it refreshes again β°--file smtmrcβ the file where your selected stocks get stored and pulled back out of π--proxy prβ the network address and port of your firewall proxy π--fwall [id:pw]β account and password for the firewall π--chart lenβ pick how long the data interval shown in the chart is. must be one ofb,w,3,6,1,2,5,mortπ--timeout lenβ timeout, in seconds, for the libwww-perl UserAgent β³--wideβ also show value changes and holdings π--percentβ show relative performance as percent instead of bps π―--sort styleβ sort the display by the style you pick. must be one ofr,a,p,v,n,v,Vorhπ--columns setβ choose which columns show up. can be any combo ofs,n,l,a,r,v,p,V,R,hπ§±--nookbuttonβ close other windows with a left mouseclick, and suppress the button π±οΈ--helpβ print a short help message π
π DESCRIPTION π
so smtm is a not-overly-clever acronym for Show Me The Money, and it's a financial ticker + portfolio application for quotes from exchanges all around the world (as long as Yahoo! carries them, iykyk). it builds you a window full of quotes from Yahoo! Finance and then keeps that window updated automatically. it can also show you the entire variety of charts available over at Yahoo! Finance. call it with one or several symbols and it shows those selected stocks. call smtm with no arguments at all and it reads the symbol tickers out of a file β by default ~/.smtmrc. you can make that file on purpose by calling the Save option from the File menu. and it's not just stocks: smtm can also show currencies (from the Philadelphia exchange), US mutual funds, options on US stocks, several precious metals, and quite possibly more β hit the Yahoo! Finance website for the full picture. π
smtm can also aggregate the change in value for both individual positions and the the entire portfolio (yes, "the the", we're leaving that in, it's part of the family now). for that you need the number of shares, plus the cross-currency expression pair. it uses the standard ISO notation. for example, GBPUSD translates from Pounds into US Dollars. and if you want annualised returns computed, you can enter the purchase date and the purchase price too. πΈ
smtm shows the full name of the company, the absolute price change, and the relative percentage change in basispoints (that's hundreds of a percent, bestie) β or in percentages if you've selected that option. other things it can show: the traded volume, the profit/loss, the aggregate positon value, the holding period length, the annualised return, the drawdown, the earnings per share, the price/earnings ratio, the dividend yield, and the market capitalization. β οΈ heads up though: the return calculation ignores fine points like dividends, and foreign exchange appreciation or depreciation for foreign stocks. every single display column can be selected or deselected on its own. π§
Losers get flagged in red. smtm works for stocks from the USA, Canada, various European exchanges, various Asian exchanges (Singapore, Taiwan, HongKong, Kuala Lumpur, ...), Australia and New Zealand. it should work for other markets Yahoo supports. US mutual funds are available too, but they're less relevant since their net asset value only gets computed after the market closes. some fields might come up empty if Yahoo! doesn't supply the full set of fields β and the number of supported fields varies even among US exchanges. the sorting order? you've got eight different options to pick from. π
The quotes and charts are delayed β typically 15 minutes for NASDAQ and 20 minutes otherwise, see http://finance.yahoo.com for details. New Zealand is rumoured to be somewhat slower, with a delay of one hour. but here's the fun part: (at least some) US indices are updated in real time at Yahoo!, which means they're available in real time to smtm too π₯. Intra-day and five-day charts get updated during market hours by Yahoo!, while other charts with longer timeframes are only updated once a week by Yahoo!. no cap.
smtm supports both simple proxy firewalls (via the --proxy option) and full-blown firewalls with account and password authorization (via the --fwall option). the firewall account name and password can be given as command line arguments after --fwall, or else in a pop-up window. this setup has been in a few different environments. π‘οΈ
smtm can display two more views of a share position. clicking mouse button 1 launches a detailed view with price, date, change, volume, bid, ask, high, low, year range, price/earnings, dividend, dividend yield, market capital information, number of shares held and annualised return. but β not all of that information is available at all exchanges, sorry babe π. clicking the right mouse button displays a chart of the corresponding stock; this only works for US and Canadian stocks. the type of chart can be specified either on the command-line, or via the Chart menu. the choices are intraday, five day, three months, six months, one year, two years, five years or max years. the default chart is a five day chart. the middle mouse button opens an edit window so you can modify and augment the information stored per stock. βοΈ
see http://help.yahoo.com/help/us/fin/chart/ for help on Yahoo! Finance charts. π©·
smtm has been written and tested under Linux. it should run under any standard Unix β success with Solaris, HP-UX and FreeBSD is confirmed (but problems are reported under Solaris when a threaded version of Perl is used). it also runs under that other OS from Seattle, using the ActivePerl implementation from http://www.activestate.com. in either case, it needs the Perl/Tk module for windowing, and the LWP module (also known as libwww-perl) for data retrieval over the web. the excellent Date::Manip modules are also required for the date parsing and calculations. with recent versions of ActivePerl, only Date::Manip needs to be installed on top of the modules you already have. π§°
π EXAMPLES π
okay, real ones, let's go:
smtm CSCO NT
creates a window following the Cisco and Nortel stocks. π
smtm MSFT:Bill SUNW:Scott ORCL:Larry
follows three other tech companies and uses the override feature for the displayed name. [ Historical note: We once needed that for European stocks as Yahoo! did not supply the company name way back in 1999 or so. This example just documents a now ancient feature. ] π°οΈ
smtm BT.A.L::10:GBPCAD T::10:USDCAD \
BCE.TO::10 13330.PA::10:EURCAD \
"555750.F:DT TELECOM:10:EURCAD"
creates a window with prices for a handful of telecom companies on stock exchanges in London, New York, Toronto, Paris and Frankfurt. note how a name is specified to override the verbose default for the German telco. also determined are the number of shares, here 10 for each of the companies. lastly, this example assumes a Canadian perspective: returns are converted from British pounds, US dollars and Euros into Canadian dollars. quotation marks have to be used to prevent the shell from splitting the argument containing spaces. [ Historical note: The Deutsche Telecom stock can now also be referenced as DTEGn.DE; similarly other stock previously available only under their share number are now accessible using an acronym reflecting their company name. ] π¨π¦
π MENUS π
Four menus are supported: File, Edit, Chart and Help. π
The File menu offers to load or save to the default file, or to 'save as' a new file. Exit is also available. πͺ
The Edit menu can launch windows to either add a new stock or delete one or several from a list box. Submenus for column selection based on various criteria are available. Similarly, the Sort menu allows you to select one of eight different sort options. Further, you can modify the delay time between updates and choose between the default title display or the wide display with changes in the position and total position value. π§
The Charts menu allows you to select the default chart among the eight choices intraday, five day, three months, six months, one year, two years, five years or 'max' years. Chart sizes can be selected among three choices. Plot types can be selected among line chart, bar chart and the so-called candlestick display. For both moving averages and exponential moving averages, six choices are avilable (5, 10, 20, 50, 100 and 200 days, respectively) which can all be selected (or deselected) individually. Similarly, any one of seven popular technical analysis charts can be added. Logarithmic scale can be turned on/off. Volume bar charts as also be selected or deselected. Similarly, Bollinger bands and the parabolic SAR can be selected. A selection box can be loaded to enter another symbol (or several of these, separated by comma) for performance comparison. Lastly, the gallery command can launch the display of a chart for each and every stock symbol currenly loaded in the smtm display. β οΈ Note that intra-day and intra-week charts do not offer all the various charting options longer-dated charts have available. Once charts are shown, they are also updated regularly at the same interval the main displayed is updated at. π
Lastly, the Help menu can display either the text from the manual page, or the copyright information in a new window. π«Ά
part 2 is coming, don't go anywhere π¦
DISPLAY π
Okay bestie, the main window? It's giving extremely straightforward. For each of the stocks, you can flex up to eleven lil items at once:
- its symbol π
- its name
- its most recent price
- the change from the previous close, in absolute terms
- the change in relative terms
- the volume
- the profit or loss
- the total position value
- the holding period
- the annualised return (bar F/X effects or dividends, no cap)
- the drawdown relative to the 52-week high β¨
So the relative change? You can have it either in basispoints (bps) β which are literally 1/100s of a percent, iykyk β or in percent. You control that with a checkbutton or a command-line option, dealer's choice. π
And there's more display options on deck: earnings per share, price/earnings ratio, dividend yield and market capitalization. Obsessed.
This display window refreshes itself at regular intervals, and you can set that update interval via a menu or a command-line option. π¦
The window title shows the relative portfolio profit or loss for the current day in basispoints (i.e. hundreds of a percent), or in percent if you picked the corresponding option β plus the date of the most recent update. And if you use the --wide option, you also get the net change and ney value of the portfolio (both in local currency) up in there too. β¨
Now the mouse stuff, because this is where it gets fun:
- Left click on any stock β opens a whole new window with all available details for that stock. Ngl though, the amount of info varies π. Non-North American stocks only get a limited subset of info through the csv interface of Yahoo!. And for North American stocks, not all fields are provided by all exchanges. Not every king gets the same crown, we move. Clicking the details window itself closes it.
- Right click on any stock β opens a new window with a chart of that stock in the default chart format. This was initially only for North American stocks but now it works across most if not all markets, thanks to expanded support by Yahoo! π₯ Clicking the chart window itself closes it.
- Middle click β opens an edit window. Simple as that.
CHART DISPLAY (AKA 'GALLERY' MODE) πΌοΈ
In 'gallery' mode, chart windows pop open for all active securities, and those charts auto-update whenever the display updates. Which means β and this is the tea β only the intra-daily and intra-weekly chart timeframe selections are actually meaningful. Everything else is updated at the source, i.e. Yahoo!, daily or weekly, so there's no little point in downloading the same chart over and over again. π
That said, for intra-daily and intra-weekly charts this is a very useful feature, periodt. But heads up: not all chart size, chart timeframe and chart option permutations actually lead to existing charts. For example, logarithmic scale does seem to exist for shorter-dated time frames. Neither does the 'small' chart size. So yeah, vibe check your combos. π
BUGS π
- Closing the stock addition or deletion windows has been reported to cause random segmentation violation under Linux. This appears to be a bug in Perl/Tk which will hopefully be solved, or circumvented, soon. This bug does not bite under Solaris, FreeBSD or NT or other Linux distributions. Update: this problem appears to have disappeared with Perl 5.6.*.
- Problems with undefined symbols have been reported under Solaris 2.6 when Perl has been compiled with thread support. Using an unthreaded Perl binary under Solaris works. How this problem can be circumvented is presently unclear.
- It is not clear whether the market capitalization information is comparable across exchanges. Some differences could be attributable to 'total float' versus 'free float' calculations.
SEE ALSO π
Finance::YahooQuote.3pm, Finance::YahooChart.3pm, LWP.3pm, lwpcook.1, Tk::UserGuide.3pm
See http://help.yahoo.com/help/us/fin/chart/ for help on Yahoo! Finance charts. π«Ά
COPYRIGHT Β©οΈ
smtm is (c) 1999 - 2008 by Dirk Eddelbuettel <edd@debian.org>
Updates to this program might appear at http://dirk.eddelbuettel.com/code/smtm.html. If you enjoy this program, you might also want to look at my beancounter program http://dirk.eddelbuettel.com/code/beancounter.html, as well as the Finance::YahooQuote module at http://dirk.eddelbuettel.com/code/yahooquote.html which was originally written by Dj Padzensky, and that is used by both smtm and beancounter. π
This program 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. There is NO warranty whatsoever. π
The information that you obtain with this program may be copyrighted by Yahoo! Inc., and is governed by their usage license. See http://www.yahoo.com/docs/info/gen_disclaimer.html for more information.
ACKNOWLEDGEMENTS π
The Perl code by Dj Padzensky, in particular his Finance::YahooQuote module (originally on the web at http://www.padz.net/~djpadz/YahooQuote/ and now maintained by me at http://dirk.eddelbuettel.com/code/yahooquote.html/) and his Finance::YahooChart module (on the web at http://www.padz.net/~djpadz/YahooChart/) were most helpful. They provided the initial routines for downloading stock data and determining the Yahoo! Chart url. Earlier version of smtm use a somewhat rewritten variant (which still reflected their heritage), newer version rely directly on Finance::YahooQuote now that Yahoo! uses a similar backend across the globe. Dj's code contribution is most gratefully acknowledged. π«Ά
CPAN π¦
The remaining sections pertain to the CPAN registration of smtm. The script category is a little mismatched but as there is no Finance section, Networking was as good as the other choices. π€·
SCRIPT CATEGORIES
Networking
PREREQUISITES
On Windows, smtm can use the Perl distribution from http://www.activestate.com. On both Unix and Windows, smtm requires the "Tk" module for windowing, the "LWP" module for data retrieval over the web, and the excellent "Date::Manip" module for the date parsing and calculations. Finance::YahooQuote is used for actual data access. Tk::PNG is used to display the png charts since Yahoo! switched from gif to png around May 2005. π
COREQUISITES
None.
OSNAMES
smtm is not OS dependent. It is known to run under Linux, several commercial Unix variants and Windows. π
README
smtm, which is a not overly clever acronym for Show Me The Money, is a financial ticker and portfolio application for quotes from exchanges around the world (provided they are carried on Yahoo!). It creates and automatically updates a window with quotes from Yahoo! Finance. It can also display the entire variety of charts available at Yahoo! Finance. Fairly extensive documentation for smtm is available at http://dirk.eddelbuettel.com/code/smtm.html. π
And that's a wrap, bestie!! π This lil manual page is perl v5.20.2, dated 2008-05-25, and it's SMTM(1p) β the iconic, the legendary, the one and only. Go make some money πΈβ¨ periodt.
π¦ where this page comes from
- ubuntu jammy: smtm 1.6.11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms