University of Bridgeport CS-597: Advanced Problem in Computer Science -- Master Project Report -- September 28, 2001 ONLINE STOCK TRADING SYSTEM Project Advisor: Prof. Tarek Sobh Student: Yuming Bao, #469449 TABLE OF CONTENTS TABLE OF CONTENTS ABSTRACT INTRODUCTION AND BACKGROUND BACKGROUND OF ONLINE TRADING BRIEF PROJECT DESCRIPTION INTRODUCE JAVA SERVLET GLOSSARY SYSTEM FUNCTION OVERVIEW COMPARE PRICE CHANGES ACCESS STOCK PROSPECTUS ACCESS USER PORTFOLIO TRADING STOCK. THE TRADING ENGINE SYSTEM DESIGN OVERVIEW SYSTEM ORGANIZATION SYSTEM FLOW
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
University of Bridgeport
CS-597: Advanced Problem in Computer Science
-- Master Project Report --
September 28, 2001
ONLINE STOCK TRADING SYSTEM
Project Advisor: Prof. Tarek Sobh
Student: Yuming Bao, #469449
TABLE OF CONTENTS
TABLE OF CONTENTS
ABSTRACT
INTRODUCTION AND BACKGROUND
BACKGROUND OF ONLINE TRADINGBRIEF PROJECT DESCRIPTIONINTRODUCE JAVA SERVLETGLOSSARY
SYSTEM FUNCTION OVERVIEW
COMPARE PRICE CHANGESACCESS STOCK PROSPECTUSACCESS USER PORTFOLIOTRADING STOCK.THE TRADING ENGINE
SYSTEM DESIGN OVERVIEW
SYSTEM ORGANIZATIONSYSTEM FLOWIMPLEMENTATION LANGUAGESSYSTEM REQUIREMENT
Allow investors to retrieve the related information about some specific
stock. The following information about each stock can be obtained
through the system: (1) Real time Stock Information (2) Stock price charts
(3) Company Information of corresponding stocks. (4) Stock research and
(5) Related news. User will get all the useful information by giving the
stock system.
Access User Portfolio
Allow investors to access their own portfolios. Each investor has
his/her own portfolio, which will keep all the information about the
investment of the user, including account statement (including available
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
about their account.
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
customize their orders by choosing Action (Buy or Sell), Quantity(Shares
of stocks), Symbol(Stock symbol), price(the acceptable trading price) and
Order Type(Market or Limit). Background running 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
price will be the market price.
The trading engine
The engine is an always alive process running background. It will
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
open in the system.
Meanwhile, the engine is also continuously monitoring the price
changes of twenty selected stocks. According to users commands, it may�
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
number of stocks' symbols and price changes will be listed in the
ascending order.
SYSTEM DESIGN OVERVIEW
System Organization
The system organization for the project is as follows:
In general the clients (web browser such as Netscape) will send
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
the Internet, and then generate a response page to display on user's
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
perform corresponding function depend on the request type. The servlet
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
scene and gained instant celebrity status. JAVA is a portable programming
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
providers, and any other imaginable sources. The APIs permit a
programmer to create appropriate Graphical User Interfaces and
communicate with network services such as HTTP. Java has built-in
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
programming tasks, such as network programming, database connectivity,
and multithreading, more straightforward.
System Requirement
Server End
1. You must have Java Virtual Machine on your PC.
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
Server such as Tomcat from java.sun.com. Install them into c:\� �
program files\Tomcat-3.2.1.
Client End (User end):
IE4.0/Netscape 4.5 or up is recommended.
User Inputs
User interactivity will be a major function that will be required by the
on line stock trading system. Sometimes users will have to enter
information in form fields by using their keyboard or sometimes users will
need to use the mouse to click buttons, highlight choices, initiate
functions, and navigate the pages.
System Outputs
The outputs of the application will be generated dynamically by the
application according to the user's input and interactivity. The application
will communicate with the server end database files and will return
relevant information.
System Files
Besides the browser application, end-users do not have to have
additional system files to run the interface because the JAVA Virtual
Machine and the web browser handles most of the processing of servlets
and HTML tags.
Limitations and Restrictions
Users can encounter problems or limited functionality if they are not
using Netscape version 4.5 or later. The JAVA Virtual Machine is
available in an earlier version of Netscape but, tends to be unstable at
times which causes the computer, especially Power PC, to hang. It is
recommended that users should upgrade to a newer version of Netscape
that are available at the Netscape websites.
Classes
Class name Functions AchievedActivate Generate the reply page of opening ordersactv Generate the page body of opening orders delete Delete an opening order
dotrade Do the tradedow Generate the market index of the main
pageengine Check opening orders and 20 real time
stock price CheckStock Get stock price from stored file for
comparecheckActiveStock
Check stock price change by users �instruction
GetQuote Get real time quote data from internetGetValue Get real time stock market priceHistory Generate the history pagemainFrame Generate the main pagenewUser Create a new account for a new userOpenFile Open fileportfolio Generate page of portfolioport Get token from data file and prepare for
portfolioquote Get the real time stock informationtrade Trade stocksloginStock Login the stock center
USER MANUAL
Welcome to this User Manual. This manual will lead you go through
the installation and tell you how to use the On line stock trading system.� �
Installation
This program is modeled as Client-Server-Database three-tier model. � �
Install server
You must have Java Virtual Machine on your PC.
You must have Java Servlet Development Kit (JSDK) installed on
your machine.
A web server must be installed. You need to download Tomcat from� �
java.sun.com. Install it into c:\program files\Tomcat-3.2.1. Set up an alias
(virtual directory) trade, and then map it to the directory c:\jy\trade\.� � � �
Copy all java files into C:\jy\trade\Web-inf\classes\. Under this
directory, compile all the java files using javac *.java. � �
Copy all html files into C:\jy\trade\, and copy all image files into C:\jy\
trade\images\.
Make a directory c:\jy\trade\profiles, make an empty file named:
password.txt.
Now your installation for server end has finished.
Start Server
To launch the server, click C:\Program Files\tomcat-3.2.1\bin\
startup.bat; and then start the engine by command line: java engine x (x: