Optimisation! Share your experiences, please. - page 3

 
solandr писал (а):
I gave a link to Bakeev's proposal for comparing the results of optimization on martingale to understand how your algorithm can be sharpened for a random curve (how viable the idea of the algorithm is). And from there you are to decide whether you want to do it or not.

You're hooked on Bakeev:):):)
I think a tester run on a non-optimizable "piece" of history is quite enough.
 
sashken:

You're hooked on Bakeev:):):):):):)
I think a tester run on a non-optimizable "chunk" of history is enough.

The results of running on a non-optimizable chunk of history (out-of-sample) may turn out to be random. Because of this, there are two possible problematic situations:
1. Adoption of a draining strategy, if it shows a profit at the non-optimized part of history.
2. Not using a profitable strategy, if it showed drawdown at the non-optimized part of history.

Generally speaking, the problem of counter-fitting is probably the most complex in construction of MTS. And just to say that we should optimize so-and-so and not so-and-so is like pointing the finger in the sky, because there is probably no exact answer, IMHO. It is necessary to consider all possible options for testing the strategy before putting it on real money. I consider the directions on Bakeev as one of the additional options to consider a strategy for use in trading. I myself have not yet reached its application in practice, but plan to use it in the foreseeable future. As they say, I just shared my thoughts with a person who has come to a deadlock, which ALL EA writers, regardless of the level of training and worldview, go to when they put the MT4 tester to optimize it. The more so, with the advent ofthe genetic algorithm in the tester, the ability to fit ANY curve has only increased!
 
Vita:
AndyGri:
Is it possible to adjust the parameters for so many trades and can the market change so immediately? What to do?

The easiest way to check "is there no curve fitting?" is to change one or two parameters by 5-10% and get poor test results. Have you checked?

No, but I will. Thank you!
 
Reshetov:
AndyGri:
sashken:
Why don't you brag? :) And post the code of the Expert Advisor?
Or at least tester reports. Maybe the picture will get clearer:)

Strategy Tester Report
chas_GBP_TP_TSnorm_SLlowHigh

Symbol GBPUSD (Great Britain Pound vs US Dollar)
Period 1 Hour (H1) 2006.01.01 23:00 - 2007.03.21 00:00 (2006.01.01 - 2007.03.21)
Model All ticks (based on all smallest available periods with fractal interpolation of each tick)
Parameters porog=1; MAmor=2; MAtrend=24; risk=0.1; CandleBar=0.55; TP=120; TS=70; SL=54; TimeCH=10; VolP=1.5; t=0; porogSL=10; candle=11; candleEX=17; MAporog=17; DellOrd=23;
Bars in history 8494 Modelled ticks 1576481 Simulation quality 57.67%
Initial deposit 1000.00
Net profit 3745.64 Total profit 7681.59 Total loss -3935.95
Profitability 1.95 Expected payoff 25.14
Absolute drawdown 0.00 Maximum drawdown 384.68 (12.31%) Relative drawdown 12.31% (384.68)
Total trades 149 Short positions (% win) 60 (65.00%) Long positions (% win) 89 (75.28%)
Profitable trades (% of all) 106 (71.14%) Loss trades (% of all) 43 (28.86%)
Largest profitable trade 120.00 losing deal -263.31
Average profitable deal 72.47 losing transaction -91.53
Maximum number continuous wins (profit) 8 (547.11) Continuous losses (loss) 3 (-249.45)
Maximum Continuous Profit (number of wins) 635.18 (7) Continuous loss (number of losses) -263.31 (1)
Average continuous winnings 3 Continuous loss 1

Everything is clear. Testing and optimisation on the clock, and real trading 2 times in 3 days, i.e. a complete mismatch between the timeframe of the test and the real one. You should move the tests to daily chart, it's closer to the truth. Or, if it is inconvenient to output at the end of the American timeframe, then run the EA at a certain hour, but add it to the code:
...
//the time of advisor starting
extern int hour = 12;

...

int start() {
if (hour != TimeHour(Time[0])) return(0);
// EA code
...
}

Please note that the time you set in the hour variable corresponds to the time of your brokerage company, not the time on your computer. Therefore, it may be shifted.

Thanks for the tip. I started with daily candlesticks, but changed it to watch ones, because there is more information for analysis. Overall... the results are more stable.
 
solandr:
AndyGri:
The sample is large - under 160-200 market entries, and 2 weeks is not the time frame for big changes. Is it possible to fit the parameters to so many trades and can the market change so immediately? What to do?
160-200 trades - are you kidding? If you have 5-7 optimizable parameters, thousands of deals can easily fit to the curve (And you have 16 external parameters for optimization!!! - Tens of thousands of trades will be fit to ANY curve if you have enough time and a more powerful computer! :o) Look for example here:
https://www.mql5.com/ru/forum/50458 solandr 18.03.06 20:11
This childhood I was engaged in a year ago. That system then successfully flushed in the real world (I reported about it in the same thread later, somewhere in May 2006). The idea of the system was conditionally taken from the ceiling (catching peaks in the noise). So you are not the first to step on the rake of fitting.
In my first post of this thread solandr 23.03.2007 15:43 I gave a link to Bakeev's suggestion about comparing results of optimization on martingale to understand how your algorithm can be fitted to a random curve (how viable your algorithm idea is). And then it's up to you to decide whether you want to do it or not.

Thanks, that's exactly what I was afraid of, but wanted to hear! Intuitively I understand that this is exactly the case. But I can neither physically prove nor disprove it. But experience is the best proof. Thanks again!
 
Hello!
Please solve the riddle of genetic algorithm.
Here is an example of two optimizer runs:


In both cases the same 2 (two) parameters are optimized, in exactly the same ranges
The first parameter has 11 steps, the second has 21 steps - 11x21 = 231.

First run with genetic algorithm disabled, second time I decided to enable genetics.
Where did the figure of 1280 runs and the time of 53 minutes run come from?
 

Genetic algorithms are appropriate when we are talking about thousands of runs. In your case, 231 is a very small number for genetics. So maybe something went wrong when using the genetic algorithm for optimization in such a small range of runs? Only the developers can answer this question more accurately.

 
solandr:

Genetic algorithms are appropriate when we are talking about thousands of runs. In your case, 231 is a very small number for genetics. So maybe something went wrong when using the genetic algorithm for optimization in such a small range of runs? Only the developers can answer this question more accurately.


I see, thank you!
That's what I thought it was some kind of a glitch... easy to reproduce, though.

Now, as for the optimization experience.
I never tried to optimize all parameters at once. I think it's an excessive waste of computer resources.
It's better to spend time studying relationships of parameters and optimize them through small related groups.
I have two of them: one of them is related to entry into trades and order placement, the other one - to exit the trade.
I optimize entry first, and then exit. The maximum optimization period is half a year.
After optimization I run a test on the entire array - if there are no problems, I start working with parameters.
If there is a huge drawdown at some very close fragment, I optimize during this very period (again, no longer than six months).
Once again I repeat the analysis in the entire database. I do it every 2-3 months, or more frequently, if I do not like the results of the last trade.

I don't see the point in optimizing since 19... year, then the market and now - is, as they say, two big differences!

All said only IMHO.
 
AndyGri:
Gentlemen, I'm beginning to lose faith in EAs, or myself :(. Wrote a lot of variants. Mostly on the pound on watches. I use muwings, stochastics and hourly analysis. I use annual history for writing and optimization. Expert Advisor enters the market an average of 2 times in 3 days. Everything is cool on tests. But!!! ... in real life in the next 2 weeks we lose money... And all is not like that :(. Talking about the parameters being adjusted for a one year period and the market constantly and rapidly changing...? yeah somehow I don't believe it. The sample is large - under 160-200 market exits, and 2 weeks is not a time frame for big changes. Can one adjust parameters to such a number of trades and can the market change so quickly? Tell me how to do it. If something works, brag about it and give me faith. I have lost hope.

for the last 2 losing weeks are the same ? I mean, the Expert Advisor opens trades at the same place where the historical data is ?
 
PSmith:
solandr:

Genetic algorithms are appropriate when we are talking about thousands of runs. In your case, 231 is a very small number for genetics. So maybe something went wrong when using the genetic algorithm for optimization in such a small range of runs? Only developers can answer this question more accurately.


I see, thank you!
I thought it was some kind of glitch... easily reproducible though.

Now, as for the optimization experience.
I never tried to optimize all parameters at once. I think it's an excessive waste of computer resources.
It's better to spend time studying relationships of parameters and optimize them through small related groups.
I have two of them: one of them is related to entry into trades and order placement, the other one - to exit the trade.
I optimize entry first, and then exit. The maximum optimization period is half a year.
After optimization I run a test on the entire array - if there are no problems, I start working with parameters.
If there is a huge drawdown at some very close fragment, I optimize during this very period (again, no longer than six months).
Once again I repeat the analysis in the entire database. I do it every 2-3 months, or more frequently, if I do not like the results of the last trade.

I don't see the point in optimizing since 19... year, then the market and now - is, as they say, two big differences!

All said only IMHO.
Are you talking about the hourly timeframe of the EA? What time period are we talking about when you mention the whole array? How does the EA behave in different years, like 2004, 2005, 2006? My Expert Advisor has alternating dynamics. It either has profit 0 or earned (I'm speaking about the history testing). Thank you in advance for your reply! :)
Reason: