Run script through Expert Advisor - page 5

 
RaptorUK:

Use a script running in an infinite loop to "tick" the chart that your EA is on . . . every 100 ms, every 50 ms . . . whatever your PC can handle, just make sure when you tick it that it isn't requesting data on each tick or your Broker will get a little annoyed with you.

The script doesn't even have to be on the same chart . . .


So, I put this
   int hWnd = WindowHandle(Symbol(),Period());
   PostMessageA(hWnd,WM_COMMAND,33232,1);
in the scripts loop?
 
Dadas:

So, I put this in the scripts loop?

What happened when you tried it ? don't forget the sleep to govern the refresh rate . . .
 
RaptorUK:

What happened when you tried it ? don't forget the sleep to govern the refresh rate . . .


Yeah, I got Sleep(1000); for the moment. The script is working, cause I tested with a messagebox.

But, I do not see any changes when I enable Experts, still the EA is looping only on broker's ticks.

 
Dadas:


Yeah, I got Sleep(1000); for the moment. The script is working, cause I tested with a messagebox.

But, I do not see any changes when I enable Experts, still the EA is looping only on broker's ticks.

Disconnect from your Broker and see if the EA runs, if it does then you are ticking it, if not you have done something wrong.
 
RaptorUK:
Disconnect from your Broker and see if the EA runs, if it does then you are ticking it, if not you have done something wrong.


Well, I made it an indicator.

And I got the hourglass. Had to close MT4.

 
RaptorUK:
Disconnect from your Broker and see if the EA runs, if it does then you are ticking it, if not you have done something wrong.


Nope, not running offline.

This is my script

#include <WinUser32.mqh>
#define MT4_WMCMD_33232    33232 // icons-tick
#define MT4_WMCMD_MOUSE_CURSOR    33234

int start()
  {
//----
  while (1==1) 
   {
   int hWnd = WindowHandle(Symbol(),Period());
   PostMessageA(hWnd,WM_COMMAND,33234,1);

    
    Sleep (1000); 
    }
  // return(0);
  }
 

Ok, I found this, and this ticks the chart.

https://c.mql5.com/mql4/forum/2012/05/TickingAllCharts_1.mq4

 
Dadas:

Ok, I found this, and this ticks the chart.

https://c.mql5.com/mql4/forum/2012/05/TickingAllCharts_1.mq4


Yes of course . . . that was in the link I gave you . . . you are supposed to read the whole thread.
 
Dadas:

Ok, I found this, and this ticks the chart.

https://c.mql5.com/mql4/forum/2012/05/TickingAllCharts_1.mq4


I do not know WTF is wrong, for a moment it was ticking, then it stopped, and it does not want to start again???
 
Dadas:

I do not know WTF is wrong, for a moment it was ticking, then it stopped, and it does not want to start again???
Yep, I had that issue too . . never got to the bottom of it. It seemed temperamental.
Reason: