rice stock market simulator comp 415 final presentation rice

49
Rice Stock Market Simulator COMP 415 Final Presentation RICE

Upload: tyree-hardaker

Post on 29-Mar-2015

220 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Rice Stock Market Simulator

COMP 415 Final Presentation

RICE

Page 2: Rice Stock Market Simulator COMP 415 Final Presentation RICE

What is “Real World” Software Engineering?• Real projects require real structure and strategy• Hierarchical team structure• Division of labor• Planning, specifications, and documentation

Page 3: Rice Stock Market Simulator COMP 415 Final Presentation RICE

How does consulting work?

• Receive project requirements• Develop specifications• Verify specifications with customer• Develop prototypes• Provide demonstrations

Regular customer interaction is necessary

Page 4: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Technologies Involved

• Microsoft Visual Studio 2005 Team Suite Edition– C# .NET 2.0– ASP.NET 2.0

• Microsoft Windows Server 2003

• Microsoft SQL Server 2005• Microsoft Team Foundation

Server

• Microsoft Sharepoint• FIX 4.2

– QuickFIX open source implementation

• Log4Net

Page 5: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Industry Customer HBK Investments

Customer Representative: Matt Jeanes, Rice ‘06

Page 6: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Who is HBK?

HBK is an investment management firm:• Employing approximately 325 individuals around the

world• Based in Dallas, TX with branches in New York,

London, Tokyo and Hong Kong

Established October, 1991• $13B in capital under management• Ranked in the top tier of large, successful hedge

funds• Generated a compounded annual return of 14.68%

since inception to June 2006

Page 7: Rice Stock Market Simulator COMP 415 Final Presentation RICE

What is a Hedge Fund?• Similar to mutual funds…

- Run by an investment management firm (“fund manager”)

- Investors “pool” their money together into one “fund”

- The fund manager invests the money based on one or more strategies

• …with some key differences- Can invest in broader range of strategies and

financial instruments (e.g., short selling, derivatives)

- Limited in the number and types of investors that can invest

• HBK pursues a multi-strategy trading approach

Page 8: Rice Stock Market Simulator COMP 415 Final Presentation RICE

What comes to mind when you think about working for a financial firm?• This…?

Page 9: Rice Stock Market Simulator COMP 415 Final Presentation RICE

What comes to mind when you think about working for a financial firm?• Or this…?

Page 10: Rice Stock Market Simulator COMP 415 Final Presentation RICE

22% of HBK’s personnel work in technology!

Management Committee5%

Front Office (Trading, Quant Research etc)

35%

Technology22%

Legal & Compliance, Audit, Risk etc.6%

Admin, HR & Recruiting8%

Operations & Accounting24%

Page 11: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Why does a hedge fund need all these technical folks?

Software Development

• Decision support tools for trading, risk management, portfolio analysis, accounting, etc.

• Computationally intensive

• Very low error and downtime tolerance

Datafeeds & Databases

• Multi-TB databases

• Millions of updates every day from hundreds of sources around the world

• Tools for cleaning, monitoring, management, and reconciliation

Information Technology

• Design, build, deploy, and manage global network, server, and workstation infrastructure

• Work with users to improve productivity

• Automate systems management tasks

Page 12: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Quick Facts…

• We have more servers than we do staff!• Our total data capacity is approx 40 terabytes with

usage growing at around 10 gigabytes per day.• Our databases maintain around 156 million historical

prices from over 26,000 issuers. • Our systems programmatically price over 170,000

options each day.• Real time prices require DS3 (45Mbps)

Page 13: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Our Technology “Toolkit”

• Most of our systems and tools are Intranet-aware- ASP.NET 2.0 , IIS

• Applications- Visual Studio 2005, C++, C#, .Net Framework

• Infrastructure- Service-oriented architecture, Web Services, XML / XSLT

• Database- SQL Server 2000 (replicated and clustered), DTS

• Operating Systems- Windows XP, Windows Server 2003

• 3rd party tools and technologies

Page 14: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Technology Initiatives

• Two tiers -> n-tiers• Direct market access• Better user experience – C# GUIs for trading• Expanding data coverage and capability• Straight through processing• Cash management system• Personalization technology • Infrastructure improvements

- Gigabit networking, WAN optimization, Voice-over-IP

- Blade servers and Storage Area Networks (SANs)

Page 15: Rice Stock Market Simulator COMP 415 Final Presentation RICE

How has the project evolved?

• Hedge Funds operate on the world’s stock exchange systems

• Testing trading strategies could be costly on the real market

• HBK looked to Rice’s COMP 415 class for an alternative

Page 16: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Introduction to Stock Exchanges• Exchanges themselves have very simple behavior

– Two actions• Buy (Bids)• Sell (Offers)

– Parameters• Symbol• Volume• Price

– Transactions occur when all three parameters of a bid and offer match

Page 17: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Introduction to the Rice Stock Market Simulator• Programmatically mimic market function as closely as

possible• Ability to “replay” historical market data• Store bid, order, and transaction data in a database• User interface for interacting with the market

Page 18: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 19: Rice Stock Market Simulator COMP 415 Final Presentation RICE

HBK’s New Specifications

• Fill Participant– Controlled by an ASP.NET GUI

• Extend the functionality of the Human Participant– Implement dynamic button configuration

• FIX Protocol Communication

Page 20: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 21: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Fill Client

• What is a fill client?• What were the requirements?

– Configurable fill parameters• Size of a Fill (Full, Random, Integer)• Time between Fills (Random, in ms)

– Load parameters from configuration file– Change parameters on the fly from a GUI– Save the modified parameters to a file

Page 22: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Fill Client Behavior

• If an order enters the fill client system, it will be filled– Other clients may be acting on these orders– Generate partial fills after the desired delay for the

desired amount– When to place the next partial fill?

• Identical orders?– Market makes no distinction between orders for the

same stock symbol at the same price– But all identical orders must be filled eventually– So the fill client needs to make sure it doesn’t lose

any of them

Page 23: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Fill Client Algorithm

• Each new order generates one “unit” of demand from the fill client for the given stock at the given price– Two bids for the same stock at the same price ->

twice as many partial fills• Each partial fill has a “target order”

– The market does not guarantee that the partial fill will transact with its target order

– Fill client should add a “target order” back to the order queue when the associated partial fill is removed

Page 24: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 25: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 26: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Financial Information eXchange Gateway

• We want to realistically simulate a stock exchange• FIX: an industry standard communications protocol• FIX Gateway for any system to connect to RSMS

Page 27: Rice Stock Market Simulator COMP 415 Final Presentation RICE

QuickFIX Engine

• Open source implementation of the FIX protocol• Several valuable features:

– Object oriented design– Logging– Error Checking– Message Checking

Page 28: Rice Stock Market Simulator COMP 415 Final Presentation RICE

How are Orders managed for a client?• Listing of orders associated with each client• Quote Server interaction

– Transaction listener

Page 29: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Processing Node Structure

• Easy interface for increased functionality• Market Validation Rules

– Enhanced simulation of Market behavior– Retrieved from Market– Rules

• Tick Size• Lot Size• Valid Stock

Node 1 Node 2 Node 3

Page 30: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Live Demonstration

Page 31: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 32: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 33: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 34: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 35: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 36: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 37: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 38: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 39: Rice Stock Market Simulator COMP 415 Final Presentation RICE
Page 40: Rice Stock Market Simulator COMP 415 Final Presentation RICE

ASP.NET Client

• Fill Configuration– Fill Size– Time between Fills

• Statistics– Active users– Stocks

• User Management– Add, modify, delete users– Only people classified as “managers” can do this

Page 41: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Human Participant

• GUI Redesign– Order form moved from popup to static on left

side of the GUI– Post bid/Post offer/Create Button forms combined

into one

Page 42: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Human Participant

• Dynamic Buttons– Create new buttons given parameters

• Stock Symbol• Volume of Stock• Stock Price

– All or some of the fields may be filled out• Blank fields filled in when button is clicked

– Buttons may be modified or deleted

Page 43: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Human Participant Demonstration

Page 44: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Performance

• Throughput of Bids/Orders• Capacity for Simultaneous Connections

Page 45: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Fill Client Performance

100 Orders, 500 Shares

0

5

10

15

20

25

30

35

40

Time

Tra

nsa

ctio

ns

per

Sec

on

d

Page 46: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Fill Client Performance500 Orders, 500 Shares

0

5

10

15

20

25

Time

Tra

ns

ac

tio

ns

pe

r S

ec

on

d

Page 47: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Fill Client Performance

1000 Orders, 500 Shares

0

5

10

15

20

25

Time

Tra

nsa

ctio

ns

per

Sec

on

d

Page 48: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Benefits of the RSMS System

• Allows trading strategies to be tested on historical data– Simulated Market Time allows long histories to be

run at a higher velocity• Fill strategies can be developed using a feedback loop

generated by interactions with real data running in sync

• Allows developers to test trading software under simulated market conditions

Page 49: Rice Stock Market Simulator COMP 415 Final Presentation RICE

Special Thanks to HBK Investments

Questions?