Transcript
Page 1: Vermittlungsauftrag privat-engl 1

sequences, along with actions totake if the sequence is detected.In some CEP systems, such rulesmight be described either in aCEP language or a graphicalmodeling tool that is accessible tonon-developers. Recently there hasbeen considerable focus on theevidence that CEP adoption isbeing driven as much by thebusiness as by technologists.Graphical tools that targetbusiness users, such as traders, andenable them to create andcustomize trading strategieswithout the need to program is akey contributor to thisphenomenon.

Event-based rules respond whenthe data values in received eventsare relevant to the parameters of arule. For example, a new eventmay cause the recalculation of acomplex analytic or may be part ofthe detection of a pattern thatindicates a statistical arbitrageopportunity has been identified.

Figure 1 is a simplified example ofa CEP rule that monitors theEUR/GBP cross - looking for a

trading opportunity. This patternrequires the continuous re-calculation of analytics, such as themoving average of EUR/GBP andthe EUR/GBP velocity (i.e. if it isheading up, down or leveling).When an opportunity is detected,orders are placed – but if thesituation reverts mid-trade, theseorders are automatically cancelled.

Connecting to Multiple FX Venues

The FX market is characterized byliquidity that is spread across arange of different trading venues.These trading venues includebank-provided liquidity pools, aswell as aggregators and ECNS,such as EBS, Reuters, Currenex,Hotspot and FXAll’s Accelor. Thegrowth in the number of tradingvenues has led to increasingliquidity fragmentation. This hasdriven a number of newrequirements in tradinginfrastructure and CEP has beenshown to be an ideal technologyto meet these requirements.

The first requirement is the strongdemand from trading groups to be

able to connect to not just onepool – but to multiple, if not allpools – to get a broader picture ofwhat is happening in the marketand to seek out best price andliquidity. Trading groups do notwant to use different tradingsystems simply because of theirconnectivity to different pools;they want to use the same tradingsystem and connect to multiplevenues concurrently. Since a CEPengine treats all market updates as“events”, events from multiplevenues can easily be combinedwithin the same platform.

To enable open connectivity, FXliquidity pools now provideelectronic applicationprogramming interfaces (APIs) toenable trading systems to connectto them, receive market data andplace orders. However, one FXcomplexity is that, unlike equitieswhere the FIX protocol is rapidlynormalizing the means ofconnecting to trading venues, allFX APIs do not yet adhere to astandard. This requires anelectronic trading platform toimplement connectionsindividually rather than rely on aunifying protocol. Strong CEPplatforms will mask thecomplexity of different APIs andprotocols by providing anintegration layer that enablesconnections to multiple tradingvenues. Within this layer adaptersconvert the incoming market datainto events that the CEP platformcan consume. Similarly, eventsthat are generated by the CEPplatform, indicating orders to beplaced on a particular venue, areconverted by adapters into orderplacement messages that theparticular trading venue canunderstand. In this way theintegration adapter layer is able to

UNDER THE MICROSCOPE >>>

Leveraging ComplexEvent Processing forAlgorithmic Trading in FX

78 | april 2008 e-FOREX april 2008 e-FOREX | 79

Dr John BatesFounder and General Manager,

Apama Division, Progress Software

Over the last year, a strongbusiness case for automatingforeign exchange trading hascontinued to drive the adoptionof advanced trading technology.The FX market is characterizedby fragmented liquidity - causedby an ever-growing set ofliquidity pools and ever-increasing volatility. Within thisenvironment, a growing numberof firms are interested inlowering the cost and enhancingthe profitability of FX trading,using techniques such asalgorithmic trading. This interestcan range from augmenting spotdesks with automated tradingsystems that execute trades and

manage positions, to highfrequency algorithms that seekout and act instantly on tradingopportunities in the fragmentedliquidity environment. In the highfrequency world, traders realizethat algorithms must act onopportunities before anincreasing number ofcompetitors who are aiming toget there first. This growinginterest in trading automationcomes at the same time asmanaging trading risk is verymuch at the fore-front ofthinking, given the marketclimate and some high profilenew stories. Automating andstreamlining the processes ofbacktesting, tracking riskexposure in real-time andautomatically hedging to managerisk, are all techniques thatinstitutions now need toincorporate into their algorithmictrading plans. This articlediscusses a new technology thathas been deployed successfullyto address these business driverswithin the FX market. Thetechnology is Complex EventProcessing (CEP).

Complex Event Processing

CEP is about monitoring,analyzing and acting instantly onpatterns that indicateopportunities or threats to thebusiness. In FX, this can bemonitoring market data from FXvenues, detecting patterns thatindicate trading opportunities andautomatically placing andmanaging orders to take advantageof these opportunities. CEP in FXcan also involve monitoring risklevels as trades are placed andpositions change and, if riskthresholds are exceeded, hedgingpositions automatically.An “event” in CEP represents anyupdate – such as a new quote froma trading venue or a news articlearriving on a newsfeed. Theseevents are fed into a CEP engine,via an integration adapter layerthat can connect to a wide varietyof heterogeneous services. TheCEP engine is the brain of themonitor-analyze-act functionality.

The patterns for which the CEPengine will monitor, analyze andact are described as event-basedrules, as illustrated in Figure 1.Rules can contain arbitrarilycomplex temporal and logical

Figure 1: An example FX algorithmic trading rule

Page 2: Vermittlungsauftrag privat-engl 1

translate between events andmarket data and orders.

Using events as the basic buildingblocks of trading strategies alsoyields advantages beyond straightFX. Cross-asset class trading caneasily be implemented sincemessages from equities, derivativesand fixed income systems can alsobe treated as “events”. CombiningFX events with other asset classescan enable applications such ascross-border trading, using FX as areal-time conversion for dual listedinstruments.

In addition to other asset classes,the ability to connect to, monitorand respond to patterns in real-time news feeds is another way inwhich CEP is being used forcompetitive advantage by the FXtrader. For example, an algorithmmay buy Swiss Franc crosses onnews of a conflict – reacting beforehumans can. News may also becombined with analysis of othermarket data – alerting a traderwhen a news article seems to beaffecting a particular currency pair.

FX Market Aggregation, LiquiditySensing and Smart Order Routing

Most traders are not satisfied tosimply connect to the FX venues;they want to aggregate theinformation coming from theliquidity pools – in order to gain aunified view of the market. Ratherthan watching each poolindividually, an aggregator createsa “rolled up” view of the marketfor each currency pair. Forexample, the top 3 best bids onEUR/USD could be on EBS,whereas the next best could be onFXAll Accelor and so on. Anaggregated view combines thisinto one super book.

Aggregation is a computationallycomplex task, which increases asmore liquidity pools are addedinto the mix. Every time one ofthe pools changes the aggregationalgorithm must detect this,consider whether the changeimpacts the aggregated marketview for a particular currency pairand make any necessary changes.This must be done with theminimum possible latency. CEPprovides a powerful platform foraggregation. Event-based rules canbe used to instantly detect and acton FX market changes that requirefine-grain reorganizing of theaggregated view.

With an aggregated view comesthe ability to immediately sensebest liquidity and pricecombinations in response to anorder from a client or anautomated algorithm. The CEPsystem is able to monitor andanalyze the aggregated view toidentify the right liquidity androute orders to the appropriatetrading venues to capture thatliquidity. It is critical that thisliquidity sensing and smart orderrouting happens with minimallatency – before a competitormoves first. Given that low latencyactions are the foundation of CEPmakes such technology ideal forthis kind of application.

High Frequency FX algorithms

Traders are increasingly interestedin developing proprietaryalgorithms that can capitalize onan aggregated view of the FXmarket. These algorithms monitorfor particular tradingopportunities in the market andupon detection, they are able toautomatically place and manageorders in one or more FX venues.

One key driver that is evolving inalgorithmic trading as a whole isthe desire to differentiate fromother players. It is becomingapparent that buying pre-builtalgorithms, built by third parties,does not provide the edge thattraders need to competeeffectively. There is a growingrecognition within many firmsthat if an algorithm is available toeveryone then the competitiveadvantage achievable is limited.Traders often want to eithercustomize an existing algorithm ordevelop a completely new one.This is accentuated by the factthat the market is continuouslyevolving and new opportunitiesmay be spotted at any time. It isthe first-mover that capitalizes onsuch opportunities – so buildingand customizing algorithmsrapidly is also key.

The technology requirements toenable such a scenario arecomplex. Analytics need to becontinuously recalculated,complex logical and temporalconditions need to becontinuously monitored, andtrading actions need to be taken,such as placing orders. All thismust take place with the minimalpossible latency – as otherwiseanother algorithm may move firston an opportunity. CEP is anapproach that has been proven todeliver these complexities, alongwith the advantage that complexscenarios are easy to develop, sincethe platform has been designedwith this in mind.

Real-time Risk Management andBacktesting

Increasing the automation andproductivity of FX tradingthrough algorithms can also

80 | japril 2008 e-FOREX

UNDER THE MICROSCOPE >>>

Page 3: Vermittlungsauftrag privat-engl 1

increase the potential risk exposure. Tradinginstitutions know that managing risk is critical– and in this fast-moving environment beingable to check risk before making tradingdecisions is the optimal solution. To this endCEP is being used to create real-time risk rulesthat execute “in-band” with the algorithmictrading rules. Risk rules may check, forexample, that the quantity being traded doesnot exceed a certain level for a certain trader.Also, real-time analytics can be used tocalculate, on an on-going basis, the value-at-risk for FX positions. If the risk exceeds acertain threshold, actions to auto-hedge thepositions through trading can be automaticallyexecuted.

In order to ensure that as many potential risksituations are covered, as well as that tradingalgorithms actually work as predicted, thetechnique of backtesting is used. CEPplatforms enable sequences of historical eventsto be used, in conjunction with marketsimulators to accurately test how algorithmswould behave in certain real situations. Ofcourse, recent events make clear that onecannot always predict the future with datafrom the past. Thus, key to any quantitativestrategy – in FX or any other asset – is theability to respond to market circumstancesquickly with new strategies that accommodatenew market realities.

Conclusions

Competitive advantage in FX trading is beinggained by innovative firms that use the latesttechnologies in new and exciting ways. The FXalgorithmic techniques that have evolved, suchas market aggregation, rules-based algorithmictrading, smart order routing, real-time riskmanagement and trading on the news, aretailored to the characteristics of the FX market.As introduced in this article, the technologychallenges of connecting to a wide variety ofFX venues and implementing these algorithmictechniques with low latency performance arebeing successfully addressed through ComplexEvent Processing. And more excitingdevelopments are on the way - stay tuned!!

UNDER THE MICROSCOPE

AD