Forex Expert Advisors

How to optimize your forex advisor on history

How to optimize your forex advisor

Dear forex traders!On the pages of the blog, we have already discussed the preparation of quotations and expert testing, but now it is time to talk about optimization of experts.We have to optimize both opponents and supporters and opponents more.

Why is this happening?The optimization process is quite multi-faceted advisors to properly optimize your adviser need some knowledge, inaccessible for the beginner due to lack of experience.It adds fuel to the abundance of a variety of information on the Internet are often not true or distorted.That's why so many supporters optimization opponents - people do not know how to use it.In this tutorial I'll show you how to properly optimize the adviser and, hopefully, will spare someone from beginners a couple of deposits.

What is optimization

that such optimization advisers

no secret that manual trading system with time become obsolete and no longer generate the profits that bring the past.At the same time the old money-losing strategy suddenly begin to show themselves well.All be

cause of cyclical market, with some trading conditions are replaced by others.The same thing happens with the advisors.Market conditions are no longer fit the strategy inherent in the algorithm advisor and he starts to lose money.What to do in such a situation, just remove the counselor and forget about it?Fortunately, in this case, we have the support of optimization.So what is it?In fact it is just fitting the expert parameters under the current market conditions, the adjustment strategy, its adaptation to the changed conditions.As traders adjust their manual trading system under the current market and adjust their algotreydery advisers.Change, adaptation - an integral part of the trading process.Anyone who does not change in time - remains behind, that's life trader.

Model Selection

selection model optimization forex robots

So, we are determined that optimization is still important and even necessary part in the trade with the help of advisers.In addition, once again, you already know how to upload quotes, installed in the terminal and test experts, aware of what "sets" or set-files.Now is the time to open a terminal and spend optimization.When I talked about expert testing, I told you about the three test models and their features.I recommend to optimize advisers' ticks all "model.This is the most accurate model, and the probability that you will do something wrong to become smaller.Here is an example for the three models Advisor test for comparing outcomes, so that you clearly could see in my words:

Model "on the opening prices»

opening price

Model "checkpoints»


«all ticks" model

all the same

So, think now, no one has a question, why it is desirable to optimize it for "all the ticks" model.Notice how much different from the first version of the second and third.Results of the model of "control points" may differ too greatly from the results of the "Every tick" model.Only in this case allowed the optimization of the check points in order to save time.Therefore, we must first get rid Advisor tests in all three modes and compare the results to decide.

Tab testing

tab testing

Position "parameters to be optimized," allows you to select the main output parameter that will be evaluated each run, namely:

  • «Balance» - selection is on the final value of the deposit balance;
  • «Profit Factor» - the selection is conducted by the final ratio of the total amount of trades to the total amount of losing trades (ie profitability, as a minimum, must be greater than 1);
  • «Expected Payoff» - selection is on the final expectation, ie,the average of the profit per trade.(Expectation a minimum, there should be equal to or less than the spread size);
  • «Maximal Drawdown» - selection is on the minimum reaches the size of the maximum drawdown.In other words, Maximal Drawdown - is the largest amount of funds on deposit which decreased from the corresponding local maximum.In fact, this figure shows the real price of risk.For example, if the maximum drawdown exceeds the amount of the initial deposit - should strongly consider the revision of the deposit amount.
  • «Drawdown Percent» - selection is on the relative loss, ie,the percentage size of the maximum drawdown in relation to the size of this deposit.Use this option as the main output is useful when EA trades non-fixed lot size or enabled such progressive lot.

Also, you may notice a tick in front of the genetic algorithm.If you remove the tick, the tester will drive absolutely all possible combinations of expert parameters.At the same time optimizing likely require about 100,500 years.Fortunately, the terminal is built to search for optimal parameters using a genetic algorithm, which allows optimization in just a few hours or days.In principle, this is all you need to know, because this tick - a topic for a whole separate article.

tab inputs

Input parameters

Optimization councilors decided to carry out as well as testing off money management, lot 0.1.To do this, find a counselor in the corresponding block parameters and set the fixed lot 0.1.Table tab input parameters contains 4 columns - the parameter itself, its current value, the starting value for the optimization step and the final value for the optimization.What does it all mean?For example, we want to at some point in time to pick the best stoploss advisor.To do this, we set the initial value of the stop (start), say, 10 points.Target value, eg 60 - with a stop longer than 60 days there is nothing inside.We can ask a million, but the choice of these values ​​should be approached wisely, otherwise it will greatly increase the time spent on optimization.And the last - step.If we give a step 10, for example, we get the following sorting of the selected parameter: 10, 20, 30, 40, 50, 60. Here, too, should come up with a logical point of view, it makes no sense to put step 1 or step 10 (5).It is suitable step 2, which will also save resources.

And what do you do if a lot of parameters?

a lot of forex optimization settings

The more options you are testing at a time, the longer the optimization will take place.But there are times when so many parameters that optimize terminal refuses and tells about it in a magazine.In this case, you need to break all the settings into 4 groups: strongly influence the result of the parameters affecting the medium and weak, will not affect at all.To determine the degree of influence can be a test of a single parameter optimization.Naturally, to optimize in the first place should be the parameters that strongly influence the results, and then as everyone else of importance.

Tab Optimization

Opportunities tab

This tab is also designed to save time optimization.Here you can set its own rules dropout results, and at the stage of the most optimization.For example, to limit the maximum number of losing trades in a continuous four and a maximum drawdown of 10-th percent.Then the results of the optimization will only see results that meet these parameters.

segment Choosing to optimize

selection interval when optimizing forex robots

In principle, this is the main issue in the optimization of the advisor and a proper choice of this segment will depend on whether you earn some money, or lose.This moment is the source of so many ardent opponents optimization and working with counselors at all.

approach novice

So here are used by many newcomers approach.Take the short period available stories (often no longer than a couple of months, so the wait was not long) and press the button "start".the passage is selected after completion, which gave the most "bubble".All the set is installed on the real and the novice prepares bag of money, often while still showing off her "grail."And then, of course, there is the sink.

popular approach

This approach - the most common among non-beginners.Select two sections history section of site optimization and forward test.At the same time optimizing the site is located in front of the forward portion of the test, with no breaks in days.As a rule, optimization is selected the first two thirds of the selected portion of the history, and the striker recovered the remaining one-third.On site optimization and the best are selected, and the forward period, which the adviser has not "seen", there is a selection of quality settings.The choice is determined by the history of the site at the discretion of the trader.The greater the area, the more adapted to different settings unexpected market, the longer it will earn at the same settings, the later sets obsolete.But it is the smaller will be the total profit counselor.The shorter the period of optimization, the more customization tailored to specific market period, certain trading conditions but the greater its efficacy under these conditions more profit.You can optimize every week, and it is possible every five years - who is more to your taste.But there is one drawback to the diligence of traders to find the optimal settings for the short section - you never know when setting expire.You can guess with a set and a future full week EA will trade profitably, and it may happen that on Monday the nature of the market has changed and advisor throughout the week will be drained.Personally, I have this lottery somehow does not inspire, and I do not seek to optimize chase at maximum efficiency.Instead, I pick sets "on year".

In addition, there is an opinion that further than three years ago to look pointless.I can not dispute the facts of this claim, but still choose to optimize the period not less than 6 years from the forward portion of the test is not less than two.I'm so relaxed.

In general, the pursuit of the trend has the right to life, especially if you're in the pros and you really get the time to anticipate when your setup will no longer work.

voodoo approach

often met the internets this voodoo approach, which is issued for the approach to real pros.Plot stories is divided into two equal sections.On each of them separately the optimization saved 10-20 variants successful settings.Then, setting of the first and second section are compared and those that roughly resemble, taken as optimal.This is complete nonsense, takes time, and the car does not carry any meaning.Using this method of voodoo, you kill a bunch of nonsense hours and in the end, Put your eyesight.

My approach

The purpose of the approach - to find the universal setting that will provide long-term sustainable profitability, regardless of the nature of changes in market, volatility, global trend, these settings, which expire in a week, month or year.At the same time, unfortunately, not everyone is able to pass Advisor my tests.

So, suppose we have a piece of history in 15 years (at least 10), for example, from 2000 to 2015. Divide this piece into the following periods: 2000-2003 - this is our piece bekvard Test, 2003-2012 -optimization period, 2012-2015 - forward test.After optimization we perform as usual forward testing, selecting the most successful 10-20 sets.After that, the selected sets bekvard run on a test site.The results should be similar to the obtained by the forward.Those sets that have stood the test remains for further comparison.Next, we run the tests on the remaining sets to the entire piece of history and choose the one whose results are better than others.The result is one of the fittest settings set.
How to select sets in the first stage - the forward test?Very simple: the most important thing for us at this stage - the form of the balance curve.Ideally, it should be a straight line running from the lower left to the upper right corner.At the same time it makes no sense to watch all the best sets in a row - often they are practically identical.Filter is the best sets differ only in the number of transactions.

If different trading in real life and in the tester

Forex trading in the tester and in real life

So we have cherished set files for our EA.At the same time put on a real account adviser until early.It is time to check out our sets on a demo account.In principle, 20-30 transactions on a single pair of precisely enough to see whether the set was a success.In addition, it makes sense to check whether the deal on the same demo with the transactions in the same period in the tester.To do this test and compare the readings.If the transaction at least approximately the same, then everything is fine.Do not wait pip trades in pips and the second in the second, as if some transactions not to be missed, too, no big deal.Important general picture, the overall similarity.In the real world job counselor will always be slightly different from the test - for slippage, the adviser was not included because of the very high spreads, then requotes or something else.But the picture should not be radically different course!If you see on the test did not such as to the real picture, the Advisor to optimize this is useless - no matter how beautiful you may have picked up a set, trade adviser will still be different.


Finally, optimization of forex advisors

Today you have learned the basic principles of optimization of experts.Nevertheless, there is still a lot of different chips, which I could not tell in one article.And yet, the knowledge that you have received today will be enough to carry out the optimization advisor working for a period of H1 and above so that for many years he has brought you a profit.Optimize advisors correctly and then maybe algotreyding becomes a little more attractive occupation in the eyes of traders.