code to autorefresh

 

HI

any one can write a code to autorefresh the indicator or EA ?.............. with the ability to change the autorefresh times per minute or second

thanks

 

Not sure what you mean. But MQL works on ticks not time, so it constantly calculates on each tick rather than each second.

If there are ticks coming in then your indcator/EA will refresh.

 
#include <WinUser32.mqh>

#define  CHART_CMD_UPDATE_DATA            33324

extern int RefreshMilliseconds = 10000;
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
        
int start()
  {
   while(!IsStopped()){
      int hwnd = 0;
      hwnd = WindowHandle(Symbol(), Period());                
      int result = PostMessageA(hwnd, WM_COMMAND, CHART_CMD_UPDATE_DATA, 1);
      if (result == 0) {
         Print("PostMessage failed");
      } 
      Sleep(RefreshMilliseconds);
   }       
   return(0);
}
 

thanks for u phy

i will tray this code