Hello, I have decided to make available, a X11 based query/graph program for stocks. I have put together some sample data, and the xstock code, plus a few utilities for people to use. My environment for creating and testing was a Solaris based workstations running 2.4 and X11 windowing system. The first step is to make a directory in /tmp called package. Move the tar file into the package directory, and untar it. You should end up with a bin, src, and data directory. The bin directory contains the xstock binary and other utility programs, while the data directory contains the symbol database, and directorys for stock day files and stock symbol files. As a result, there is some redundacy of data in my model. I have found that for queries, its easier to use day files, while for graphing its more efficient with symbol files. Xstock though can work with only day files. There is a .xstock file in the base directory. This file contains startup parameters that can be customized. NOTE: if you are running on a monochrome terminal, delete the *color lines. To run xstock, cd into /tmp/package directory and invoke bin/xstock. Hopefully a xstock window will appear (If not, then you will have to re-compile it from src/xstock directory). Xstock is based on pull down menus. The top level menus are: query graph modify indicators action configuration quit By moving the cursor into any menu, and pushing and holding the button down the menu will appear. Moving the cursor down through the menu and releasing the button will invoke the menu item. The query menu is design to display stocks based on different stock attributes. When any query menu item is invoked, a pop-up screen appears with some screening parameters. The parameters are: Day Range: Start xx/xxx/xx End xx/xx/xx Compare xx/xx/xx Price Range: Low xxx.xxx High xxx.xxx Count: xxxx Mode: x Fibonacci: Polarity: x Top percent: x.xxxx Botton percent: x.xxxx Distribution: Screen xxxxxxx Incr: x.xxxxx By default, the start, end and compare date are set to the last available day file (i.e. you would like to see what happen to the market the day before). The only field that does not have a default value, is count. Setting the count field to a positive number will invoke the query. The query menu is made up of: price percent volume dollar value volatity gaps top/bottom moving average bollinger bands groups high volume rsi fibonacci distribution low count high count A brief description of each follows. Price query is based on dollar amount change. Display fields consists of price change in dollars and cents, symbol, close price, percent price change, and company name. Percent query is based on percent change in stock price. Display fields consists of percent change, symbol, close price, dollar change, and company name. The volume query looks for volume leaders. Display fields consist of volume, symbol, price, price change, percent changed, company name. The dollar value query looks for money leaders (stock price * volume). Display fields consist of dollar value, symbol, price, price change, percent changed, company name. The volatity query looks at swing between high and low price of the stocks for the time period. Display fields are swing percent, symbol, high, low, price, swing in dollars, and company name. The gap query looks for holes between yesterday's close and today's open price. Display fields are gap percent, symbol, price, price change, company name. The top/bottom query looks for stocks that top and bottom of the time period. Display fields are percent (high-low), symbol, high, low, current price, change, and company name. The moving average query looks for stocks were the price of the stock crosses over the moving average value. Display fields are the percent of movement across the line, symbol, price, price change, and company name. The Bollinger query looks for stocks that have moved outside of the band. Display fields are percent out of band, symbol, price, price change and company name. The group query examines all groups over the time period ranking them according to gain/loss. Display fields are group name, group number, dollar value, and percent change. The high volume query looks for stocks exceeding the moving average volume. Display fields are multiple of moving average volume (3.5 would indicate that stock volume on last end query date was 3 and half times greater than normal), symbol, price, price change, and company name. The RSI (Relative Strength Indicator) query displays RSI, symbol, price, price change and company name. The Fibonacci query displays percent change, symbol, price, and company name. The distribution query shows how price changes for all stocks appear on a count basis. For instance you may see that 5 stocks were up 0.75 cents for the day versus 3 stocks were down 0.25 cents for the day. The query keys on the screen field. The valid enters are A for all stocks, G for groups, a number for a group or the actual group name. The incr field determines the resolution of the buckets for counting number stocks that would reside in that bucket value. For instance, .5 means that there are buckets for 0, 0.5, 1, 1.5, etc. The low count query shows stocks that have high counts of stocks having a close price lower than previous day. Display fields are count, most in a row, last in a row, symbol, price, price change, company name. The hight count query shows stocks that have high counts of stocks having a close price higher than previous day. Display fields are count, most in a row, last in a row, symbol, price, price change, company name. It should be noted that most queries show both positive and negative gains for the query. Also by moving the cursor to any stock on the screen and clicking a mouse button causes xstock to graph that individual stock. If the compare date is different the end day, the compare day close value is compared against the end day. This is an attempt to do some historical studys based on query type. Lastly the length of the company's name is bounded by the screen size. The graph menu is design to display a stock's attributes graphically. When any graph menu item is invoked, a pop-up screen appears with some screening parameters. The parameters are: Symbol: xxxxxxxx Buy Price: xxx.xxxx Buy Volume: xxxxxxxx Avg Volume: xxxxxxxx Volume Turnover: xx/xx/xx Company Shares: xxxxxxxx By default, all fields are initial null. After entering a symbol name, the other field values are determine. Buy price will equal the left most date close value this current being displayed. Buy volume will be zero. Average volume will be non-zero if moving averages is enabled. Volume turnover date will be the left most date from the screen. Company shares will be non-zero if in the company database. These additional fields come into play for special options available with xstock. The buy price field allows you to change the y-axis to percent via the modify menu (menu item price) such that you can see profit/loss percents based on your buy price. If buy volume is nonzero, then commissions can be calculated in on buy price. Horizontal lines will show break even line. Volume turnover can be used to see when a companys total shares have trade. You can set the volume turnover date field to any day, and based on the company shares and the current volume for each day, a vertical line will be drawn when the total shares have match the company shares. It should be noted that you have to Volume turnover on via the indicators menu item moving avg. The valid states are on or off. The graph menu is made up of: stock volume movement value rsi macd stochastic group split scr a/d line Each menu item is self-explantory. The group menu item brings up a different pop-up menu. It looks like: Group: xxxxxxxxxx mode: x Where Group is either the group name, or group number. The mode can be either t or s. If you specify t, the resulting graph is the accumalation of all the stocks in the group, while s the resulting graph has each stock of the group graphed independently. The spilt screen menu item allows you split the screen in multiple graphs. The a/d line menu item allows you to graph advance/decline lines. You can choose between all stocks, all groups or an individual group. The modify menu has menu items date and price. The date menu item allows you to modify the behavior of the date line. The pop-up menu looks like: Data xx/xx/xx Range xx/xx/xx number of days xxx Graph Adv x Graph Type x Actual Days xxxx Start Day xx/xx/xx End Day xx/xx/xx The data range shows you what days have been read in from the day or symbol file while the number of days is the actual count of days between the start and finish of the stock data. The graph adv field specifys how far/back xstock should advance the graph if you move the cursor into the right or left arrow buttons and click. The default is one month as denoted by 3. The graph type field indicates the granularity of the date display. By default its one day. If you had changed it to a 2, then stock graph is week based. The close would be the friday price with the high and low set by the weeks high and low. This allows you to collapse a lot days down into a smaller graph. The actual days fields allows to specify how many days to have on the graph screen, while start and end day allows to specify the graph display in terms of absolute dates. The price menu item allows you to modify the price attributes of the stock display. The pop-up menu looks like: Start Price: xxx.xxx Price Steps: xx Volume Steps: xx Price Incr: x.xxxx Volume Incr: xxxxxx Display xxx Look x L axis x R axis x The start price denotes the bottom price of the stock graph. The price steps determines the number of price hash marks. The volume steps follow the same principles of the price steps. The price increment is how much each hash mark represents in dollars and cents, while volume increment is in terms of shares. The display field indicates what stock price attributes to display (low, high, close), while the look field determines how the price data is displayed (d-dot, b-bar). Lastly the L axis and R axis items allow you to modify the left and right axis. You can have n for none, p for price, and % for percent. The % field will use the stocks buy price to show you how much you have gain/loss as the stock's price changes. The indicators menu consists of moving average and market. The pop-up moving average menu looks like: Bollinger Band xxx Moving Average xxx Fibonacci Lines xxx Volume turnover xxx Std Dev x.xxx Type x Mvavg Number Days xxx Stochastics Days xxx Fibonacci high x.xxxx Fibonacci low x.xxxx Most fields are self-explantory. The Type field is used to change how moving averages are computed. The simple (1) takes all the data points and divides by the number of days, while day (2) is a weighted moving average were the last day has more bearing the previous day, and so on. Lastly the volume (3) is based on the volume for the day and more weight is assigned on greater volume. The market menu item allows you see you major market indices. Once you bring up a market, any box you click the mouse in will result in a graph of this index. I only have a limited set of data in the day directory for viewing. The action menu is made up of: adjust zoom unzoom mark vol unmark vol print grid on track on status on trace on Most menu items are for stock graphs. The adjust menu is used to adjust for stock splits. Determine the day of the split, and enter the ratio. For instance if the stock split two for one, then the ratio would be 2.0 . The zoom menu item allows you expand an area of stock graph. After selecting it you get a cross-hair cursor. Move to a spot that you want to be the upper left corner and click and hold down the mouse and drag to the position that you want to be the right bottom of the graph and release. The unzoom menu item undo's a zoom operation. The mark volume menu item allows you to make a marker on the graph that used with the track menu item can give you total volume to the current location of the cursor. The umark volume erases the volume marker. The print menu item is used when you want an send a ascii list of a query menu item to a file or stdout. The configuration database menu item allows to specify the path for print. The grid on menu item will put a grid on a stock graph. Invoking the menu item again takes it off. The track on menu item will show individual day values when the cursor is moved over stock days. Invoking the menu item again takes it off. The status menu item will bring up window that can be used to monitor what xstock is doing internally. For instance, you can see what files are being accessed with graph a stock. Invoking the menu item again removes the status window. The trace menu item is used for debug purposes. It gives a running list of enter/exit points to stdout. Usefully only if xstock core dumps. Invoking the menu item again turns it off. Also xstock has to be built with -DDEBUG to enable this feature. The configuration menu is made up of: colors database companys groups They are fairly self-explantory. Note that clicking a mouse button in the companys or group display results in the stock/group being graphed. Well that's about it. I hope that you, the user, can make use of this software. I would like to hear any comments regarding it. Xstock may not be repackaged or sold for commerical or personal gain. If you want to make a donation for my efforts in developing this product, feel free. My home address is: Brian Kuznia 14109 Crocus Way Rosemount, MN 55068 My e-mail address is kuzski@aol.com