A great book on testing and optimisation - page 4

 
I searched very long and persistently for a justification of "stability" of optimization by EA's parameters (closeness of adjacent green squares by the optimization criterion to the optimal one) that is discussed so much here. The only substantial justification I have found so far is WFA (forward analysis): if an optimal strategy is found in the area of a hollow extremum of the optimization criterion, then in WFA parameters optimized in different areas will not be too far from this maximum, i.e. they will not give parameters that much different from those optimized for the real trade.

None of the other arguments on this forum, and in Pardo's book as well, have convinced me of the feasibility of this "sustainability". VelesFX, I agree with you about "You win in profitability, you lose in sustainability". There are many, many thoughts; we are slowly putting them into an article...
 
VelesFX:
xeon wrote (a):
If nothing prevents, soon I will finish the library that will allow to implement "forward analysis" in full.

How will the library work please?

I have an idea of search of consistency via FT, here is such:

I.e. we take three test windows (TO) on each of them we run optimization, we save optimization results on each TO, then we choose on one of TO runs in order of decreasing profitability. We take the number of run, find runs with the same number in two adjacent TOs and if profitability of these two runs satisfies us
then we consider that the run with this number of FT has passed.

If you spend FT in this way it is possible to get very interesting results in my opinion: In all cases the most profitable runs on one TO, on others will show either very modest or even negative results. But some not particularly profitable runs may turn out to be very consistent and each time they will show approximately the same profit.

Apparently, there is a pattern of "you win in profitability, you lose in consistency", and vice versa. What do you think?

The library is designed as a tool, which allows for testing and optimization in two basic modes:

1)Auto mode:

Conducting testing and/or optimization by predefined macro programs.

2) Manual mode

Running testing and/or optimization by user-written macro routines. So you can easily implement your own testing algorithm.

The process of working with the library is maximally simplified, for example in auto mode you need to set parameters for testing/optimization as usually in the tester, but instead of the start button launch the script and select the appropriate macro program and that is all. (as opposed to auto-optimizer)

here's the short version.

 
xeon писал (а):


The library is designed as a tool that allows testing and optimisation in two main modes:


1)Auto mode:


Conducting testing and/or optimisation according to predefined macro programs.


2) Manual mode


Running testing and/or optimization by user-written macro routines. So you can easily implement your own testing algorithm.


The process of working with the library is maximally simplified, for example in the auto mode you need to set the parameters of testing/optimization as usual in the tester, but instead of the start button launch the script and select the appropriate macro program and that is all. (as opposed to auto-optimizer)


here's the short version.

Cool, just what I was dreaming of. We were about to write one of these ourselves.
 
There are no guarantees in forex, not back-tests, not forward, not even real account testing. Forex will refute any test results, and any strategy, which is why it is Forex. Remember the experience with flipping a coin, no matter how you analyze past experiences, they do not help you to anticipate the future. Of course this concerns currency rates, which is what everything revolves around, while stocks and futures have a different mechanism. That is why the whole western (read: American) tehanalysis is based on them.
 
Valmars, I have an idea. I will intentionally, for fun, write down a complete list of what Pardo offers here in this thread. It will be very impressive (I finished my preliminary reading of this book today). Let this list serve as a reminder to grail makers of how much they underestimate the current level of understanding in this field. Still, this list is, by the book's intention, at least some, not at all 100%, relative assurance that the strategy has a reasonable right to exist. The list will be here shortly.

Yes, we won't be able to predict the future. But maybe that's not our goal? Our goal is to build a strategy that works profitably on as much variety of data as possible. Verifying this is the task of full-fledged testing. Roughly speaking, we should be able to put some "framework" on the market data giving the entry/exit points. And what this framework will do in the future is not our concern...
 
Mathemat:
Valmars, I have an idea. I will intentionally, for fun, write down a complete list of what Pardo offers here in this thread. It will be very impressive (I finished my preliminary reading of this book today). Let this list serve as a reminder to grail makers of how much they underestimate the current level of understanding in this field. Still, this list is, by the book's intention, at least some, not at all 100%, relative assurance that the strategy has a reasonable right to exist. The list will be here shortly.

Yes, we won't be able to predict the future. But maybe that is not our goal? Our goal is to build a strategy that works profitably on as much variety of data as possible. Verifying this is the task of full-fledged testing. Roughly speaking, we should be able to put some "framework" on the market data giving the entry/exit points. And what this framework will do in the future is not our concern...

Don't you think forward testing is not the best way to spend time with????? :(!!! Because if you run the system one more time, we just increase N - the number of deals, which reduces the standard error.
If you want to increase the number of trades we just increase N - the number of standard errors.
The way I suggested to make FT 6 messages above is similar to merging of three TO's into one big one and dumb optimization on this big TO? :))) though of course not absolutely all so, but almost.

And what if to consider, the work of the configured trading tactics in real trading conditions as a random event, for example a toss of the same coin or dice. I.e. the system profit for the i-th month of work is a random value and there's nothing to do with this randomness, we can probably only change its parameters (setting, optimization).
Correct me if I'm wrong!!!
 
To be honest, what you highlighted in bold, I didn't understand. Please explain,VelesFX. I see the value of WFA precisely in the "diversification" of the optimized system over different market behaviors, and precisely on the data on which the optimization has not been performed. And what is interesting, WFA repeats the actions of a trader when he enters the real market with this system. What makes it so bad?

A dumb combination of all optimization sections into one will not give a walk-forward effect.
 
Mathemat:
Yes, we cannot predict the future. But maybe that is not our goal? Our goal is to build a strategy that works profitably on as much data as possible. Verifying this is the task of full-fledged testing. Roughly speaking, we should be able to put some "framework" on the market data giving the entry/exit points. What this framework will do in the future is not our concern...

I, on the other hand, think that our goal is different: In practical terms, I don't care how much profit (or loss) my strategy made a year or two or five years ago. What is important to me is that it gives a tangible profit now, two or six months in the future, and then, let it begin to fail. I will give it up and find another one, if I can, which is losing money now and will start working in six months. Of course, I will lose before I can determine that the strategy has stopped working (giving profits, or that in other words the market has changed), but hopefully not everything.

It is probably possible to find a strategy that will be profitable for 7 years, but it will not be optimal for the current moment, will give results worse than my current (in the past - plum) strategy. I think we need to focus on the state and time of change of the global market (the fundamentals of the world economy), and such changes occur within ~ 2 years, in my opinion, this is the "life time" of a profitable strategy.

I.e., the practical approach differs from the theoretical creation of a "universal strategy". Besides, I believe it is impossible to create such a strategy for one currency pair, for instance. I think you can create an "Expert System" that will analyze the market condition, choose promising instruments for operations, calculate risks in transactions according to probabilities of events, find the best (optimal in terms of risks) points to enter a position when the decision on the instrument is made, hedge positions with other instruments, perform multicurrency money management, i.e. simulate the work of an expert, or even an entire investment company (fund) or bank. And I think such systems have been created and exist within the international financial system with its unlimited financial possibilities. But this is beyond the possibilities of MQL and you and me.

 
Mathemat:
Honestly, what you highlighted in bold I didn't understand. Please explain, VelesFX. I see the value of WFA precisely in the "diversification" of the optimized system over different market behaviors and exactly on the data on which the optimization has not been performed. And what is interesting, WFA repeats the actions of a trader when he enters the real market with this system. What makes it so bad?

A dumb combination of all optimization sections into one will have no walk-forward effect.
WFA - NOT BAD AT ALL!!!!! :))))

And this phrase I cannot fully understand: " I see the value of WFA in "diversification" of the optimized system over different market behaviors and exactly on those data, on which the optimization was not conducted.

Let me explain the essence of FT using my method:
1. If we have three TOs we conduct optimization on the middle (in time window #2), TO #1 - this window is located in the "past relative to TO #2", TO3 - respectively in the future.
So, if we need to achieve certain parameters of the system (yield, profit factor, max drawdown ... ). Then ...

We take three test windows (TO) on each of them we run optimization, save the optimization results on each TO, then we choose the runs on one of the TO in descending order of profitability. We take the number of a run, find runs with the same number in two neighboring maintenance services and if profitability of these two runs satisfies us
we consider that the run with this number has passed.
You can take runs not in descending order of profitability, but in descending order of any composite quality criterion (for example K = Profitability - Drawdown).
As the result of this search we will find a "stable over history" system, i.e. the system that draws something like this at every maintenance:




And accordingly it will draw a line with the same slope at the maintenance test (TO1+To2+To3) - so this system will be most "stable", we can also assume that it will be most stable, because it has been tested in a various market context and shows stable growth of the deposit at every maintenance. Well this is not FT, this is some sophisticated (perverted) way of optimization :))), and FT as an attempt to "diversify" the optimized system by different market behaviors is a special case of this method.

Therefore WFA is only a way to avoid overfitting !!!!

And, interestingly enough, WFA repeats the actions of the trader when he goes for a real trade with this system. What makes it so bad?
No - number of deals on optimisation TO, Nf - number of deals on forward test TO.
Maybe it's just increasing N = No+Nf - size of sample, increase of forecast reliability. The more N is, the more probability P that the system will show profitability similar to that of the previous one in the next test window.

 
The WFA does not allow you to avoid tinkering.