Run script through Expert Advisor - page 6

 
RaptorUK:
Yep, I had that issue too . . never got to the bottom of it. It seemed temperamental.


So, what's the use?

I wanted smth reliable, not temperamental!

 
Dadas:


So, what's the use?

I wanted smth reliable, not temperamental!

Me too . . . but you have something to work with now . . . if you want it written for you . . . well you know where to ask.
 
RaptorUK:

....

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

Just wanna clear something, because Dadas example was using

int hWnd = WindowHandle(Symbol(),Period());

As long as we write the correct WindowsHandle. For example

int hWnd = WindowHandle(Symbol(),PERIOD_M2); // offline chart period 2 minutes
PostMessageA(hWnd,WM_COMMAND,33232,1);

Dropping this to any chart will send tick to an offline chart with period 2 minutes.


AFAIK, the fake tick won't make an EA start running. Try the best as you can but the EA won't loop.

RaptorUK 2012.08.14 17:22
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.

 
onewithzachy:

AFAIK, the fake tick won't make an EA start running. Try the best as you can but the EA won't loop.

Dadas:

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

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

 
RaptorUK:
Me too . . . but you have something to work with now . . . if you want it written for you . . . well you know where to ask.


But you did solve the issue?
 
Dadas:

But you did solve the issue?
Nope, for what I needed to do I used alternative code, but my application was ticking an offline chart, what I am using is not suitable for an online chart. You will need to research and experiment.
 

2 things

1. Can you give me the topic address rather that the download code ?

2. I forget something, I don't need fake tick - I really don't. I have loop in my EA and I call start() from init().

Try this as an EA, turn off network connection, drop it on offline or online and we don't have to enable expert button, and see what happen.

int init()
  {

  start();     //<<-- call start from init()
  return (0);
  }

int deinit() {return (0);}

int start ()
  {
  while (!IsStopped())
    {
    Alert (TimeSeconds(TimeLocal())," Yuhuuu ");
    
    Sleep (500);
    }
  return (0);
  }

Written on SRC not compiled, not tested, but I have EA like that.

And I forget my jumping jack

 
onewithzachy:

2 things

1. Can you give me the topic address rather that the download code ?

RaptorUK posted this =>look page 4

Have a read of this: https://www.mql5.com/en/forum/124688

 
Dadas:

RaptorUK posted this =>look page 4

Have a read of this: https://www.mql5.com/en/forum/124688

Well, yeah. That was my comment over there - lol at me - https://www.mql5.com/en/forum/124688

Still AFAIK, it won't makes EA start looping, but maybe I check into it later. I prefer call start from init - no need for fake tick and no need for online.

 
onewithzachy:

Well, yeah. That was my comment over there - lol at me - https://www.mql5.com/en/forum/124688

Still AFAIK, it won't makes EA start looping, but maybe I check into it later. I prefer call start from init - no need for fake tick and no need for online.


Well, I am trying.

Your simple example with the Alert works.

It also works with a simple comment line, like this:

int init()
  {

  start();     //<<-- call start from init()
return (0);
  }

int deinit() { return (0);
}

int start ()
  {
  while (!IsStopped())
    {

Comment("--------------------------------------------");
Sleep (3000);
Comment("++++++++++++++++++++++++++++++++++++++++++++");
Sleep (3000);
    
    
    }
  return (0);
  }

When I put my EA inside that loop, sorry, no juice - does not work.

When I first ran the TickAllCharts_1.mq4, I could see that it was working,

because my long set of comments was flashing on every loop,

and some indicator lines, too.

But, after some time it stopped, and did not want to start again.

Anyway, I will follow this path, and see what comes up.

Reason: