You are asking a question and answering it.
How to use EventChartCustom() ? read the documentation and write it in your code.
Under certain conditions I want it to make a call to the GBPUSD-EA, so code inside the GBPUSD-EA can be executed before a new tick for GBPUSD happens.
Is this possible using EventChartCustom() function? How can I do this?
Yes.
Come up with an id for your chart event. Both EA's will need to know this.
e.g.
In the EURUSD EA, send your custom chart event when your conditions are met.
You will need to know the ChartID of the GBPUSD chart, else broadcast the event to every chart in the terminal.
e.g.
In the GBPUSD EA, have a section in the OnChartEvent to react to the chart event.
e.g.
That's it!
Edit : Alain beat me to it
Yes.
...Edit : Alain beat me to it
By the way, is there also a way to call an MT4 EA from an external program?
For example, if something happens inside an external program, the code inside the MT4 EA should be executed immediately.
By the way, is there also a way to call an MT4 EA from an external program?
For example, if something happens inside an external program, the code inside the MT4 EA should be executed immediately.
You may trigger a tick event on the specific chart from the external program. The program needs to know the chart window handle to send the message to, so you need to pass the handle to the application first.
Thanks a lot!
Unfortunately I have no idea how to do that.
But in any case - you will have to run them on the same computer which limits the whole thing a lot
Thanks, but not a real "soltution" because code inside EventSetMillisecondTimer(1) is only executed about every 15.6ms, so I think it has to be without the use of MT4 timer.
You are using mql for start - not low level parallel computing on Cray® XC50™. If you are trying to HFT then you shall have to migrate to something completely different (starting from replacing your computer with a COMPUTER and the place you work for an office that is 100 feet from your broker and, in the end, replacing the platform and coding environment used ...). Otherwise, the difference means completely nothing in real time mt usage and trading
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Let's say in the same MT4 terminal there is one EA running on a EURUSD chart and one EA running on a GBPUSD chart.
If there is a new tick for EURUSD, the code inside of the OnTick() function of the EURUSD EA will be executed.
Under certain conditions I want it to make a call to the GBPUSD-EA, so code inside the GBPUSD-EA can be executed before a new tick for GBPUSD happens.
Is this possible using EventChartCustom() function? How can I do this?
By the way, I do not want a simple EventSetMillisecondTimer() "solution" because even if the timer is set to 1ms, code would only be executed every 15ms using EventSetMillisecondTimer(1).
Many thanks in advance!