call start() function manuell by receiving new courses in another currency? - page 2

 

Hello phy, you are very good in MQL4 programming!

How can I send a update message to a indicator script, I dont do something else before :-) ?

 

The "Period Converter Optimized" has "update" code in it.

The update is aimed at the window, not the indicator.

 

The function from the Indicator "Period conventer Optimized" that update is this:

int UpdateChartWindow()
{
   static int hwnd = 0;
 
   if (FileHandle < 0) {
      //no HST file opened, no need updating.
      return (-1);
   }
   if(hwnd == 0) {
      //trying to detect the chart window for updating
      hwnd = WindowHandle(Symbol(), NewPeriod);
   }
   if(hwnd!= 0) {
      if (IsDllsAllowed() == false) {
         //DLL calls must be allowed
         DebugMsg("Dll calls must be allowed");
         return (-1);
      }
      if (PostMessageA(hwnd,WM_COMMAND,CHART_CMD_UPDATE_DATA,0) == 0) {
         //PostMessage failed, chart window closed
         hwnd = 0;
      } else {
         //PostMessage succeed
         return (0);
      }
   }
   //window not found or PostMessage failed
   return (-1);
}
That looks like the return(-1) statement does a update, maybe I must trie and put a normal Script with a while() loop and the Sleep() statement and in it a update statement return(-1), but then the Script will be finished or not, how woud you do it?
 

Its the function PostMessageA(hwnd,WM_COMMAND,CHART_CMD_UPDATE_DATA,0)

that makes the update not retun(-1).