The Gateway to Algorithmic and Automated Trading

Spotlight: RTD Tango - Cutting to the Chase

Published in Automated Trader Magazine Issue 04 January 2007

Tools for trade automation have been around for several years. One of the later arrivals at the automation party is RTS Realtime Systems Group, which launched its RTD Tango automated/algorithmic modelling and trade execution platform last year. As AT discovers, there is evidently truth in the adage about learning from other's mistakes to avoid making your own.

RTS Realtime Systems Group has an established reputation as a provider of electronic trading solutions, with connectivity to some seventy markets around the globe. The company's RTD Tango is a client/server application that makes use of an important existing element in the RTD product group infrastructure - the RTD Communication Server.

This acts as a high performance middleware layer between the end user and the exchanges to which RTS connects, so that the end user does not have to write strategies to each individual exchange's API. The other server component is the RTD Tango Server, which handles all sensitive processes, such as order management and strategy calculation.

Finally, RTD Tango includes two flavours of client - a main trading window and a development window, which can be permissioned separately. (Suitable for where a trader and programmer are working together and there is a need to keep their activities entirely separate.) Alternatively, a single individual can be allowed to access both.

The development environment

The RTD Tango development client (see Fig 1) consists of two panes. The left hand pane contains a list of all the strategies currently stored on the RTD Tango server, while the right hand one is where the actual code is written. When a new strategy file is created, RTD Tango automatically displays a new blank strategy template (as shown in the right hand pane of Fig 1). This provides the developer/trader with the basic framework necessary to ensure that all the requisite components of a strategy are included.

Figure 1: The RTD Tango
Development Client

The padlock icon next to some of the strategies listed in the left hand pane in Fig 1 indicates that they are locked and cannot be changed. In order to make changes, the strategy must first be "acquired" and whether or not this is possible depends upon individual users' authorisation levels. The security policy is set at the system level and can be defined on a per strategy basis.

Parameters and Variables

RTD Tango has two types of strategy parameter - fixed and changeable. Fixed parameters have their values defined in the development client and cannot be changed in the trading client, while changeable parameters can.

RTD Tango offers two types of variable assignment - by reference and by value. The former always have their values updated in real time, while once assigned the latter will only recalculate when instructed by a change event in the Script section of the code (see below).

Off Conditions and Scripts

It is also possible to specify circumstances that will automatically turn a strategy off in real time in the Off Condition section of RTD Tango strategy code. For example, the Off Condition in Figure 2 can be triggered by either the MAX_EXEC_EXCD or INPUT_ERROR variables. (In this example the former relates to the maximum number of order executions permitted and the latter to trader input errors for parameters, such as the end time for trading being before the start time.)

Figure 2: Off Condition

The Scripts section of the strategy code is where one of RTD Tango's neatest tricks takes place - the triggering of the recalculation of the value assigned variables mentioned earlier. The ability to specify that a variable is only recalculated when a certain condition is met means that it becomes possible to write hugely CPU-efficient code. The norm for many automated trading programs is to recalculate everything on every market event, which is massively inefficient. Why, for example, would you wish to recalculate the value of a profit target variable on every tick if you don't have an open position?

By only allowing a variable to recalculate when actually necessary, a large number of CPU cycles can be saved. Therefore the code can run faster and/or more strategies/markets can be traded on a single server.

Agents and Published Expressions

Order and Quote Agents undertake the business of issuing orders and quotes to the market subject to the conditions defined within them. Both types of agent also support RTD Tango's lean programming approach - variables can be calculated that are local to the agent and will only be calculated when the agent is active - a further CPU load saving.

The final section in the RTD Tango development programming screen contains Published Expressions. These can be Variable Definitions, Overview Expressions or Detailed Expressions. The first are intended for debugging; if strategy code is not executing as expected it is possible to display the values of variables using a Variable Definition. Overview and Detailed Expressions allow the display of calculated values in the main trading window (of which more below).

Language and functions

RTD Tango's programming language operators and constructs bear a close resemblance to C. For example, it uses…

…syntax for an "if, then, else" statement. In addition, it uses "==" for equals and "&&" for and - and so on.

A further link with C is that a lot of the elements within RTD Tango strategy code (such as the 100+ built in functions and the order handling) are precompiled - thereby further boosting run time performance. The function library does not as yet include many technical indicators, so if you want Bollinger Bands you currently have to roll your own and copy/paste the code into each strategy.

That is a relatively minor inconvenience, especially since RTD Tango also provides a socket stream interface that allows external data to be written to variables automatically in real time.

Figure 3: The RTD Tango Trading Client

The trading client

The RTD Tango trading client window (Fig 3) is divided into three vertical sections. The market window at the bottom of the right hand section provides a view of the order book for the market or markets being traded by a particular strategy. The pane above this displays active quotes (for market making strategies), the pane above that shows any orders that the strategy currently has in the market, and the one above that the actual orders executed. The pane at the very top of the right hand section displays some of the elements from the log file that is continuously written to the RTD Tango Server, which is useful for troubleshooting.

The Published Expressions are displayed in the top pane of the central section. As mentioned above, these are defined in the development client and can be anything from a limit order value to a performance measure, such as a Sortino or Kestner ratio. The two panes below this show the Fixed and Changeable Parameter values.

The left hand section shows all the strategies currently on the RTD Tango Server together with their associated Overview Expressions. Clicking on a strategy automatically causes all the other panes to display all the data pertaining to it. All Changeable Parameters can be altered in real time by the user, without having to stop and restart the strategy. If those changes result in adjustments to existing orders, RTD Tango automatically handles any cancel/replaces.

Simultaneous trading and simulation of multiple strategies are carried out using the trading client. At present, multi-strategy simulation can only be carried out in real time, but RTS will shortly be launching a Back Testing tool that will be closely integrated with RTD Tango.

Behind the scenes

A lot of the value that RTD Tango offers is definitely present, but invisible. Put simply, RTD Tango handles the plumbing - extremely well. In addition to the fact that it offers a single consistent programming and trading interface to 70+ markets, it also includes numerous features that deal with the "gotchas" of trading. For example, it prevents "self trading" by removing existing orders generated by your strategies from the order book before exposing the order book to any of your other strategies - so there is no chance of your strategies trading against each other.

Another practical feature is the automated allocation of trading opportunities. If you have four strategies that all want to trade ten BOBL contracts at a particular price, but just one opportunity to do this is coming up, then if all orders are triggered there is obviously a risk of overshooting. RTD Tango senses this situation automatically and deals with it by only entering one order for ten.

One of RTD Tango's stated objectives is to protect the user from operational details without simultaneously limiting functionality - and it undoubtedly succeeds in this mission. There is a lot of talk these days about reducing latency, but there is also a growing realisation that there is less and less advantage to be gained by improving "connectivity latency". (Once everyone has their strategy servers within two inches of the matching engine, where's the edge?) The focus is therefore now turning to application latency. RTD Tango's granular control over variable updating and CPU efficiency means that it is already well ahead of this particular curve.

This is highly efficient software - everything about it has a streamlined, functional feel. While some of the features it contains may never have occurred to you before, they are all "must haves" that practically assist the trading process. Professional auto/algo traders looking for a programming/trading solution would be well advised to put RTD Tango near the top of their shopping lists.

RTD Tango Case Study: Van der Moolen

Van der Moolen is an international trading firm that trades in equities, bonds and related instruments such as warrants and futures. The firm is active as a 'specialist' and/or proprietary trader on major equity exchanges in the United States and Europe.

Van der Moolen's London office has been using RTD Tango for more than six months. The firm has three traders who are mostly using the application to write and trade pairs strategies. According to Benn Eichhorn, IT Manager at Van der Moolen, one of RTD Tango's strongest aspects has been the speed with which it is possible to develop and deploy trading strategies. "With the software we were using previously it would take us weeks to write just one model," he says. "With RTD Tango we can produce two a day."

An important element in that shorter time to market has been the fact that RTD Tango comes with much of the background plumbing already completed. "Features such as the order agents are incredibly useful," says Eichhorn. "In the past we used to waste a great deal of time writing order handling routines - in RTD Tango, that is already done for you."

As a result, members of Van der Moolen's trading team are able to focus on the business logic of their trading strategies, rather than the supporting infrastructure. Writing that business logic is also fairly painless in Eichhorn's view. "The development language that RTD Tango uses has syntax very similar to mainstream languages such as Java or C++," he says. "However, it is far more user friendly than those languages, which further reduces development time. Furthermore, because the math functions and order handling components of RTD Tango are pre-compiled it is fast in real time execution."

This run time speed means that trading response times are good. As a result, Van der Moolen's trading strategies are not hampered by the application latency that affects some platforms that use macro type or run time compiled languages for coding trading strategies. At the same time, while RTD Tango is a server based application, Van der Moolen has found that its GUI response times are similar to those of a locally installed application.

As trading applications become more sophisticated and flexible, their complexity often increases. This can leave traders, who may not have extensive programming skills, confronting an extremely steep learning curve. The net result is often a significant delay before they become productive. Eichhorn remarks that this was not a problem with RTD Tango. "Implementation was straightforward and the traders found the software intuitive," he says. "In part that was due to the quality of the documentation, which includes a number of prebuilt sample trading strategies that proved very helpful."

And Van der Moolen's overall verdict? "We're very happy and also looking forward to some of the additional functionality - such as back testing - being incorporated in forthcoming releases of RTD Tango" says Eichhorn.