Discussion of article "Controlling the Slope of Balance Curve During Work of an Expert Advisor" - page 4

 

solandr:

I conducted the following experiment. I set the counter to trigger a reduced lot for each currency pair. And tested all combinations of testing on M1 OHLC. Here is the result.

35 0 0 - testing only on the first pair

0 36 0 - testing only on the second pair

0 0 0 168 - testing only on the third pair.

36 35 0 0 - testing on the first and second pairs

0 35 162 - testing on the second and third pairs

35 35 166 - testing on all three pairs

Although it should be 35 36 168 when testing on all three pairs.

Tomorrow I will try to run the EA on all ticks for comparison.

If I understand you correctly, the number of trades is different? So how can the lot size affect it?

 
Dima_S:

If I understand you correctly, - the number of transactions differs? So how can the lot size affect it?

No, the total number of trades on 3 currency pairs at the same time corresponds to the sum of trades in separate runs.

The results show the number of orders opened with a reduced lot.

I'm still running the Expert Advisor. I am trying to understand what it changes the results of the total run. I will write a message later.

Документация по MQL5: Торговые функции / HistoryDealsTotal
Документация по MQL5: Торговые функции / HistoryDealsTotal
  • www.mql5.com
Торговые функции / HistoryDealsTotal - Документация по MQL5
 
solandr:

No, the total number of trades on 3 currency pairs at the same time corresponds to the sum of trades in separate runs.

The results show the number of orders opened with a reduced lot.

I am still running the Expert Advisor. I am trying to understand what it changes the results at the total run. I will write a message later.

Probably, due to some changing conditions, the profit/loss for trades changes slightly from run to run - as a result, at some points of the balance curve the lot switching may (or may not) occur.

It goes something like this.

 
Dima_S:

Perhaps due to some changing conditions, the profit/loss for trades changes slightly from run to run - as a result, lot switching may (or may not) occur at some points in the balance curve.

Something like this.

In principle, the idea is a good one. Under MT4 I even use a special programme Spread Changer, which allows you to set the spread for testing arbitrarily. and the results do not float.

I haven't found such a programme for MT5 yet (maybe I didn't look for it well). It would be great if in future releases of the terminal developers would build such a function into the tester for those who want it.

 
solandr:

In principle, the idea is good. Under MT4 I even use a special programme Spread Changer, which allows you to set the spread for testing arbitrarily. and the results do not float.

I haven't found such a programme for MT5 yet (maybe I didn't look for it well). It would be great if in future releases of the terminal developers would build such a function into the tester for those who want it.

Ideally, a simple import from csv-file of quotes for testing would be useful. But, the ideal is not achievable yet)))
 

I ran the EA on all ticks. I got the following results:

With disabled balance management profit on runs:

0 0 0 0 0 6702,44 first pair

0 0 0 0 0 5735.78 second pair

0 0 0 0 0 3461.48 third pair

0 0 0 0 15901.66 all three pairs - Should have been 15899.7. The difference is 1.96.

With lot management enabled profit on runs:

35 0 0 = 6550,94

0 36 0 = 6956,95

0 0 184 = 3386.44

35 36 179 = 15991.56 - Should have been 16894.33. The difference is 902.77

As you can see with auto-balance disabled there is also a difference, but it is usually microscopic. When lot control is enabled, the difference is quite noticeable 5.3% (due to the different number of triggers of the reduced lot). How to optimise the parameters here? What way out can be invented?

Each run on all ticks takes about 20-30 minutes.

I am going to set up such an experiment. Take some simple Expert Advisor, add a lot control system to it and see the difference in runs.

 

By the way, when compiling the mqh file from the article, I get these messages:

possible loss of data due to type conversion BalanceSlopeControl.mqh 117 25
possible loss of data due to type conversion BalanceSlopeControl.mqh 118 21
declaration of 'current_slope' hides member declaration at line 682 BalanceSlopeControl.mqh 909 9
0 error(s), 3 warning(s) 1 4

I corrected them at the very beginning. The first two - I specified the type of conversion. And I corrected the third message by correcting the name of ccurrent_slope in line 909 and corresponding correction further in double TBalanceSlopeControl::CalcTradeLots( double _min_lots, double _max_lots ).

Maybe this is where the dog is buried? In any case, it would be possible to post the file corrected by the author himself, as my changes may be ideologically wrong.

Документация по MQL5: Основы языка / Типы данных / Приведение типов
Документация по MQL5: Основы языка / Типы данных / Приведение типов
  • www.mql5.com
Основы языка / Типы данных / Приведение типов - Документация по MQL5
 
solandr:

I ran the EA on all ticks. I got the following results:

...

As you can see, when auto-balance is disabled, there is also a difference, but it is usually microscopic.

Achieve identical results in all modes when testing on any symbol.

To do this, work either by ticks of all symbols, or by timer. and control the appearance of a new bar on all instruments.

The balance should not diverge by a cent.

Обработчик события "новый бар"
Обработчик события "новый бар"
  • 2010.10.04
  • Konstantin Gruzdev
  • www.mql5.com
Язык программирования MQL5 позволяет решать задачи на совершенно новом уровне. Даже те задачи, которые уже вроде имеют решения, благодаря объектно-ориентированному программированию могут подняться на качественно новый уровень. В данной статье специально взят простой пример проверки появления нового бара на графике, который был преобразован в достаточно мощный и универсальный инструмент. Какой? Читайте в статье.
 
solandr:

By the way, when compiling the mqh file from the article, I get these messages:

possible loss of data due to type conversion BalanceSlopeControl.mqh 117 25
possible loss of data due to type conversion BalanceSlopeControl.mqh 118 21
declaration of 'current_slope' hides member declaration at line 682 BalanceSlopeControl.mqh 909 9
0 error(s), 3 warning(s) 1 4

I corrected them at the very beginning. The first two - I specified the type of conversion. And I corrected the third message by correcting the name of ccurrent_slope in line 909 and corresponding correction further in double TBalanceSlopeControl::CalcTradeLots( double _min_lots, double _max_lots ).

Maybe this is where the dog is buried? In any case, it would be possible to post the file corrected by the author himself, as my changes may be ideologically wrong.

Not likely here. I remember something rules, but what - I do not remember))) Here is my current file.

Files:
 
Dima_S:

I don't think so here. I remember something rules, but what - I don't remember))) Here is my current file.

Thanks for the new version of the file!

Comparing the contents of the file with the file from the article shows a few differences in the new file in lines 37, 115, 116, 907, 966.

Let's see how much these changes can affect the Expert Advisor