Backtest Profiling

To add comments, please log in or register
Henrique Vilela
1966
Henrique Vilela  

The Metaeditor provides this great profiling tool that helps to spot bottlenecks.

Unfortunately looks like it only can be used in real time and not in backtest.

I'm I right or I'm missing something?

Alexandr Saprykin
14475
Alexandr Saprykin  
Henrique Vilela:

The Metaeditor provides this great profiling tool that helps to spot bottlenecks.

Unfortunately looks like it only can be used in real time and not in backtest.

I'm I right or I'm missing something?

You can spend backtest in any part of the history of https://www.metatrader5.com/en/terminal/help/testing

Henrique Vilela
1966
Henrique Vilela  
Alexandr Saprykin:

You can spend backtest in any part of the history of https://www.metatrader5.com/en/terminal/help/testing

Yes, of course I can but what's your answer has to do with the profiling function?
Stanislav Korotky
24522
Stanislav Korotky  
Henrique Vilela:

The Metaeditor provides this great profiling tool that helps to spot bottlenecks.

Unfortunately looks like it only can be used in real time and not in backtest.

I'm I right or I'm missing something?

You're right. Neither profiling not debugging is available in the tester. These are major disadvantages of the platform.

I wrote a profiling library for myself. Of course it requires code modifications (for example, to insert two calls in the source to measure timing between corresponding lines). You can do it as well. I'm afraid this is the only possible resort at the moment.

Henrique Vilela
1966
Henrique Vilela  
Stanislav Korotky:

You're right. Neither profiling not debugging is available in the tester. These are major disadvantages of the platform.

I wrote a profiling library for myself. Of course it requires code modifications (for example, to insert two calls in the source to measure timing between corresponding lines). You can do it as well. I'm afraid this is the only possible resort at the moment.

Thank you so much for your answer.

Let me ask you: Your library is pure MQL5 or DLL based?

I'm asking cause I can't find a way to measure real time passed during the backtest using only MQL5 code, once all the time functions (TimeCurrent, TimeTradeServer, TimeLocal...) are all simulated (as expected) during the backtest / optimization process.

Henrique Vilela
1966
Henrique Vilela  

Ok, I've found GetTickCount that can be used for this propose. Also used the GetLocalTime from kernel32.dll but both has too high resolution (millisecond).

For profiling I would need something more precise. Any suggestion?

EDIT: Fount it: GetMicrosecondCount(); 

Stanislav Korotky
24522
Stanislav Korotky  
Henrique Vilela:

Ok, I've found GetTickCount that can be used for this propose. Also used the GetLocalTime from kernel32.dll but both has too high resolution (millisecond).

For profiling I would need something more precise. Any suggestion?

EDIT: Fount it: GetMicrosecondCount(); 

Yes you can use it (no dll needed). In fact, I used GetTickCount without a problem, because (to maybe a surprise of many people) real bottlenecks consume so much time, that they are marked distinctively even in millisecond resolution (especially when accumulated during the tester run). There was no need to hunt for microseconds.
Alain Verleyen
36033
Alain Verleyen  
Stanislav Korotky:

You're right. Neither profiling not debugging is available in the tester. These are major disadvantages of the platform.

I wrote a profiling library for myself. Of course it requires code modifications (for example, to insert two calls in the source to measure timing between corresponding lines). You can do it as well. I'm afraid this is the only possible resort at the moment.

Debugging is available with MT5 Strategy Tester.
Stanislav Korotky
24522
Stanislav Korotky  
Alain Verleyen:
Debugging is available with MT5 Strategy Tester.
Oh, yes, I forgot it has been finally added some time ago.
Alain Verleyen
36033
Alain Verleyen  

Just for information. Profiling is also available with the MT5 Strategy Tester now.

To add comments, please log in or register