Menu item's event handling function?

 
Hi everyone!
I want my EA to be able to recognize when the AutoTrade menu button had been clicked. Any Event handling function for menu items similar to the OnChartEvent() function for chart events?

I am aware of the IsTradeAllowed() and TerminalInfoInteger(TERMINAL_TRADE_ALLOWED)

They only return state  and so not triger events.
 
macpee: Any Event handling function

You already know (or should) the answer: no.

 
William Roeder #:

You already know (or should) the answer: no.

Lols. But I just wished there was one.

 
macpee #:

Lols. But I just wished there was one.

The only thing you can do is check the state from time to time. So if the state changes you know that it has been clicked.

 
Samuel Manoel De Souza #:

The only thing you can do is check the state from time to time. So if the state changes you know that it has been clicked.

Okay. And I can do that from

void OnTick(void)

 
You shall use OnTimer
 
Samuel Manoel De Souza #:
You shall use OnTimer

I dont even have OnTimer in my over 4,800 lines of code. Little wonder I never thought of the strategy This will be perfect.

 
Samuel Manoel De Souza #:
You shall use OnTimer

Thanks Man. This is great. I have come up with a working code based on your reply:

int OnInit()
  {
   EventSetMillisecondTimer(1);
   return(INIT_SUCCEEDED);
  }

void OnTimer()
  {
   static ulong TicTime_1 = GetTickCount();
   ulong TicTime_2 = GetTickCount();
   if (TicTime_2 > TicTime_1)
     {
      AutoTradingStatus();
     }
   TicTime_1 = GetTickCount();
  }
  
void AutoTradingStatus()
  {
   "Bla bla bla...";
  }
 
No need for checking TickCount.

OnTimer() will be called on each millisecond.

 
Soewono Effendi #:
No need for checking TickCount.

OnTimer() will be called on each millisecond.

You are right. I just realized that only this works as well:

int OnInit()
  {
   EventSetMillisecondTimer(1);
   return(INIT_SUCCEEDED);
  }

void OnTimer()
  {
   AutoTradingStatus();
  }

void AutoTradingStatus()
  {
   "Bla bla bla...";
  }