Model Lepau is a forex trading system model packaged into an expert advisor (robot) executable on a PC running Metatrader 4. The model is based on statistical arbitrage of three triangular forex symbols. Choosing three forex symbols that are triangular (i.e. exhibit a product relationship) ensures that there is both cointegration and correlation from which the mean-reversion property of stationary processes necessarily follows. In the case that there is strong evidence of cointegration the two instruments are traded by the robot as one stationary process. The robot makes entries (and exits) every time the model spread/deviation (residual time series) crosses a multiple of standard deviation from mean.
To explain this operation further, suppose the model spread crosses the first standard deviation (negative or positive side) away from the mean. Then the robot will open two orders which together act as one order pair for model spread as a synthetic instrument (a stationary one). If the model spread goes further away to cross the second standard deviation from the mean, the robot will close the order pair (with a loss) opened earlier when the model spread crossed the first standard deviation. At the same time (after closing this order pair), the robot will open a new order pair with lot sizes scaled by a factor CR. This mean if CR >= 1 then the loss made by the first order pair will be recovered by the second (or even third, though model spread hardly ever gets to the third standard deviation) when the model spread moves from the N-th standard deviation to cross the N-1-th standard deviation. The end result is always that when the model mean finally reverts back to the mean there will be net profit in so far as the cointegration model is still valid.
There is a good reason why it is safe to keep opening order pairs as the model spread keeps moving away from the mean. That reason is that, since the model spread is a tested stationary process then it has a tendency of mean reversion and binning this process result in Gaussian histogram profile and this tells us that the probability of model spread moving further and further away from the mean decreases exponentially. It is for this reason that always betting that model spread is bound to revert back to the mean value results in an investment system with a positive expectation value which can be calculated explicitly given the mean and variance of the Gaussian histogram profile.
The robot has various input parameters (set at default settings) some of which are described below:
1. N is the data size for building cointegration model.
2. CR is the common ration for adjusting lot sizes (CR >= 1).
3. Lots is the nominal lot size. Minimum usually 0.01.
4. Magic & magik are magic numbers used to uniquely identify trades opened by this robot. As such every magic number should be uniquely chosen positive integer.
5. TFrame is the time frame in minutes.
6. PairOne, PairTwo & PairTri are three trading instruments/symbols which are to be tested for cointegration and traded if the test succeeds. The robot will report back if the chosen instruments have weak or no significant cointegration and the user should react by choosing a different combination.
7. ModeDemo is the switching Boolean parameter. When true the model will work on Demo accounts but if false it will work on real (or live) accounts.
8. SaveData is the switching Boolean parameter. It switches from data-consuming (but indestructible) mode and data-saving (but prone to inaccuracies if there are internet cuts and temporary disallowed trading conditions set by broker).
9. AlertsOn is switching Boolean parameter. When true, recurrent alerts will be shown, otherwise they won’t be shown.
10. RSThreshold is the threshold for R^2 goodness of fit measure (for cointegration model) below which trading will not happen.
11. CCThreshold is the threshold for correlation coefficient measure below which no trading will happen.