EA on offline chart, Can Start function be triggered on offline charts ?

 

Guys,

I've spent days reading posts about running an expert on an offline chart, fake ticks and all that trying to find out if it is or not possible at this stage to get the start function of an expert on offline chart triggered.

I couldn't get a straight answer anywhere. The documentation doesn't say much about the process of how the terminal uses the new tick to trigger a call to start function but it does say here that :

The necessity to wait for a tick is the start() function's own property, and there is no way of a program influence upon this property

I'm asking anyone who understands how the tick works to please explain it to us or alternatively if anyone knows how to get a straight answer from MQL in this regard, please enlighten us.

I guess that the least we can ask for is to know if it can or cannot be done.

Thanks to anyone willing to help.

 

The usual trick is to fake the ticks. Ticker for example.


It is an ea, once initialized with tick from server, you can safely go offline. Well, that is the theory in practice.

 
deysmacro:

The usual trick is to fake the ticks. Ticker for example.


It is an ea, once initialized with tick from server, you can safely go offline. Well, that is the theory in practice.


Thanks for reply.

I have EA and script that sends "ticks" and they're working but the EA on the offline chart does not get started.

EA is working, tested on online charts OK, back tested on offline charts OK, even when placed it in a loop and called the start from OnInit(), it starts, places orders and all.

Apparently, the OnInit() function should terminate within 2.5 sec and calling the start from OnInit() isn't recommended, not sure why ?

So, the script or the EA to tick the offline EA will do anything but start the EA on offline chart.

Plus, no one has reported to successfully get an EA started on an offline chart with any script (or EA).

Something is missing . I thought that the OnTick() function may be disabled for offline charts but when tested the while loop and calling the start from Init, it does work !

Any other suggestions?

 
thrdel:


Plus, no one has reported to successfully get an EA started on an offline chart with any script (or EA).


i didn't report to anyone but managed to trade successfully using an EA on offline chart

 
thrdel:


Plus, no one has reported to successfully get an EA started on an offline chart with any script (or EA).


It is a trade secret, or too embarrassed to say it is not working.
 
qjol:


i didn't report to anyone but managed to trade successfully using offline chart with an EA


I do believe you did that, other people claim to trade successfully " using " star charts and tarot readings.

The question was about getting an EA started on an offline chart . As I mentioned, I can start mine with a call from OnInit() function with the OnTick() in a while loop.

That seems to be an unorthodox way according to some.

The other, more logical approach is mentioned by WHRoeder, RaptorUK,and others, to calculate internal all bars, indicators and all, then trade on online charts.

Are you saying that you know the way to get the terminal to call the OnInit() function of an EA on offline chart or just that trade based on ideas tested on offline charts ?

 
deysmacro:

It is a trade secret, or too embarrassed to say it is not working.


It's amazing how many years people can discuss this issue without getting anywhere.

I doubt the part about the trade secret, but have to agree with the rest.

Would be nice to know if it can't be done, why not ?

I mean something triggers the start of any indicator I put on the offline chart. Is that the magic tick ?

And if it is, why not the expert's start function ?

I fail to grasp the logic there. How does the terminal change the tick for indicators and gives a different tick to expert ?

Why are we here ?

What's the meaning of life........

 

the idea is very simple
i trigger a tick every time the chart gets updated

i.e. i added the code to fake a tick to the periodconverter

   if(hwnd!=0)
     {
      PostMessageW(hwnd,WM_COMMAND,33324,0); // update the chart
      int msg = RegisterWindowMessageW("MetaTrader4_Internal_Message");
      PostMessageW(hwnd, msg, 2, 1); //fake a tick
     }


i don't need to calculate bars or call anything from OnInit() or whatever

just acting like any online chart simple as that

 
qjol:
the idea is very simple
i trigger a tick every time the chart get updated

i.e. i added the code to fake a tick to the periodconverter


So you're suggesting to run the script on the same offline chart with the EA ?

 

first: i think you didn't understand

what i do:

open an online chart --- > put on this chart an indicator called periodconverter (with the added code) ----> open the generated offline chart putting any EA on it ---> finish

second: i'm not suggesting anything just telling you what i did

you can do whatever suits you or seems to you

 
qjol:

i'm not suggesting anything just telling you what i did

you can do whatever suits you or seems to you


I need to have a look at the difference between PostMessageW and PostMessageA. All other posts I've seen suggest PostMessageA and say nothing about PostMessageW(hwnd,WM_COMMAND,33324,0);

I'll try than and see if I can get it to work.

Thanks

Reason: