Finally had the time to post the source code for the order matching engine. You can check it out here.
To compile, best is to create an Eclipse C++ project and add all the source files. You must already have the following libraries installed: ACE, Boost, QuickFIX, log4cxx, and pugixml.
To run, make sure the config/ folder is in the same directory as the executable, modify the configuration files as appropriate and simply type in the name of the executable in the command line.
For testing, I used the Banzai GUI trading app that comes bundled with QuickFIX/J to connect with the matching engine and to submit test orders.
Saturday, February 13, 2010
Rex - an Order Matching Engine
An exchange simulator/order matching engine written in C++. The complete code will be posted later.
Briefly, it creates a thread per connection to handle incoming FIX messages. The messages are then queued, based on the security, to an order book that handles that security. Each order book runs in its own thread and does the actual matching. All outgoing messages are then sent in separate connection specific threads to the originator.
Briefly, it creates a thread per connection to handle incoming FIX messages. The messages are then queued, based on the security, to an order book that handles that security. Each order book runs in its own thread and does the actual matching. All outgoing messages are then sent in separate connection specific threads to the originator.
My Reading List
Originally posted 10/21/2009
Design Patterns
C++
Trading
Design Patterns
- Dsign Patterns: Elements of Reusable Object-Oriented Software
- Pattern-Oriented Software Architecture Volume 2: Patterns for Concurrent and Networked Objects
- C++ Network Programming, Volume I: Mastering Complexity with ACE and Patterns
- C++ Network Programming, Volume 2: Systematic Reuse with ACE and Frameworks
- Unix Network Programming, Volume 1: The Sockets Networking API (3rd Edition)
- UNIX Network Programming, Volume 2: Interprocess Communications (2nd Edition)
- TCP/IP Illustrated, Volume 1: The Protocols
C++
- C++ Primer (4th Edition)
- The C++ Standard Library: A Tutorial and Reference
- Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition)
- More Effective C++: 35 New Ways to Improve Your Programs and Designs
- C++ Coding Standards: 101 Rules, Guidelines, and Best Practices
- Effective Java (2nd Edition)
- Java Concurrency in Practice
- Core Java(TM), Volume I--Fundamentals
- Core Java, Vol. 2: Advanced Features
Trading
- Reminiscences of a Stock Operator
- Japanese Candlestick Charting Techniques
- Mastering the Trade: Proven Techniques for Profiting from Intraday and Swing Trading Setups
- Trading Commodities and Financial Futures
- Market Wizards: Interviews with Top Traders
- The New Market Wizards: Conversations with America's Top Traders
Subscribe to:
Posts (Atom)