Is there any way for the EA to know what type of modeling is being performed in the test?

 

I have an EA what uses OnTimer and I want run tests more optimized. To do it, I though about use the OnTimer only in "Each Tick"  modes and disable the timer to use OnTick to call OnTimer in OHLC and only open candle modes. I was unable to find a constant to show me this information. 


Is there any way for the EA to know what type of modeling is being performed in the test?

 
Documentation on MQL5: Event Handling / OnTimer
Documentation on MQL5: Event Handling / OnTimer
  • www.mql5.com
OnTimer - Event Handling - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Rafael Caetano Pinto:

I have an EA what uses OnTimer and I want run tests more optimized. To do it, I though about use the OnTimer only in "Each Tick"  modes and disable the timer to use OnTick to call OnTimer in OHLC and only open candle modes. I was unable to find a constant to show me this information. 


Is there any way for the EA to know what type of modeling is being performed in the test?

Not with mql function. You need to use WinAPI call, check the Codebase, someone already did it.
 
Alain Verleyen:
Not with mql function. You need to use WinAPI call, check the Codebase, someone already did it.

Thanks Alain.

But I avoid to add dll's and low-level dependencies because of the complexity to manage de EA (install in other environments, etc). I'll set the modeling mode as a EA input that will exists only when I compile with a specific #define to control a #ifdef block.

C'est la vie

Reason: