Discussion of article "Extract profit down to the last pip" - page 14

 

I was asked (I'm not voicing the question). Answer.


The translation was made at the initiative of MetaQuotes in a very short time. I assume it was due to monitoring.

At the end of the text there is a not insignificant conclusion, so you can read it. There is no sacrality there, everything is just business.


There is no sense in retelling the article. Briefly.

  • Before any research it is necessary to take a reasoned approach to the choice of the source of historical data. The evaluation criterion is given, including the source code.
  • Work with tick data. Since there are so many of them, filtering can be applied. One option is suggested with the source code.
  • Explore not just one symbol, but all of them. I.e. create shuffles for Optimisation. A ready tool for this purpose for MT5 is again available with source code.
  • It shows what pitfalls the Tester may contain. Suggested steps to set up the Tester to reduce the likelihood of self-deception.
  • It is suggested to write the TS cross-platform. MT4 is taken as a benchmark of trading API convenience. We offer a wrapper (source code) of this API for MT5. By analogy it is possible to make a similar wrapper for any platform.
  • The importance of mat. expectation and ways to fight for its increase are discussed.
  • Thoughts why forward optimisation is not desirable.
  • The importance of time of day for market patterns is emphasised. A simple method of finding the optimal daily interval instantaneously is proposed, working from source code. This speeds up optimisation by orders of magnitude.
  • The importance of execution quality on the part of the broker is discussed.
  • A method with source code is offered to solve the complex problem of results discrepancies between the real (redirects, partial fills, connection failures, etc.) and the tester.
  • The reason of the difficulty of profitable copying of trading signals of TS with low expectation matrix is explained.
  • It is briefly confirmed that MM (martins, grids, etc.) do not increase profitability.
  • It is suggested to create a portfolio from the same TS. It is shown in the monitoring.
  • On the example of real trading the influence of positive slippages of limit orders on the overall result is demonstrated.
  • It is proved that mediocre trading conditions often force the authors of potentially profitable TSs to throw them into the trash.
  • The article is a clear presentation of a real case of finding one of the profitable (so far) TS with the help of the previously posted open-source toolkit. After such a case, the idea of writing a recipe article with monitoring at the start arose. MetaQuotes fully supported the idea and reviewed the article as soon as possible. The text and screens were ready in a couple of days from the moment the TS was detected (it was found almost immediately with the help of MultiTester).

The higher the qualification in writing automated TCs, the more interesting the article is.


The answer to the question "why does the author need it?"

I lack the willpower to make trading tools only for myself. When I share them, I force myself to clearly formulate my results and put them in a convenient state. That helps me.

I also get feedback in the form of bug reports, new ideas and suggestions. Stakeholders contact me and sometimes give me useful information.

 

September 2019: +51%.


 

A black swan flew to one of the eight TCs. Below is the result in pips and it seems a bit.


But at the expense of MM in money it looks like a regular poker.


A classic market situation happened. It did not reach the take profit two points and went backwards without any reversal on the figure.

In duration distributions such a swan stands out(you can see it betterhere ) as follows.

Why could a catastrophe occur? Because it is one of the most profitable sets in the tester (and the best on the real all the time). And if only this set had been placed classically, the account would have experienced a record drawdown, although the profit could have been much steeper.

It is because of such unlucky situations, when a point or two does not reach the close, that it is reasonable to run a portfolio from the same TS.

 

Real VS Tester.

Red - no slip. Blue - with sliding.


Since nothing has changed since the launch, we can compare the difference between the results in Tester and Real for each TS.

The red line shows the result without slips. The coincidence for each TS is quite high.

The blue line shows slippage. It is a bit unusual here, because you can see sliding in the Tester and sliding on the real. The lines are again quite close.


It should be taken into account that there were redirects and connection interruptions (50 times a day for 10-20 seconds each).


The graphs are plotted using Graphics.mqh through Report.mqh.

 

There are two approaches when setting up the TS

  1. Trading with a constant lot.
  2. MM, as a part of free funds (or balance).

The first case is good because you can see the value of the expectation matrix of the used pattern. It would seem that the higher it is, the better. But when it comes to reinvesting a robust TS, it may happen that a larger number of small trades is more favourable than a smaller number of larger trades.

For example, in pips the result can be the same for two passes. But the pass with a larger number of deals may become more favourable for reinvestment.


Therefore, it is good to have an optimisation criterion for reinvestment.

I took the following: what relative profitability is achieved at a rigidly specified maximum relative drawdown.

You can see the algorithm of calculating this profitability here.

sinput double inMaxDD = 0.3; // For what maximum drawdown should I calculate the risk?

double OnTester()
{
  double SumGain, MaxDD, RF;
 
  // https://www.mql5.com/ru/forum/170953/page21#comment_13448682   
  return(GetSumGain(GetRisk(inMaxDD, 0.01, _Symbol), SumGain, MaxDD, RF, _Symbol) ? SumGain : 0);
}

With this calculation, you can not think about MM at all in your TS for a tester. Everything will work as if there is MM.


Of course, an additional condition is added to OnTester for the presence of negative trades and their large number.