The Gateway to Algorithmic and Automated Trading

Alpha Grabber

Published in Automated Trader Magazine Issue 17 Q2 2010

One of the realities of electronic markets is that alpha opportunities are often transitory; a profitable market inefficiency is only profitable if you can exploit it before the competition. So if you want to grab that alpha before everyone else does, you need to be able to build, test and deploy your new trading models before they can. Gary Stone, Director of Trading Research and Strategy at Bloomberg Tradebook, maps out the fast lane to model development and deployment.

Creating a profitable trading strategy is demanding enough in just the intellectual sense; a lot of blind alleys and late nights. But there's also all the housekeeping processes to deal with; sourcing sufficient high quality historical data (traded prices, order book depth, fundamental data, news events etc) for development, selecting or building the design/testing/production environments and writing connectors to markets/brokers for order execution. As a result, it is alarmingly easy for time and resources to be rapidly consumed on tasks other than maximising intellectual capital to capture alpha. Avoiding that trap therefore ideally requires a package of data, technology and markets that can wherever possible be accessed in one hit.

Feeding your models

Collecting, cleaning and updating historical data for use in model development can be a colossally time consuming exercise. As trading strategies have become more sophisticated, the number of markets accessed by individual strategies has also increased. In the case of more complex stat arb strategies, these may span multiple market segments. This may necessitate sourcing data from multiple vendors, which immediately raises issues around file format conversion (in the case of historical file downloads) or connecting to multiple market data APIs.

A further complication is that in many caseas more than just historical traded prices are required; strategies that are highly sensitive to execution quality will also require historical order book depth data in order to allow estimation of likely fill levels and quantities during the back testing process.

Many traders have come to rely on the Bloomberg Professional® service market data API through which users can access a truly global range and depth of data (see Figure 1) for use in trading model development and testing. Bloomberg's market data API also offers access to pre-calculated values for any underlying data set to save users the trouble of coding the formulae for popular analytics in their development platforms. For example, recently Bloomberg began disseminating real-time technical analysis indicator values through the API.

Ease of plumbing

For optimum flexibility, an API connected to an online database is generally a better option than having to manage multiple flat file downloads and updates. However, when it comes to connectivity there are APIs and then there are APIs; the ideal is to have an API that facilitates connectivity by using a simple, well-documented, object-oriented interface. This is doubly important if the same API connectivity can also be used for transmitting orders generated by trading models, as well as for obtaining data with which to populate them.

Particularly for smaller trading operations that do not have the budget for a dedicated in house programming resource, this ease of use issue can determine the difference between success and failure. The ultimate objective is to get the models validated and into production as quickly as possible to earn return on trading capital - not to become embroiled in complex and expensive technology projects.

This point has been very much front of mind of both Bloomberg and Bloomberg Tradebook. Bloomberg's market data API uses a common schema from which to call real-time values into applications. Similarly, the Tradebook Order API offers a clean object-oriented interface that is accessible from just about any mainstream programming language, including C#, C, C++, Java, and Visual Basic for Applications (VBA). For traders with a degree of programming ability, it also makes connectivity with applications such as Excel (see Figure 1) and MATLAB something that can be readily accomplished without the need for dedicated IT staff. Furthermore, in view of the increasing size of data sets now required for trading model development, the API also supports 64 bit operation in Java to avoid in-memory data constraints.

Figure 1: Excel based pairs trading via Tradebook Order API

Figure 1: Excel based pairs trading via Tradebook Order API

Intriguingly, although this ease of use is obviously crucial for smaller trading operations seeking API connectivity, it has also proved valuable for larger trading operations. Large organisations might typically use FIX connectivity, but the associated costs have seen them opt to use the Tradebook Order API to conduct rapid development to "trade their idea" as quickly as possible.

Simulation so real

With all the necessary data readily available through a well designed API, there is little practical limit on the choice of trading model development and testing environment. However, even if a model exhibits satisfactory performance during both in and out of sample testing, that still leaves the more acid test of "paper trading" (live simulation). As trading models have increased in frequency this has become an increasingly vital part of the evolution of a model prior to live deployment.

In the past, the relatively long average position duration and large P & L per trade meant that accurate estimation of execution prices was a less critical factor in determining likely real time model performance. However, as trade frequencies have risen and average per trade P & L has dropped, knowing whether your trades would be filled "here" or "there" can make the difference between a good model being wrongly discarded and a bad model being wrongly traded.

The big problem is that while many trading platforms enable users to connect to a live test environment, the accuracy of their execution simulation often leaves a great deal to be desired. The key here is also being able to leverage a realistic estimation of where orders would actually be filled in live trading. In many cases, a very rough guesstimate is the best that users can hope for.

This would potentially cause problems enough when trading single market strategies, but with multi-legged stat arb models the situation is exacerbated. Consider a strategy where a small cap index future is traded against a basket of index constituents. It doesn't take many errors in estimating execution points for just a few of those individual stocks to throw the viability of the entire simulation process (to say nothing of the model itself) into doubt. Bloomberg Tradebook operates beta test environments for each asset class; equities, futures, options and FX. Although there is nothing like the production environment, and simulated results are not the same as actual production results, the Tradebook order API can be configured to interact with the beta systems enabling traders to interact in a real-time beta environment (with all relevant market conditions such as depth of book, actual volatility, economic announcements etc.) and receive simulated fills for additional model validation.


Being able to conduct both simulated and actual live trading through the "same" API as the one used to access historical data for testing/development is obviously desirable in order to save time and cost. In practice, many traders find themselves having to use two completely separate APIs for these activities, which not only requires coding for the individual APIs but may also necessitate coding in two separate languages for a development and an execution platform. Apart from the redundant costs/workload this entails, it also hugely increases the probability of introducing coding/logic errors when transitioning between the two.

By contrast, the Tradebook Order API allows both processes to be conducted via the same interface for options, futures, FX and US/Global equities. In addition to single market strategies, this obviously opens up efficient access to a huge range of possible cross market and stat arb strategies. To further enhance trading model performance, the Tradebook Order API can also directly access far more than just simple limit, stop and market orders. Depending upon the asset class, benchmark trading strategies, tactical trading algorithms and complex-linked orders such as OCO, If Done, trailing stops can be leveraged. Other functionality supported includes:

  • Order, Modify, and Cancel executions;
  • Trade and Order recaps;
  • Fill messages;

Finally, the Tradebook Order API can also transmit manual orders (see Figure 2), so users who wish to build their own custom interfaces to trade from can do so.

Figure 2: Manual trading ladder connected to the Tradebook Order API

Figure 2: Manual trading ladder connected to the Tradebook Order API

Keep it simple

We see it every day - clients spending tremendous amounts of time and energy building models that try to give them an edge in the market. But, when it comes to the actual execution, instead of travelling along an electronic highway, the implementation or integration of the strategy hits a dirt road. The Tradebook Order API enables traders to take their models, nourish them with data from the world class Bloomberg Professional® service market data API and, depending upon the asset class to be traded, then send simple market and limit orders, algorithmic trading strategies or complex strategies to Bloomberg Tradebook for execution.

Bloomberg Tradebook is a global agency broker offering advanced trading algorithms and direct market access to over 60 global equity, futures, and options markets and 41 currency pairs in our Foreign Exchange marketplace. Many traders have created valuation, investment and trading strategy models in various applications and nourish them the Bloomberg Professional® service data API. Now, using the same connectivity as Bloomberg's data API, traders can integrate their strategies with Bloomberg Tradebook's high performance Order API and connect their strategies to the electronic execution highway.

Nothing in this document constitutes an offer or a solicitation of an offer to buy or sell any security or other financial instrument or constitutes any investment advice or recommendation of any security or other financial instrument. BLOOMBERG TRADEBOOK believes that the information herein was obtained from reliable sources but does not guarantee its accuracy.

Communicated by Bloomberg Tradebook Europe Limited, registered in England & Wales No. 3556095, authorized and regulated by the UK Financial Services Authority No. 187492. This communication is directed only at persons who have professional experience in the investments which may be traded over the systems and certain high net worth organizations. Available in all countries and is only offered where clearance been obtained.

Bloomberg Tradebook LLC member of FINRA ( SIPC/NFA. Bloomberg Tradebook do Brasil is the representative of Bloomberg Tradebook LLC in Brazil registered with the BACEN. Bloomberg Tradebook Services LLC, Bloomberg Tradebook Australia PTY LTD ABN 36 091 542 077 ACN 091 542 077, Bloomberg Tradebook Do Brasil LTDA., Bloomberg Tradebook Canada Company Member of CIPF, Bloomberg Tradebook Limited, Bloomberg Tradebook Hong Kong Limited the first ATS authorized by the SFC-AFU 977, Bloomberg Tradebook Japan Limited member of JSDA/JIPF, Bloomberg Trading Services Japan LTD, Bloomberg Tradebook Singapore Pte Ltd Company No. 200104338R, Bloomberg Trading Services (Singapore) Pte Ltd Company No. 200101232G. Bloomberg Tradebook Bermuda LTD, licensed to conduct Investment Business by the Bermuda Monetary Authority.

BLOOMBERG, BLOOMBERG PROFESSIONAL, BLOOMBERG TRADEBOOK are trademarks and service marks of Bloomberg Finance L.P.("BFLP"), a Delaware limited partnership, or its subsidiaries. Bloomberg Tradebook is provided by a BLP subsidiary, Bloomberg Tradebook LLC, and its affiliates and is available on the BPS.