Professional Documents
Culture Documents
CS-597: Advanced Problem in Computer Science
-- Master Project Report --
September 28, 2001
TABLE OF CONTENTS
ABSTRACT
This project is to develop an Online Personal Stock Investing System,
changes, buy stocks, sell stocks and manage their portfolios, trading
details, view open orders. Through the system, the investors are able to
obtain the real time stock information, finding stock chart, news and
research on internet that can help users to find the right investment
interface.
This online stock trading system is modeled as client-server-data
Keywords:
server
It has done nothing short of change the way our world works and the way
our nation invests. And overall, it has changed us for the better.
Point, click, and trade ¾ these three little words sum up the allure of
an account with an online broker, one can buy and sell shares of stocks
and mutual funds with mere keystrokes. No waiting to place an order with
nest egg.
The number of people using the Web to invest is growing fast. As the
increasingly turning to the Web to research, discuss and trade stocks and
securities.
not one person traded over the Internet. In the next few years, the number
the number of online accounts will grow from the current level of about 3
brokerage houses for the promise of cheap, fast online transactions and
market.
have been observed with the advent of network operating systems (NOS),
with ever decreasing price to performance ratio. The growth of the Internet
obtaining real time stock information, finding stock chart, news and
research on internet that can help you find the right investment strategies,
servlet. The servlet runs directly in the Web server and does not need to
fork off a new process. They can live on between sessions, can
platforms and Web servers. Servlets are most commonly used, however, to
programs.
The beauty of servlets is that they execute within the Web server's
process space and they persist between invocations. This gives servlets
written in Java, servlets are far less likely to crash a Web server than a C-
based NSAPI or ISAPI extension. Servlets have full access to the various
Java APIs and to third-party component classes, making them ideal for use
Glossary
r
Client- A system of two or more computers in which at
e
Servlet A servlet is a Java program embedded within a
structure Java program. User submits request to Java servlets, and servlets
will fetch information from Internet or from database files and create a
Through this system, user can monitor and compare price changes, trade
stocks, manage portfolio, get real time information about stock and
market.
the back engine. User may check a number of them that are the most
up/down during a period of time in the past. By just click a button, the
given number of stocks' symbols and price changes will be listed in the
ascending order.
The twenty stocks that are chosen to be checked are: DELL, IBM,
ORCL, MSFT, CSCO, INTC, SUNW, LU, EMC, GE, NT, AOL, PALM,
through the system: (1) Real time Stock Information (2) Stock price charts
(5) Related news. User will get all the useful information by giving the
stock system.
his/her own portfolio, which will keep all the information about the
cash, available margin, account value, stock value, buying power, pending
money and holding stocks), transaction history and open orders. The
investors can access their personal account and get all the information
Trading Stock.
User can exchange stocks via the system. The system is designed to
protect investors from fraud. Each user will be asked to input their account
name and his/her password. If the login/password is verified, the use can
enter the portfolio, otherwise, the login request will be denied. Users can
the open orders periodically. For market orders, the final deal price will
be the last trade price of the real market, and the transaction will be
lower than the market price (or your selling price is higher than the
market), your order cant be completed until the market price meets your
price. Otherwise, your order will be complete as soon as possible, and the
check all the open orders in the system and try to accomplish the orders. It
will periodically check open orders in the system. Check the real time
market price of the stock. If the price is better than the user request, the
order will be fulfilled with this market price, else the order will remain
compare the price changes, and then obtain a number of stocks that are the
most up/down during a period of time in the past. After that, the given
ascending order.
SYSTEM DESIGN OVERVIEW
System Organization
requests via the web server over to the Java servlets reside on the server
PC. Those servlets will access the database files or access information on
browser.
System Flow
User inputs all required information into the web browser and then
submits the request. The request will be sent to the Java Servlets reside on
the server PC. Once a request is received by the servlet, the servlet will
maybe access the database files or retrieve the information from the
Internet. In the end, the servlet will generate a dynamic homepage sending
back to client web browser. User will get all needed information on the
web browser.
Implementation Languages
In late 1995, the Java programming language burst onto the Internet
language with a standard set of class libraries. The promise of java is that
it will become the universal glue that connects users with information,
whether that information comes from web servers, databases, information
security and safety features are reassuring both to programmers and to the
users of the program. Java even has built-in support that make advanced
System Requirement
Server End
2. You must have Java Servlet Development Kit (JSDK) installed on
your machine.
3. A web server must be installed. You need to download Java Web
c:\program files\Tomcat-3.2.1.
User Inputs
System Outputs
will communicate with the server end database files and will return
relevant information.
System Files
additional system files to run the interface because the JAVA Virtual
Machine and the web browser handles most of the processing of servlets
Classes
the installation and tell you how to use the On line stock trading system.
Installation
Install server
your machine.
Copy all html files into C:\jy\trade\, and copy all image files into
C:\jy\trade\images\.
password.txt.
Start Server
Client
recommended. Once the server is launched, user can access the service
servers IP address.
User Instruction
Login manual
For users with an existing account, just enter his user name and
If user name and password are correct, stock center page will be
window pop up and tell user to fill in the user name or password.
If user name or password is not correct, system will tell user Failed to
If you are new to this system, you need to create a new account. Click
All four fields are required. Name and password will be used to login
Password is to let the user verify their password. This field must be
name has been used. Choose another one, and user can click Register
different from the first time, there will be an alert window pop up and tell
can do all kind of transaction through this page. The detail will be given in
Portfolio
Available Margin: The amount of money you can borrow from your
broker
Account Value: The total value of your account, including cash value
Buying Power: How much money you can spend to buy stock. This
Users can also view stocks they have, including Stock Symbol,
Trade
Buying Stock
Select radio button Buy, enter quantity for purchase, stock symbol
and stock price that willing for transaction, then choose order type,
In fact, anything enter in price field will be neglected when order type is
market. For Limit orders, a valid price must be provided, or the order
validating all the required. If any field is in valid, system will announce
Be sure to spend money you do have. Never spend money you dont
have. System will not accept your order. If user doesnt have enough
buying power to complete the purchase, system will tell user You don't
If everything is correct, system will insert this order into the trading
system. You will see a page telling you Your order has been successfully
initiated.
Selling Stock
Selling stock is same as buying stock. Select radio button Sell, enter
quantity for sale, stock symbol and stock price that willing for transaction,
field can be left empty. In fact, anything enter in price field will be
stock symbol or user tries to sell stocks he doesnt hold or user tries to sell
more stock than he have, system will tell user Your order is invalid.
There is an engine running background. This engine will check all the
open orders periodically. For market orders, the final deal price will be
the last trade price of the real market, and the transaction will be complete
as soon as possible. For Limit orders, if your buying price is lower than
the market price (or your selling price is higher than the market), your
order cant be completed until the market price meets your price.
Otherwise, your order will be complete as soon as possible, and the deal
Open Orders
You can view your open orders by click Open orders on pushdown
menu. You can view all information about your open orders including
If you feel regret about some open orders, just cancel these orders by
about all their account transaction history since the account was created,
Compare Stocks
User may compare a number of stocks among 20, which are the most
After the button is clicked, the given number of stock symbols and
Stock information
Quote menu, users can view different kind of information about stocks.
Real Market index
Click Refresh, user can view the real time market index, including
Dow Jones, Nasdaq, S&P 500. These index will reflect the overall market
performance.
Stock Quote
Click Quote on Quote menu, enter stock symbol in text area, and
then click GET. User can get real time stock information, including last
trade value, trading time, price change, Stock exchange volume and stock
User can enter multiple stock symbols at the same time, use space as
If user type in symbol that doesnt exist, system will tell user Error:
Stock Profile
Click Profile on Quote menu, enter stock symbol in text area, and
then click GET. User can get company profile from Internet, including
User can enter multiple stock symbols at the same time, type space in
Stock Chart
Click Chart on Quote menu, enter stock symbol in text area, and
then click GET. User can get stock chart of whole last year from
Internet. User can enter multiple stock symbols at the same time, type
Stock Research
Click Research on Quote menu, enter stock symbol in text area, and
then click GET. User can get stock research information from Internet,
multiple stock symbols at the same time, type space in between these
symbols.
If user type in symbol that doesnt exist, system will tell user Symbol
News
Click News on Quote menu, enter stock symbol in text area, and
then click GET. User can get news related to specific stock from
Internet. User can enter multiple stock symbols at the same time, type
space in between these symbols. Click stock symbol to read news about
this stock. If user type in symbol that doesnt exist, system will tell user
User can also review message related to this stock that post on Internet
by clicking message.
User logout
When user finishes all the transaction, just click Logout, user will
Microsystems Press
2. Cay S. Horstmann & Gary Cornell [1997], Core Java, Volume 2, Sun
Microsystems Press
Company
Prentice-Hall, Inc.
7. Brian Jepson, JAVA Database Programming, John Wiley & Sons,
9. Richard C. Leinecker and Ton Archer, Visual J++ Bible, IDG Books
10. Chairman Arthur Levitt, (1999). Plain Talk About On-line Investing.
11. Pratik Patel, Java Database Program With JDBC. Coriolis Group
Books, 1996