Backtest Profiling

 

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?

 
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/algotrading/testing

 
Alexandr Saprykin:

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

Yes, of course I can but what's your answer has to do with the profiling function?
 
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.

 
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.

 

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(); 

 
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.
 
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.
 
Alain Verleyen:
Debugging is available with MT5 Strategy Tester.
Oh, yes, I forgot it has been finally added some time ago.
 

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

Reason: