

Setting up an algo trading system test bench. Description of parameters. 
Written by Forex Automaton  
Friday, 10 April 2009 09:19  
Our general approach to the problem of forex trading system backtesting has been outlined before. This post gives a more detailed picture of the parameters subject to the optimization  a useful reference point for the optimization reports that may follow. The only caveat is: since the nature of the forecasting algorithm will not be disclosed, discussion of the nature of the parameter(s) related to it will be similarly avoided. Therefore, the scope of the optimization problem for public discussion is reduced, essentially, to the problem of money and risk management in the presence of a more or less successful forecasting engine, which in itself remains a black box. This problem need not be quite the same as the problem of money and risk management in the hypothetical efficient market. Algorithmic forecastingThe subject of the forecast is the difference between the closing price of the next (future) time step and the close of the present time step. It is expressed in the units of the present time step price. Essentially, this is the output of the forecasting procedure. Let's call this quantity d. When d is positive, the price is expected to go up; when negative  down. Currently there is only one quantity which can be properly called the forecasting engine control parameter. For the sake of definiteness, let's call it Fred. Entrance sensitivity threshold, t_{en}The entrance sensitivity threshold is applied as a filter to d. Values of d below t_{en} by absolute magnitude are ignored. When t_{en} is low, trades are entered easily. Needless to say, frequent trading in general increases broker's commission (if applies) and spread expenses. In the simulations so far, only spread expenses are included. Portfolio allocationIn the situation when multiple markets (exchange rates) are being traded, values of d high with respect to the recorded volatility of the recent time span may lead to an increase in the share of capital allocated to the market in question in the eventual placement of trades. The ratios of d to the respective recent variance of returns (a variance estimate) for each forex rate in the portfolio (after passing the entrance sensitivity threshold) act as weights when considering how much capital will be allocated to each trade. Volatility being the same, the algorithm "likes" higher values of the expected price movement; the expected movement being the same, it likes markets with low recent volatility. (Variance and covariance of returns typically figure in the equations of the modern portfolio theory, and the efficient capital allocation fraction, the one that maximizes profit while minimizing the risk, is a ratio of a linear combination of variance and covariance terms for the securities in the portfolio to a quadratic form involving such variances and covariances.) Exit sensitivity threshold, t_{ex}The exit sensitivity threshold is applied as a filter to d when we already hold a position and are contemplating closing it. Values of d below t_{ex} by absolute magnitude are ignored. Just like low values of t_{en} result in the virtual trader which is easily excited, low values of t_{ex} result in the one which is easily scared. A trade thatÂ is believed to go against the market according to the latest forecast can be closedÂ by applying the exit sensitivity threshold to the forecasting signal. If the threshold is exceeded, the trade will be closed without waiting for the stoploss to be hit. Stoploss, sMarket volatility is continually monitored and a separate volatility quantity is kept track of for every market being traded. The volatility measure is the rootmeansquare of the recent subset of series of linear returns (price differences) in the price time series. The stoploss parameter sets the number of volatility units (possibly fractional) between the price at which the trade is entered and the position of the stoploss. 

Last Updated ( Thursday, 25 March 2010 14:50 ) 