Anyone who have ever heard about extrapolation and about financial trading was tempted to try using some of those math methods for an advantage in trading. After all, it seems quite logical to assume that the price chart curve (Forex or stock, or any other security) is a function of some sort that can be predicted mathematically, like parabola or a sine function. So, I’ve decided to test some of the extrapolation methods in Forex trading using the MetaTrader 5 platform.
To tell the long story short, I’ve failed — and there’s no surprise, as the methods that were created for interpolation (and can extrapolate simple functions) fail to extrapolate the complex functions with high levels of variance, the same way as the pure mathematical methods can’t account the fundamental and sentimental factors behind the markets. If you aren’t interested in the math details of my tests, you can just remember that using algebraic extrapolation isn’t a good idea in Forex and stop reading here. If you want more details, please, do read farther.
Lagrange polynomials. The first method that I’ve tried was polynomial interpolation using the Lagrange polynomials. It’s probably the first extrapolation method that comes to mind and it’s rather simple in computation. I’ve used the Barycentric interpolation — it’s just a faster and simpler way to interpolate/extrapolate using the Lagrange polynomials. If the Forex market behaved like a function similar to x², there would be some success with this method, but in reality Runge’s phenomenon messes it all up. If we use just 2 last dots to extrapolate, we get a straight line extrapolation, which obviously fails in Forex; if we try to use a big amount of points to “improve” the input data for extrapolation, we fail because of Runge’s phenomenon — the extrapolated values just jump up or fall down disproportionally to the input data. You can see my Lagrange polynomials extrapolation indicator and play with it to see how the result changes depending on the amount of the input dots.
Lagrange polynomials on Chebyshev nodes. If we read about Runge’s phenomenon, we can also find out that, using the unevenly distributed points of the sample function data, it’s possible to minify the effect of the phenomenon. Chebyshev nodes provide the
Systems of linear equations. A less obvious and a little bit more complex approach to mathematical market predictions is the systems of the linear equations. If we assume that each time point in chart n with a price Pn has its own parameter Rn such that Rn * Pn + Rn-1 * Pn-1 + … + R1 * P1 + R0 * P0 = Current Price, we can assemble a system of the linear equations to find all the Rn and use them to extrapolate the future prices by knowing the previous prices. It looked quite logical but the result wasn’t any better than in my first two attempts :). I’ve used the Doolittle algorithm to perform the LU decomposition to solve the systems of the equations. A nice C++ code for Doolittle LU Decomposition served very well as a base for my MT5 code. Now you can freely download my MT5 indicator that tries to predict the future prices with the systems of linear equations.
Pattern matching. Although it’s not exactly a method from the linear algebra (it’s just a simplified
In conclusion, I can say that extrapolation works rather poorly in Forex (or any other financial trading). Pure static mathematical methods can’t produce sustainable trading results. Market participants should look beyond the linear algebra if they want to be successful in trading — mechanical or manual.
If you have any comments or questions on using the algebraic methods in Forex trading, please, reply using the form below.
- admin_mm
- January 11, 2011
- zero comment