Algorithmic Trading with WebLogic Event Server
Paco Gomez's Blog |
January 30, 2008 12:14 AM
|
Comments (0)
In previous entries, I have discussed technical aspects of WebLogic Event Server and some exciting applications (1, 2). In the next entries I will write about Algorithmic Trading, probably the most common application in Complex Event Processing. I've had the opportunity to work with the WebLogic Event Server Engineering Team to make available the Algorithmic Trading Demo on CodeShare. The purpose of this demo is to illustrate some techniques used in this field, also known as Algo Trading, and how they are implemented in WLEvS. Source code, application binary and a ready-to-run Event Server domain is available for download here. Demo Description The Algorithmic Trading Demo implements common indicators used in automated trading. The application receives market data through a socket connection and calculates the following results: - Percentage change. Detects when the price of a stock changes more than one percent.
- Trend. Detects when the price of a stock fluctuates in one direction (up or down) more than two successive times.
- VWAP (Volume Weighted Average Price), the ratio of the value traded to total volume traded.
These ratios are calculated and displayed in real time on a dashboard for a basket of symbols. The dashboard also shows average latency and a distribution histogram of all latencies. The following is a screenshot of the dashboard: How to Run the Example The demo is distributed as two zip files: - "wlevs20_domain_algo.zip", it contains the WLEvS server with the demo deployed, ready to run.
- “algo_trading.zip”, it contains the Algorithmic Trading application code and the data feed application that sends market data to the server. The application is distributed as an Eclipse project that can be imported directly into an Eclipse Workspace.
WebLogic Event Server 2.0 needs to be previously installed in order to run the example. We are assuming “c:\bea” as BEA_HOME. If WLEvS has been installed on a different BEA_HOME, see the specific notes in the steps below. Follow these steps to run the example: - Unzip wlevs20_domain_algo.zip to %BEA_HOME%\user_projects\domains.
- Unzip algo_trading.zip to %BEA_HOME%\user_projects\modules.
- Start the data feed standalone application.
- Open a command window
- Change to %BEA_HOME%\user_projects\modules\algo_trading
- Run startDataFeed
- If BEA_HOME is not c:\bea, edit startDataFeed.cmd to specify a valid JAVA_HOME value.
- Start the WLEvS server with the Algorithmic Trading application
- Open another command window
- Change to %BEA_HOME%\user_projects\domains\wlevs20_domain_algo
- Run startwlevs
- If BEA_HOME is not c:\bea, edit startwlevs.cmd to specify valid JAVA_HOME, USER_INSTALL, BEA_HOME and WLEVS_DOMAIN_HOME values.
- Note: The data feed application can be started before or after WLEvS, with the same results.
- At this point, the data feed application should be sending market data to the WLEvS server and the CPU utilization should go up.
- On a browser window, open the following URL: http://localhost:9002/algo/dashboard.html. Push "start" button.
I will be providing more technical details about the demo in futures entries. Technorati Tags: CEP, WLEvS, Algo Trading
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
|