Docstoc

Testing Algorithmic Trading Strategies - PDF

Document Sample
Testing Algorithmic Trading Strategies - PDF Powered By Docstoc
					White Paper

Testing Algorithmic Trading Strategies
Last Updated: 21st August, 2007

Introduction
Algorithmic trading is defined as “placing a buy or sell order of a defined quantity into a quantitative model that automatically generates the timing and size of orders based on the goals specified by the parameters and constraints of an algorithm”. An algorithm describes a sequence of steps by which patterns in real-time market data can be recognized through various statistical analyses and responded to in order to detect trading opportunities in the market. Algorithmic trading has attracted much attention recently. It is estimated that by 2008, 40% of the trading volume in US equities markets will be contributed by algorithmic trading.

 Optimizing rule based trading by testing the optimal

number of rules that can be applied and the optimal number of levels, the rules can be embedded without affecting speed of execution;
 Dealing with performance issues in calculation of

success probabilities of the available user-defined trading models and their applicability to current market conditions as rigidly defined;
 As one size does not fit all, when sizeable proportions

of user defined rules occur or trading models undergo change, they must be retested for optimal speed of execution. One cannot always depend on “Moore’s Law” to compensate for inefficiencies that creep into newer trading models.

Need for Testing Algorithmic Trading
 Testing the algorithm: We need to be sure about the

Test Strategy for Algorithmic Trading
One of the common methods of testing algorithmic trading is backtesting. Testing algorithmic trading requires continuous data flow such as LTP, LTQ and market depth. Here a simulator is used to replicate the past data, trade price, traded volume and market depth. Backtesting uses the historical intraday data to identify how the strategies would work under different situations. Algorithm strategies can be classified based on the complexity of the business functionality. Higher complexity will lead to more risk on performance and the profitability. As algorithmic trading involves different permutations and combinations of market movements, testing these algorithms would also be very complex as each scenario has to be tested.

reliability of a particular trading algorithm before we use it in a live market
 Testing the infrastructure that supports algorithmic

trading: The software infrastructure that helps implement a trading algorithm should be reliable
 Performance testing: The trading algorithm needs to be

tuned for speed of execution

Testing Challenges
 Effective testing of an algorithmic trading strategy

requires quality data (tick by tick broadcast data (touchline) or market picture data) to be made available to the market simulator. One of the ways to ensure this is to source this data directly from the exchanges;
 A number of simultaneous connections to the exchange

should be adequate for optimal routing of orders, to various exchanges or segments with minimum latency;
 Profiting from risk-less arbitrage opportunities requires

low latency in spotting an opportunity in real-time and firing off orders. A lot of effort is spent in tuning the algorithm and profiling the source code to improve speed of order firing/routing;

AppLabs.com
App_WhitePaper_Algorithmic_Trading_Strategies_1v00 Page 2 © 2007 AppLabs

 DMA Strategies:

 Analyzing the historical data to map with the test

DMA Strategies are the simplest algorithms being used; these strategies break the orders into small parts which does not impact much on the market. The complexity involved in testing these strategies is low. Functional testing verifies whether the algorithm involved here defines the order entry at specific time intervals, whether the order is triggered after the execution of the order sent earlier and whether the order is sent to the destination offering the best price or quality.
 Quantitative algorithms:

scenarios for each strategy;
 Using historical data to analyze boundary values under

extreme situations as bull market and bear market under volatile market conditions;
 Tweaking the historical data to match with your test

scenario for each strategy;
 Changing the test data for each test scenario to simulate

different time frames in a typical trading day. Carrying out functional testing on strategies helps in maximizing profitability for each strategy, as historical data is being used to refine them. As the markets are dynamic, the algorithms being used today may not be as profitable tomorrow; algorithm strategies need to undergo continuous changes and customization. Testing the business logic of a strategy would play a crucial role in profitability due to the changing nature of algorithmic trading strategies.

Quantitative algorithms involve calculations for sending the orders based on the volume and time, with an objective to minimize the spread and impact cost. Testing such strategies has a high level of complexity. Functional testing here involves calculations of the historical data and the present data and decides on quantity, best price and time of the order to be placed.
 Investment strategies:

Conclusion
Algorithms have expanded the capabilities of the trader, making each more productive. Algorithmic trading is speed oriented and highly automated which needs a high level of efficiency in identifying the opportunities to be profitable. There is a level of risk involved which demands efficiency and reliability as negative results could be irrepairable. It is of utmost importance that algorithms have been tested under all possible conditions before their deployment into production. As more advanced and complex algorithms are anticipated to cover multi asset class, complex event processing and algorithm of algorithms, the importance for testing algorithmic trading strategies is increasing. AppLabs has extensive experience of functional and performance testing of mission critical systems in capital markets and is committed to ensuring software reliability.

Investment strategies are the most complex algorithms used in trading decisions by identifying the trading opportunities based on the analysis of real-time data and market behavior. Testing such strategies is a challenge as it is complex, time consuming, and involves analysis of real-time market data based on the statistical calculations with decisions to be made thereon. These strategies aim to make instant profit based on the price difference in different markets for the same security, the corelation between securities, and the opportunities in spot and derivatives markets. Investment strategies are customized based on the business decision of the end user and so testing should be aligned to the requirements of each customer. One of the most important aspects of functional testing is to cover all the different paths used for each strategy in every test scenario. It is very important to have a combined functional and back testing for effective test coverage to provide better results. The following points are important steps in carrying out effective testing:
 Analyzing the business complexity involved in each

strategy;
 Creating test scenarios to align with the strategy;

AppLabs.com
App_WhitePaper_Algorithmic_Trading_Strategies_1v00 Page  © 2007 AppLabs


				
DOCUMENT INFO
Shared By:
Stats:
views:135
posted:2/11/2009
language:English
pages:3
Description: Algorithms are used to detect trading opportunities within the market. It is, “placing a buy or sell order of a defined quantity into a quantitative model that automatically generates the timing and size of orders based on the goals specified by the parameters and constraints of an algorithm”. An algorithm describes a sequence of steps by which patterns in real-time market data can be recognized through various statistical analyses and responded to in order to detect trading opportunities in the market. In times to go it is expected that 40% of the trading volume in the US equities markets will be contributed by algorithmic trading. The algorithms hence must be entirely reliable to maximize the opportunities. But, before taking a plunge into algorithm trading, the system needs to go through a thorough testing process. Ensure the reliability of a particular trading algorithm before using it in a live market, the software infrastructure that helps implement a trading algorithm should be reliable and the trading algorithm needs to be tuned for speed of execution. One of the common methods of testing algorithmic trading is backtesting. Testing algorithmic trading requires continuous data flow such as LTP, LTQ and market depth. Here a simulator is used to replicate the past data, trade price, traded volume and market depth. Backtesting uses the historical intraday data to identify how the strategies would work under different situations. Algorithm strategies can be classified based on the complexity of the business functionality. Higher complexity will lead to more risk on performance and the profitability. As algorithmic trading involves different permutations and combinations of market movements, testing these algorithms would also be very complex as each scenario has to be tested. To handle the complex functionality, DMA Strategies, Quantitative Algorithms, and Investment strategies are the algorithms strategies that need to be scrupulously tested. Algorithms ha