Author's - page 2

 
I have come to a conclusion that comparison of graphs using correlation method is not good. Naturally, they do not correlate in this case. May be, the community will suggest and send you the link. And also the question of choice of time window of the current moment for the subsequent search of the similar site remains open.
 
Added another class to work with linear regression.See trailer as well as indicators as an example of use.
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов - Документация по MQL5
 
There's a guy on Quartet called Reshetov Yury. At his time he expressed one very interesting idea. Here is a quote.

In mathematics time series are divided into three groups (more are possible, but three are enough to find out how a mathematical model will behave):
1. BP is ergodic, and consequently stationary. In this case its statistical characteristics are so stable that there is a single solution. I.e. it makes sense to build a mathematical model and it will work at any section of BP - supergrial.
2. VR is non-ergodic but stationary. This case is more complicated as statistical characteristics are stable only by mathematical expectation and dispersion. Here there are already a lot of solutions. Therefore several mathematical models may be built and with some probability they will be profitable in certain parts - not super, but grail, because we may trade inside the channel on rebound from SPE - channel borders. BP will occasionally jump out of bounds, but these moments can be outlasted. Also we will have to wait and catch up when BP will dance around zero value, not approaching the borders. To check stationarity it is necessary and sufficient to put Bollinger Bands on BP and see that it does not change - it is a sideways trend with quite stable channels.
3. BP is non-stationary and therefore non-ergodic. The statistical characteristics are unstable. The situation is more complicated because any mathematical model is adequate only at the section for which it is calculated - the fit. Outside of the plot, it will be a mess. Simply put, it may happen that any mathematical model adjusted to the historical site will give a loss in the future. It's better not to even dream of grails.
Financial BPs belong to the third category: non-stationary, and hence non-ergodic. But it's not as bad as it seems at first glance. The fact is that the first differences of such GRs are stationary in expectation and partially, but unsteadily stationary in variance. For example, when VR is in a trend, either sideways or vertically, the first differences are stationary for some time. The moment of transition from one stationary state to another is unknown, as well as the statistical characteristics of the future stationary state. We can limit ourselves here with three mathematical models: up-trend of some segment, sideways and down-trend. If the TS adequately enough, even if with some delay, classifies transitions from one model to another, we can make money. However there is no guarantee, because in this case it may turn out so that none of the three models will be profitable if the dispersions change essentially and the channel borders are determined incorrectly. One will have to suffer losses and build three next mathematical models on previous history sections. And so on and so forth. Dense or empty.


Judging by the fact that it is possible to build an adequate TS that will be profitable in the future at some periods of history. We can assume one or the other. The market is ergodic non ergodic, some period of time (which we can try to exploit). Therefore the initial task is as follows.
1 Cluster the market. If there is a trend then what kind of trend, if there is a flat then what kind of transition ( it is a separate neural network with a brush for the article about Kohonen)
2 Determine the cluster we are in at the moment
3 Choose or select from the database the strategy responsible for the current cluster.

We are having a hard time at the moment. Select the minimum arguments that describe the market (I read the article on discriminatory analysis). Choose the time window of the current moment. Well, to gather statistics for what period of time in which cluster the market is located (whether we have time to remove chips from the table or not).
 

I have added a class to create a GA optimizer. Special thanks to Roman Rich and joo for their articles.

In the trailer GA class optimizer and an example of its use in the script. If you can not find it hard to run it. Questions on usage and bugs are sent here.

Files:
 
ivandurak:

I have added a class to create a GA optimizer. Special thanks to Roman Rich and joo for their articles.

In the trailer GA class optimizer and an example of its use in the script. If you can not find it hard to run it. Questions on the use of bugs and plz here .

Not too lazy, ran.

2011.11.18 17:30:10 PrimerGA (EURUSD,D1) X1 = 3.068966720346887 X2 = 3.315651165492819 Solution = -4.31815752349534

2011.11.18 17:30:07 PrimerGA (EURUSD,D1) X1 = 3.029136351314492 X2 = 3.309540883455843 Solution = -4.263691893969934

2011.11.18 17:30:00 PrimerGA (EURUSD,D1) X1 = 2.449305079854762 X2 = 2.817163285313374 Solution = -4.174465090531069

2011.11.18 17:29:52 PrimerGA (EURUSD,D1) X1 = 3.063254884005564 X2 = 3.313075674783155 Solution = -4.314453236316976

2011.11.18 17:29:40 PrimerGA (EURUSD,D1) X1 = 3.078649362527705 X2 = 2.169112355456941 Solution = -4.25838612042264

Why is there such a wide spread in the solution?



 
her.human:

Didn't take the trouble to run it through.

You get not the best, but quite acceptable solution. And the function itself, thanks to joo, looks like a hedgehog. If you want to increase the accuracy of the solution you have to sacrifice the volume of calculations, in my opinion this is a less optimal ratio. I was not interested in the problem of high complexity, but in the practical side. There are usability, bugs .....
 
ivandurak:
You get not the best, but quite acceptable solution. And thanks to joo the function itself looks like a hedgehog. If you want to increase accuracy you will have to sacrifice amount of calculations, in my opinion this is a less optimal ratio. I was interested not in the problem of high complexity, but in the practical side. There are usability, bugs .....

This function is flowery (soft and fluffy) compared to what you are about to do.

Practical side: I haven't found how to raise the accuracy without directly interfering with the code.

 
her.human:

This function is flowery (soft and fluffy) compared to what you are about to do.

Practical side: haven't found how to raise accuracy without directly interfering with the code.

I've added another method. Which allows the user to select the number of individuals in the colony and the number of epochs. Everything is in the trailer.
Files:
 
I came close to writing a Strategy Tester, and now I face a dilemma. If we take 4 as a basis, we get a simple and very effective tool in terms of analysis of the TS according to trading results. If we take 5, then the convenience of portability of the code. So far, my imho is inclined to the first option, as they say in check or go.
 
And from my observations, history does not repeat itself, so I would disagree on the first point
Reason: