90 likes | 298 Views
StreamBase Case Study Automated Trading. I. The Problem. Background: Successful Buy-side firm successful in conventional buy/hold strategies wanted to apply learnings to intraday trading Business Drivers:
E N D
I. The Problem • Background: • Successful Buy-side firm successful in conventional buy/hold strategies wanted to apply learnings to intraday trading • Business Drivers: • Making money: from short-lived trading opportunities in real-time market data feeds, and reducing transaction costs • Customer retention
The Approach: Application Overview • Data/events stream from real-time market data feeds • Data is filtered (watch-list) and processed • Trading rules/logic applied to real-time streams to make buy/sell decisions • Spread pairs, Bollinger bands, limit rules • Store and retrieve latest market data • Maintain execution state of trades, check continuously • Buy/sell orders sent to execution engine • Recent addition of block-trading and best execution application • Run algorithms across multiple liquidity sources to determine best price and optimize execution (price, transaction fees)
Event Sources, Types, Interfaces • Event sources: • NYSE Arca • Nasdaq • Instinet • 15 other global exchanges • Event types: • Message format: contains string, int, datetime, Boolean, and decimal/float data types • Market data: e.g. Symbol, bid_price, ask_price, bid_size, ask_size, last_price, last_size, timestamp • Daily market condition data: symbol, market cap, sector, 52-week • Message rates: • Market Data providers: up to 10,000 messages per second. • < 20 ms from input to output • Interfaces: • Tibco EMS, MS SQL Server adapter. • .Net adapter for EMS leveraging existing Microsoft/.Net development work
Example of Application Logic • Query table look-up and filter for watch-list • Calculate and store Bollinger Bands/moving average, (Aggregate operator) • Apply Bollinger rule: current price much reach lower band (Filter) • Apply 52-week rule: current price must reach 52-week low (Filter) • Apply daily volume rule: quote must reach 150% of daily volume (Filter) • Union all orders and add timestamp • Output stream with orders to submit
Example Code Create order if the last_price on the QuoteAndMarketRef stream is less than the 52 week low. CREATE STREAM Low52WkOrders AS SELECT symbol, timestamp, watchlist_position_threshold as position_threshold, "off" AS new_order_type, bid_price AS new_order_price, int(watchlist_position_threshold / bid_price) AS new_order_size FROM QuoteAndMarketRef WHERE last_price < w52_low;
III. Results, Costs and Benefits • Application in production • Built by in-house staff in 30 days (2-3 people, including QA/testing). • Estimated to take 8 months with team of 3-5 people via custom-coding • Easy for non-expert developer to build, understand, and modify • ROI • Trading profitability (not disclosed) • Customer retention and new acquisition • Deployed in 1/8 the time and resources vs custom-coding • Visibility to whole organization for event/application flow
IV. Conclusions • Alternative approaches would not have offered value of StreamBase • Custom-coding (too costly in terms of time/resources) to get high performance • Full-blown order management system (OMS) too expensive and too feature-rich • Lessons learned • Strong business drivers (not just an IT project) • Up-front architectural planning paid-off in time-to-deployment