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.
- Drag and drop SL and TP in the tester.
- OnChartEvent in Strategy Tester
- MT5 strategy tester - not friendly for manual testing
You shall use OnTimer
Samuel Manoel De Souza #:
You shall use OnTimer
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..."; }
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..."; }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register