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)
2. 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
3. Product Architecture : Outline
QuoteCANVAS
Low Latency Order Management
Real-time Charting
Database & Event Broadcast
STOCK
EXCHANGE
TradeSERVO
Data Adapters
AlgoANALYTICS
DataRIVER
Backtesting and Analysis
STOCK
EXCHANGE
AlphaINVENTOR AlgoWRITER
RTTime
Real
Complex Events Studio Development Environment
MARKET
DATA
TradeBOT
HiD
Historical
Auto-Trading
AlphaBOX FRAMEWORK
CONFIDENTIAL
4. 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.
5. Complex Event Processing : Introduction
Event
Processor
Database
Stores
Stores Ordered Data Queries
Stores Data Stores Queries
Handles Queries Handles Data
Request/Response Model Subscribe/Notify “Push” Model
Synchronous Asynchronous
Static Data Continuous Data
6. 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
7. Complex Event Processing : Trading Example
• DBMS based approach to Data Mining & Analysis
RTTime
Real
INSERT Q
MARKET U
DATA TRADE BUY/SELL STOCK
DB E LOGIC EXCHANGE
HiD
Historical
INSERT R
Y
UPDATE
Major Bottleneck
Market data is stored first and then a query is run from the trade logic, very slow !
CONFIDENTIAL
8. Complex Event Processing : Trading Example
• Event Stream based approach to Data Mining & Analysis
TRADE STOCK
EVENT
BUY/SELL EXCHANGE
RTTime
Real
INSERT
MARKET Data Event
DATA
Stream Stream
HiD
Historical
INSERT Post Processing
DB
UPDATE
Trade gets executed as soon as a “Trade” event arrives !
CONFIDENTIAL
9. 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
10. Trading Example (DBMS based approach)
Tick Table Second Table
-- --
Query : last 5 records Compute Average (a1)
-- --
Wait for DB update
-- --
Query : last 5 records Compute Average (a2)
-- --
-- --
-- Query : last record (LR)
A Trade
--
Occurs
--
-- Was this
IS LR <
false last
max(a1 BUY
instance
,a2)
?
Store Trade in Tick Compress
Table ticks to a
seconds
table
CONFIDENTIAL
11. Trading Example (CEP based approach)
AVG()
Buffer SEC (5 Length)
Buffer TICK (5 Length) AVG()
newSecond MAX()
A Trade Event Stream Stream Processor Trade() BUY
Occurs
newTick
CONFIDENTIAL
12. Trading Example (CEP based approach)
Event Processors/ Handlers
• OnNewBar() • OnNewLow()
RTTime
Real
INSERT • OnClose() • OnTick()
MARKET Data Event • OnPattern1() • OnVolumeSpike()
DATA Stream Stream
• OnPattern2() • Etc …
HiD INSERT
Historical • OnOpen()
• OnNewHigh()
• 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
CONFIDENTIAL
13. 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
CONFIDENTIAL