Discussion of article "Visualizing trading strategy optimization in MetaTrader 5"

 

New article Visualizing trading strategy optimization in MetaTrader 5 has been published:

The article implements an MQL application with a graphical interface for extended visualization of the optimization process. The graphical interface applies the last version of EasyAndFast library. Many users may ask why they need graphical interfaces in MQL applications. This article demonstrates one of multiple cases where they can be useful for traders.

Let's try to optimize the parameters and see how it looks on the terminal chart. Tester settings: EURUSD H1, time range 2017.01.01 – 2018.01.01.

Fig. 5. Showing Moving Average EA result from the standard delivery

Fig. 5. Showing Moving Average EA result from the standard delivery

As we can see, it turned out to be quite informative. Almost all results for this trading algorithm are negative (95.23%). If we increase the time range, they become even worse. However, when developing a trading system, we should make sure that most results are positive. Otherwise, the algorithm is loss-making and should not be used. It is necessary to optimize the parameters on more data and ensure there are as many trades as possible.

Author: Anatoli Kazharski

 

It is interesting to analyse the reason for the lack of comments on this article.

In fact, the article is another demonstration of a very good graphics library. And one more of its applications is shown.

But the application itself, in terms of usefulness in comparison with the previous articles, does not bring anything new.

Beautiful - yes! Source code - yes! Interesting solutions - no! Description of practical application convenience - no. I.e. you get a beautiful visualisation for the sake of a beautiful visualisation. And what to visualise is not important. The main thing is that there is an opportunity to do it.

That's why it's even difficult to say something after the article. The author is very good! His library has once again shown that it can cope with visualisation tasks. It turns out that the article is intended to demonstrate MT5 graphical possibilities to those who do not know about them - beginners. But it is difficult for beginners, and non-beginners already know about graphics very well. As for frames - very little here about them.

Somehow. Once again, the author has tried very hard, it can not be overlooked. But the final output is an animated picture.

 
when deleting an Expert Advisor from the chart, deinitialisation in the OnDeinit() function is not triggered, which prevents correct processing of this event.

What processing are we talking about? I use frame-mode all the time, I haven't felt any problems with it.

Initialisation of the graphics kernel means that the mouse cursor movement will be tracked and the timer will be activated. Unfortunately, in the current version of MetaTrader 5 , the timer is not enabled when optimisation is complete.

In frame mode, OnInit, OnDeinit, OnTick, OnTrade, OnTradeTransaction and OnTimer are ignored. Only OnChartEvent works. What are the scenarios of using OnTimer in frame mode?

Of course, because of OnChartEvent-exception, it requires mandatory checking for the presence of the frame-mode flag. You do not have MQL_FRAME_MODE.


Interestingly, if you do a general CTRL+SHIFT+F search for the word "MQL_FRAME_MODE" in ME, it will be empty. Even in the official example there is no word about it.

Пример обработки результатов оптимизации в тестере стратегий
Пример обработки результатов оптимизации в тестере стратегий
  • votes: 44
  • 2012.06.11
  • MetaQuotes Software Corp.
  • www.mql5.com
Тестер торговых стратегий терминала MetaTrader 5 позволяет получить статистические характеристики торговой системы после окончания каждого прохода тестирования. С введением функций для работы с результатами оптимизации FrameFirst(), FrameFilter(), FrameNext(), FrameInputs() и FrameAdd(), трейдеры получили возможность проводить визуальную...
 
I ran both robots from the examples in optimisation mode. Nothing is rendered...
 
The article is certainly useful and demonstrates new visualisation possibilities, but I think the red and green charts are not informative. Yes, you can tell from them that the Expert Advisor was profitable or unprofitable, but you cannot determine when a particular trade was made. It would be more convenient if trades were overlaid on a time chart with candlesticks and it would be possible to see several results on one chart, when, depending on the values of the optimised parameters, the same trade was opened and closed. In general, I think there is still room for development of EasyAndFast library .
 
Инициализация графического ядра means that the mouse cursor movement will be tracked and the timer will be activated. Unfortunately, in the current version of MetaTrader 5 , the timer is not activated after optimisation is completed. Hopefully, this feature will appear in the future.

Is there no way to start the timer from OnChartEvent?


fxsaber:

What are the scenarios of OnTimer application in frame mode?

Interface.

 
Andrey Khatimlianskii:

You can't start the timer from OnChartEvent?

Yes, it will.

 
Dennis Kirichenko:
I ran both robots from the examples in optimisation mode. Nothing is rendered...

I need the latest version of the library.

 
fxsaber:

On this article, it is interesting to analyse the reason for the lack of comments on it.

...

It is not a problem for you to write your version and demonstrate how you see it, with everything that you personally lack or with what you think someone else lacks. I would be happy to read it.

 
Andrey Khatimlianskii:

Can't start the timer from OnChartEvent?

I haven't tried it. I would like to have the expected result, not "it works like this, but for some reason it doesn't".

 
Anatoli Kazharski:

It's no problem for you to write your own version and demonstrate how you see it, with everything you personally lack or what you think someone else lacks. I'd love to read it.

I've posted part of it in QB.