How to optimise an advisor correctly

 

It's an interesting question.

Everyone has their own experience, please share information

how I optimize


I select the area let's say 01 01 2007 - 10.09.2007

1. All branches in Expert Advisor, for example, responsible for the visualization and creation of objects on the chart are turned off to speed up run.

2 DO NOT select parameters that do not affect optimization


After I get a reasonable amount of time, say a day or two... I leave the machine and wait for a sample

Once the sample is received...

I load it into a VFP or MS SQL database

then I use queries to select the optimal values

1. parameters are selected which are not with the maximal profit

each parameter is selected on the principle of maximum presence in profitable runs


let us have 400 runs

300 profitable

let's say

60 runs gave the biggest profit and the smallest drawdown

within these 60, I start to look for parameters that often overlap

for example there are 5 parameters p1 p2 p3 p4 p5

let's say P5 has a value of 39-41 most often in profitable runs

let's say P4 has a value of 12-15 most often in profitable runs

suppose P3 is 1.2 to 1.7 most often in profitable runs

suppose P2 is 25 to 28 most often in profitable runs

let's say P1 has a value of 55 -62 most often in profitable runs


So the last run I'll do is in this range.

that will give you the best parameters


----

1 the bad thing is that there is no way to stop the optimization, i.e. to record the current position and start, for example, on the next day or in a few hours from this point

2) What is bad is that you cannot control the optimization start and control it from the Expert Advisor

 

the site is selected let's say 01 01 2007 - 10.09.2007

You have to go to April for nothing.

 
Prival:

the site is selected let's say 01 01 2007 - 10.09.2007

You have to wait till April for nothing.


as an example

depends on the strategy


if optimized for the future ... for a month - 2

I would choose 21.11.2007 - 15.02.2008

 
In a word I think you just need two good TS, one trend :-) and one flat + a glamorous switch between them :-), you have to look there, the grail lies there - in the switch, not in the optimisation.
 

OK... here's my experience...

1. I write an EA with a minimum of calls to deal history and with a minimum of handling of execution errors returned by the trading server.
2. Optimization interval - from 2001.01.01 to 2007.12.31
3. I choose a set of parameters according to Maximum Recovery Factor = Net Profit / Maximum Drawdown. If there is no set of parameters with FS > 30, then the Expert Advisor is discarded.
4. I check the selected set of parameters for stability by making small changes of all parameters one by one. I do not consider too much fluctuation of FS. That is, I determine whether I have selected the "peak of communism" or the "plateau". If the peak, then this set is discarded and I take the next one.
5. I analyze the flat set of parameters in the analyzer of portfolios for compatibility with other TPs. I form a TS portfolio with FS > 100, write an EA for online trading and put it on the real account.

 
KimIV:

OK... here's my experience...

1. I am writing an Expert Advisor with a minimum of references to deal history and with a minimum of handling of execution errors returned by the trading server.
2. Optimization interval - from 2001.01.01 to 2007.12.31
3. I choose a set of parameters according to Maximum Recovery Factor = Net Profit / Maximum Drawdown. If there is no set of parameters with FS > 30, then my Expert Advisor is discarded.
4. I check the selected set of parameters for stability by making small changes of all parameters one by one. I do not consider too much fluctuation of FS. That is, I determine whether I have selected the "peak of communism" or the "plateau". If the peak, then this set is discarded and I take the next one.
5. I analyze the flat set of parameters in the analyzer of portfolios for compatibility with other TPs. I form a TS portfolio with FS > 100, write an EA for online trading and put it on the real account.


Can I ask a little more about the portfolio, as I've asked many times before, but not from you, from others. How do I get the correlation coefficient bizcom to 1 (-1), you can build a portfolio that will increase the FV from 30 to 100. I cannot make it out of my head. I thank you for your informative reply.
 
Prival:
About the portfolio, could you elaborate a bit more, as I've asked many times before, but not from you, from others. How, with correlation coefficient bizcom to 1 (-1), you can build a portfolio which will increase FS from 30 to 100. I cannot make it out of my head. I would appreciate the detailed answer.

Well... Here's a real example...

System 1 on the interval from 10.01.2001 to 27.12.2007 has EF=42.88, instrument EURCHF
System 2 for the interval from 10.01.2001 to 27.12.2007 has FS=60.32, instrument EURGBP
Combination of these two systems for the interval 10.01.2001-27.12.2007 has FS=102,95

 
or vice versa, swap the currencies (or systems). I'm sorry Igor, but I don't understand, your figures show that CHF and GBP are not correlated, if you use 1 system, if you use 2 different ones and optimize each one on this interval then it's wrong, there is no portfolio investing as they write in the books. I may be experiencing something deep, but I'm sorry. I would have been able to do the same, I would not have wandered the forums looking for answers.
 
Prival:
If you swap currencies (or systems) in the opposite way.

Why? System 1 is tailored to the EURCHF. It has its own set of parameters. System 2 is customized for EURGBP. It also has its own parameters. If you swap the systems, their characteristics will become worse.

Prival:
your figures show that CHF and GBP are not correlated if you use 1 system, if you use 2 different ones and optimise each on that iteration then it's wrong, there is no portfolio investing as they write in the books.
Yes, that's right. Portfolio investing as described in the books is not present in my approach. But some diversification is achieved. Total portfolio drawdown increases to a lesser amount than total profits. The FS grows. I achieve what I want. This is the main thing for me.
 
KimIV:

OK... here's my experience...

1. I am writing an Expert Advisor with a minimum of references to deal history and with a minimum of handling of execution errors returned by the trading server.
2. Optimization interval - from 2001.01.01 to 2007.12.31
3. I choose a set of parameters according to Maximum Recovery Factor = Net Profit / Maximum Drawdown. If there is no set of parameters with FS > 30, then my Expert Advisor is discarded.
4. I check the selected set of parameters for stability by making small changes of all parameters one by one. I do not consider too much fluctuation of FS. That is, I determine whether I have selected the "peak of communism" or the "plateau". If the peak, then this set is discarded and I take the next one.
5. I analyze the flat set of parameters in the analyzer of portfolios for compatibility with other TPs. I form a TS portfolio with FS > 100, write an EA for online trading and put it on the real account.

 
YuraZ:

It's an interesting question.

Everyone has their own experience, please share information

how I optimize


I select the area let's say 01 01 2007 - 10.09.2007

1. All branches in Expert Advisor, for example, responsible for the visualization and creation of objects on the chart are turned off to speed up run.

2 DO NOT select parameters that do not affect optimization


After I get a reasonable amount of time, say a day or two... I leave the machine and wait for a sample

Once the sample is received...

I load it into a VFP or MS SQL database

then I use queries to select the optimal values

1. parameters are selected which are not with the maximal profit

each parameter is selected on the principle of maximum presence in profitable runs


let us have 400 runs

300 profitable

let's say

60 runs gave the biggest profit and the smallest drawdown

within these 60, I start to look for parameters that often overlap

for example there are 5 parameters p1 p2 p3 p4 p5

let's say P5 has 39-41 value most often in profitable runs

let's say P4 has a value of 12-15 most often in profitable runs

suppose P3 is 1.2 to 1.7 most often in profitable runs

suppose P2 is 25 to 28 most often in profitable runs

let's say P1 has a value of 55 to 62 most often in profitable runs


So the last run I'll do is in this range.

that will give you the best parameters


----

1 the bad thing is that there is no way to stop the optimization, i.e. to record the current position and start, for example, on the next day or in a few hours from this point

2) What is bad is that you cannot control the optimization start and its control from the Expert Advisor