Comparison of two quotation charts with non-linear distortions on the X-axis - page 9

 
Is it based on non-linear X distortion, or purely a comparison of similarities?
 
IgorM: in the optimiser got good parameters for one month on the H1 TF:
10 trades is not serious, Igor. At least show me a hundred of them.
 
Mathemat: 10 trades is not serious, Igor. At least show me a hundred.

had some time today to experiment with the code, here you go as asked for a hundred :)

searching for paternals, some kind of optimization - one month (January), forward 12 months, i don't know what is in these paternals, but i think there is something, i will try again, i should use different currencies

Files:
desktop.zip  19 kb
 

I don't really believe in these patterns (although it depends on which ones, of course; how shall I put it... they don't have to be geometrically obvious).

But it's more interesting now.

 
I have written a new version of WmiFor using the DTW algorithm. As soon as it passes moderation, it will appear on codebase.
 

Well done. We are waiting for a detailed description of the mathematical kitchen. If you get a chance, post here when it appears in codebase

 
Taki wants to see two "similar" graphs to see what is meant by that.
I have vague ideas about comparison, similar to searching for spelling mistakes in the form of missing, changed or extra letters in words. (I once wrote such a procedure for an automatic translator).
 

To avoid opening a separate thread, I've decided to describe the results of my research on patterns here. Maybe it will save someone's time and give someone new ideas.

In 2006, when I first got interested in Forex, my first idea was to compare the last N bars (current pattern) with all past patterns of the same quote, using correlation coefficient as a measure of similarity. This is the same nearest neighbour (SN) method. The advantage of the correlation coefficient over the Euclidean length is that it takes into account the distortion of the price axis. I have built an Expert Advisor using this method that has shown extraordinary profitability for 2-3 months of forward testing (10к in 10М or something similar), but then it was losing 2-3 months. And so the sequence: a huge profit, then a total loss. I several times returned to this method BS, did committees of neighbours, etc., but the result was the same. In the end I got disappointed and put the code of BS method in the base on 5.

In 2007-2008 I got interested in PNN, particularly in GRNN. The essence is the same as BS, but instead of selecting some one (or few, like in committee) similar neighbours, all past patterns are automatically selected and their influence on prediction is weighted by exponential function like exp(-measure_difference). Thus more similar parts of history are weighted exponentially more heavily. You can take the pattern prices (minus the average) and calculate the Euclidean distance as a measure of difference, or take the difference in vector readings of some indices. Prediction accuracy was slightly higher than BS method, 52% instead of 50.5% (I don't remember exactly).

My last idea was to use methods used by our brain to transform information. I described these methods in detail on 5. The essence of one of them is to find patterns (or basis functions) into which current prices can be decomposed. Like

Price[i] = sum (a[k]*function[i][k], k=1...L) i=1...N

Of course, we can take trigonometric functions instead of search for bases and use Fourier transform. But it is more perspective to find the basis functions on the history using the method of rarefied coding. The essence of this method consists in fitting of the mentioned linear model in prices at various history intervals of length N by ANC in such a way that the specified error is achieved at the least number of non-zero coefficients a[k], k=1...L. Ideally, each historical price vector contains only one basis function (or pattern). At every step coefficients and functions themselves are optimized. There are a lot of parameters that are not known in advance. For example, the length of the pattern N, the number of basis functions in the dictionary L, the number of non-zero coefficients in our decomposition (I select 3, like every price segment consists of the tail of the old pattern, the current pattern and the beginning of the new pattern). It is important N*L should be much less than the whole history length otherwise the algorithm will find patterns equal to the past prices themselves and then we will have something like the nearest neighbours method. For example, the dictionary of 64 patterns each 64 bars long for EURUSD H1 trained using the method of rarefied coding applied to the history of 1999-2010 (74 bars) will look as follows

I have noticed the following regularity: the longer the pattern and the greater the number of them in the dictionary, the higher the profit in the bactest, which can be explained by the overtraining. But in any case, with different N and L, the forward test looks chattering around zero profit. Starting to get frustrated with the patterns. Apparently they are not constant in forex, or in other words forex has no memory for patterns - new ones are created every time.

 

If it's hovering around zero at a constant lot, you've already got a money printing machine under your belt... Lots - MM - screw in to eliminate unprofitable series...


In general - any TS which has for 1000 or more trades, loss not more than (spread * 1.5 * number of trades) is very potentially profitable system... (with a constant lot, if this result is shown)

 
Aleksander:

If it's hovering around zero at a constant lot, you've already got a money printing machine under your belt... Lots - MM - screw in to eliminate unprofitable series...


In general - any TS which has for 1000 or more trades, loss not more than (spread * 1.5 * number of trades) is very potentially profitable system... (with a fixed lot, if that's what it looks like)


There is MM with stop-losses and proportional volume increase. Are you talking about a martingale or something?

Reason: