Date post: | 26-May-2015 |
Category: |
Documents |
Upload: | monicasingh |
View: | 351 times |
Download: | 0 times |
TECHNOLOGY PREVIEW
Complex Event Processing
CONFIDENTIAL
CONFIDENTIAL
Introduction : AlphaBOX
About AlphaBOX
We have experienced a very wide variety of customers in our past allowing us to notice the complete spectrum of issues and nuances of almost all trading(quant) desks . We also noticed that each hedge fund or CTA begins with same sets of IT assumptions and tools before beginning their operations. Once they reach a certain maturity, it is common for them to have some custom development over their tools.
The above practice is heavily harmful to future projects as several different tools are used which may or may not be designed for the same purpose.
AlphaBox is a suite of data-centric algorithmic trading applications which is flexible enough to support trading styles like HFT (High frequency trading) , Statistical Arbitrage, Scalping , Swing trading etc.
We have designed the core to be quick, lightweight and scalable. Our entire architecture is specialized for asynchronous ,real time ,low latency data processing commonly known as CEP (complex event processing)
CONFIDENTIAL
Product Architecture : Outline
STOCK EXCHANGE
MARKET DATA
RT Real Time
HiD Historical
STOCK EXCHANGE
Dat
aRIV
ER
Dat
abas
e &
Eve
nt
Bro
adca
st
AlgoWRITER Development Environment
AlphaINVENTOR Complex Events Studio
AlgoANALYTICS Backtesting and Analysis
QuoteCANVAS Real-time Charting
TradeBOT Auto-Trading
Trad
eSE
RV
O
Low
Lat
ency
Ord
er M
anag
emen
t
Dat
a A
dap
ters
AlphaBOX FRAMEWORK
Complex Event Processing : Introduction
• Event : An event is a piece of data that represents that something happened in the real world. Events flow in streams within any ordered data set
• Example : 100 Shares of IBM were Bought, IBM price changed by X points, a client A accessed server B.
• Complex Events : (a) IBM share falls 1 point and rises 4 points in 5 seconds. (b) 4 charges against same credit card from different companies within 1 minute.
Complex Event Processing : Introduction
Database Stores Ordered Data
Event Processor
Stores Queries
Stores Data Handles Queries Request/Response Model Synchronous Static Data
Stores Queries Handles Data Subscribe/Notify “Push” Model Asynchronous Continuous Data
CONFIDENTIAL
Complex Event Processing : Introduction
• Key Advantages – Process data “in-stream” without any requirement to store. Same
difference between PUSH email and POP3
– Handle “imperfections” in the stream instantaneously
– Distributed & Scalable : think of data streams which can flow and merge at pre-designated nodes.
– Dynamic Runtime Querying is possible
– High Speed Pattern Recognition via Rete type algorithms
CONFIDENTIAL
Complex Event Processing : Trading Example
• DBMS based approach to Data Mining & Analysis
MARKET DATA
RT Real Time
HiD Historical
DB INSERT
INSERT
UPDATE
TRADE LOGIC
QUERY
BUY/SELL STOCK EXCHANGE
Major Bottleneck
Market data is stored first and then a query is run from the trade logic, very slow !
CONFIDENTIAL
Complex Event Processing : Trading Example
• Event Stream based approach to Data Mining & Analysis
MARKET DATA
RT Real Time
HiD Historical
DB
INSERT
INSERT
BUY/SELL STOCK EXCHANGE
Data Stream
Event Stream
TRADE EVENT
UPDATE
Post Processing
Trade gets executed as soon as a “Trade” event arrives !
CONFIDENTIAL
Complex Event Processing : Trading Example
Sample Trading Algorithm
• If last traded price of IBM falls below the average price of last highest(5 seconds,5 trades) then buy 1000 shares IBM.
• Close the trade after 10 seconds.
We will walk through this example using conventional approach and the CEP approach
CONFIDENTIAL
Trading Example (DBMS based approach)
--
--
--
--
--
--
--
--
--
A Trade Occurs
Store Trade in Tick Table
--
--
--
--
--
Tick Table Second Table
Compress ticks to a seconds table
Compute Average (a1) Query : last 5 records
Query : last 5 records Compute Average (a2)
IS LR < max(a1
,a2)
Query : last record (LR)
Was this false last instance
?
BUY
Wait fo
r DB
up
date
CONFIDENTIAL
Trading Example (CEP based approach)
A Trade Occurs BUY
Event Stream
newSecond
newTick
Stream Processor
Buffer SEC (5 Length)
Buffer TICK (5 Length) AVG()
AVG()
Trade()
MAX()
CONFIDENTIAL
Trading Example (CEP based approach)
• As you can see each event stream can generate any type and number of events.
• Those events are processed and handled at each level.
• This way, as the data flows through the structure, processing occurs instantaneously and asynchronously.
• This approach makes pattern recognition highly efficient
MARKET DATA
RT Real Time
HiD Historical
INSERT
INSERT
Data Stream
Event Stream
• OnNewBar() • OnClose() • OnPattern1() • OnPattern2() • OnOpen() • OnNewHigh()
• OnNewLow() • OnTick() • OnVolumeSpike() • Etc …
Event Processors/ Handlers
CONFIDENTIAL
AlphaBOX
• Key Advantages – CEP based scalable structure
– Low Latency Message driven Processing
– Hybrid Stream + DBMS system
– In-Memory Processing
– Multicore utilization
– Applicable to almost ANY type of real-time data streams
– Highly extensible
– Real – Time Application in truest sense