Ido Bercovich Dikla Mordechay Lilach Tesler Academic Advisor: Dr. Yuval Alovici Professional Advisor: Dr. Mayer Goldberg Trading Champions A Application D Design D Document
About the project Main System Requirements System Architecture Main actors Database Scheme User Interface Task List Contents
What is “” ? What is “Trading Champion” ? Our game demonstrates an Investment market which provides the players the ability to trade with other players, The game will be a funny and exciting investment game With the extra ability to learn about the real stock market. The game involving competition, strategy and luck. The game will be an online game in the social networking site Facebook.
Main System Requirements Buying stock with limit condition Buying stock with market condition Selling stock with limit condition Selling stock with market condition Adding new company Adding agent Adding news Register Add stock to favorite Remove stock from favorite
System Architecture
Main actors User User Stock Table Company Stocks Stock History News Bid Queue Ask Queue
Databases COMPANY STOCKS – every stock you can trade should be belonging to a cretin company and to a domain. USERS – the users that play the game. We have two types of users, a regular and an agent. USERS STOCKS TABLE – the users trade the stocks. We need to keep up with the data of which stock belong to which user and vice versa. NEWS – We will keep a newspaper which describe data that can affect the value of a specific company or even a domain BID QUEUE ASK QUEUE STOCK HISTORY
Database Scheme
Database Scheme - ERD
Database Details COMPANY STOCKS – Domain (Text) – the domain the company belongs to. – company name (Text) – the name of the company. – id (Integer) - a unique id. – general (Text) - general description of the company. – total exist (Integer) – the total amount off stocks the company has. – total buy for day(Integer) – how many users bought the stock today. – history table (Integer) – foreign key to USERS STOCK TABLE. – current value (Double) – the value of the stock. The value of the last deal that was made. USERS – Id (Integer) - a unique id. – Name (Text) – the name of the user. – money(Double) – the amount of cash the user have. – value (Double)- the amount of cash plus the total value of his stocks. – profit (Double)- the profit the user gained since he start playing. – stock table (Integer) – a foreign key to USERS STOCK TABLE. – favorite table (Integer) – a foreign key to USERS STOCK TABLE. – debts (Double) – when a user wants to buy a stock we need to check he has enough money for that. This field sums all the money the user will have to give if all of his ask requests will be executed. – is agent (Boolean)- is the user is an agent or a regular user.
USERS STOCKS TABLE – Id (Integer) - a unique id. – stock id (Integer) – a foreign key to COMPANY STOCKS table. – user id (Integer) – a foreign key to USERS table. – total (Integer) – the amount of stocks the user has from this company. – time(Time) – the time the deal was made. – price (Double) – the price the user paid for the stocks. – current value (Double) – the total current value of the stocks. NEWS – date(Time) – date of publish. – id (Integer) - a unique id. – headline (Text) - the headline of the article. – content (Text) – the content of the article. Database Details
BID QUEUE – stock id (Integer) - a foreign key to COMPANY STOCKS table. – user id (Integer) – a foreign key to USERS table. – count (Integer) – the amount of stocks to sell. – bid id (Integer) - a unique id. – condition (Text) – limit/market. – ASK QUEUE – stock id (Integer) - a foreign key to COMPANY STOCKS table. – user id (Integer) – a foreign key to USERS table. – count (Integer) – the amount of stocks to buy. – ask id (Integer) - a unique id. – condition (Integer) - limit/market. STOCK HISTORY – stock id (Integer) - a foreign key to COMPANY STOCKS table. – rate (Double) – the price the user paid in the deal. – time(Time) – the time the deal was made. Database Details
Portfolio hit the professional the market paper start trade friends rank Main screen
Buy stocks
favorite Portfolio
Trade
Learning the market of trading Design the database Design the process Writing ADD Design a small “world” for trading Learning Erlang learn and choose database to work with learn about the Erlang web server learn the interface between them Learning the web architecture Writing and debugging the database Writing the application logic Creating GUI Interfacing with facebook Debugging first version Checking the overload handling [Erlang ability] Task list