Apama 10.3.1 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Order Management | Exchange simulation platform
 
Exchange simulation platform
A market exchange commonly consists of an order management unit and a matching engine. The order management component receives orders and subsequently rejects or accepts them based on its validation conditions. Accepted orders are either placed in the order-book or directly passed on to the matching engine for immediate transaction. The matching engine carries out executions of the orders in the book in accordance with the market's trading mechanism.
The Exchange Simulator bundle contains the code base for the simulation platform. The Exchange Simulator bundle supports creating a basic instance of the exchange simulator where only the minimal set of parameters. More advanced users may choose to create the ExchangeEngine component directly for more direct control. An event needs to be routed that identifies the symbol, service, market, and exchange being used for market data and the order management (OMS). This event also includes a fixed latency value which is added to all operations and a flag for choosing whether a simulated order flow should be generated or not and also another flag identifying whether DataViews should be created to publish market data events.
The exchange simulation platform can be described in terms of its two fundamental components, the exchange engine, and the order book.
Exchange engine
The exchange engine handles all order management requests and communicates with the order-book to decide the fate of a request and execute required actions. The exchange engine contains the order handling logic and also the matching logic. All book related activity is contained within the order-book component which is visible to the exchange engine. The matching logic is based on price. The exchange engine is also responsible for calling on publishing objects to send out events containing the depth of the order-book at the end of handling any request which has been accepted and executed. The exchange engine also triggers publishing of trade data.
Order book
The order-book maintains a complete record of the orders available for trading in the market. The order-book consists of a buy (bid) and a sell (offer) side, where each buy or sell order indicates the amount and price of an asset available for trade. In the basic case, orders are prioritized based on their price and time of arrival. Orders with more competitive prices are placed on the top, followed by orders at same price but with a later arrival time, and consecutively, orders with less competitive prices.
Exchange Simulator example
The Exchange Simulator bundle supports creating a basic instance of the exchange simulator where only the minimal set of parameters. More advanced users may choose to create the ExchangeEngine component directly for more direct control. The following is an example of an event routed to request a market with no latency, generate order flow, and set up DataViews.
route com.apama.oms.CreateBasicExchangeSimulator (true, "marketDataSymbol",
"marketDataService", "marketDataExchange", "marketDataMarket", "omsSymbol",
"omsService", "omsExchange", "omsMarket", 0.0, 0.0,
true, new dictionary<string,string>);
Note that the order flow simulator is mainly used for testing the system and demonstration purposes. Given an initial price and a set of other parameters which are all documented in the com.apama.oms.OrderFlowParams event, the data generator produces orders with prices based on a random walk. These orders are then amended or canceled based on the other user-supplied parameters. Setting these parameters on the fly is possible via the com.apama.oms.SimulateOrderFlow event.

Copyright © 2013-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.