Picture of trading pit TradingMachine Logo

Stationarity

John Reeve

23rd February 2006

Introduction

Stationarity is fundamental to the use of standard statistical techniques to forecast expected future outcomes. However, it is a topic that receives surprisingly little mention within trading literature. This bulletin shares some thoughts on the importance of considering stationarity when developing and analysing trading algorithms.

Definition

The term stationarity is used in different ways in different contexts. Where it is encountered in economics it is frequently used in relation price. In this context a stationary market is effectively non-trending. However, for a broader definition a stochastic variable can be described as weak-sense stationary if the following properties are time invariant:

1) The mean.
2) The variance
3) The auto-correlation structure.

Hence, the standard random walk model of stock prices is stationary in that the distribution of log returns has a mean of zero, constant variance and auto-correlation that is zero across all time.

Stationarity and Markets

Stationarity is an implicitly assumed in many applications where statistics are used to model future expected outcomes. Fixed physical systems or gambling games with fixed rules are expected to have stationary statistics. In these cases, the expected value of future outcomes can be modelled based on the prior distribution. Market prices are the result of the individual actions of a large number of market participants. The number of participants and their behaviour can change significantly with time and so stationarity cannot be assumed. However, fundamental economic factors will act to stabilise market behaviour in the medium to long term. In the short term, market statistics change significantly during the trading session. Although there is no reason to expect stationarity in financial markets the use of summary statistics and standard statistical techniques is common place in trading.

For example:

1) Summary statistics for trading systems
2) Montecarlo draw-down analysis
3) Position sizing algorithms
4) VAR based risk analysis

However, in the absence of of anything better, standard statistical techniques are likely to find continued application in trading.

What to do in a changing world?

Methods of coping with the additional uncertainty that arises from non-stationarity fall into three main categories:

1) Fudge factors.
2) Re-optimisation.
3) Adaptive algorithms.

Examples of fudge factors include expecting draw-downs twice as large as historical maximum draw-down and fudging optimal-f to make it safe. For risk analysis, VAR has a fudge factor built into it's definition. The failure of trading systems to cope with changing market statistics frequently leads to re-optimisation. Walk-forward testing has developed from the technique of regular re-optimisation to help analyse system stability.

Adaptive Algorithms

The design of adaptive algorithms attempts to either model or compensate for the non-stationary behaviour of markets. Trading systems may include a range of linear and non-linear algorithms to adapt trading patterns according to the recent market statistics. Simple examples include volatility based position sizing and volatility based indicator look-back periods. A range of statistical techniques is also available to model or remove non-stationary behaviour. For example the GARCH model attempts to model stochastic volatility and includes mean-reverting characteristics.



The figure shows the arrangement of a trading system designed to compensate for non-stationary market behaviour. The non-linear trading algorithm is designed to exploit a predictable market inefficiency present in the market time-series data. In practice, the inefficient behaviour will be a small part of the overall efficient price behaviour. Since the the broad market behaviour is non-stationary, the trading algorithm is made adaptive to compensate.  The output of the trading algorithm is a sequence of orders which could be executed in the market. The profit distribution of notional trades at this point should be stationary with a positive mean. However, orders at this point are normalised for constant return. A position sizing algorithm is used to scale the normalised orders to achieve optimum safe equity growth.

In this arrangement, the effectiveness of the adaptive algorithm at ensuring stationarity of the trade distribution has a direct impact on overall profitability. Residual non-stationarity of the trade distribution requires that the position sizing algorithm is backed off to maintain safe limits on draw-down.

Conclusion

Unlike gambling games, markets can not be expected to have stationary statistics. Standard statistical techniques are still useful but allowance needs to be made for greater uncertainty in expected outcomes. Adaptive algorithms can be used to compensate for non-stationary behaviour and optimise equity growth. 



Created in NVU

©TradingMachines.net 2005