- MetaTrader 5 for your employees
- MetaTrader 5 for Forex, stocks and futures
- Instant notifications and alerts in MetaTrader 5
I have an indicator that uses an onTick () event for one currency pair. I am trying to use that indicator on one currency pair that use on onTick event to trigger a trade for another currency pair. Does the onTick event work in an EA attached to a different currency pair?
Hi Boost,
OnTick() event executed on incoming tick on chart regardless of the symbol name. If you have indicator hard coded to work with - say EURUSD - instead Symbol(), that indicator will still works on non-EURUSD chart - say AUDJPY chart. Same thing on EA. Problem is there's probably a new incoming tick for EURUSD but your CI/EA won't get that EURUSD tick until next AUDJPY tick coming.
Why don't you try it, EA/CI to print EURUSD close and attach it on AUDJPY.
:D
Thanks for your information. Is there any way to have a CI executed by an onTick event for say EUR/USD. And then using that CI attached to the EUR/USD chart to trigger trades on a EA attached to the USD/JPY chart.
What I am trying to do is create a counter for incoming tick on the EUR/USD that is coded in an CI. For every incoming tick, it adds one to the counter. For example my EA would attached to the USD/JPY Chart and for every 100th tick on the counter for the EUR/USD would be triggered to buy or sell based on the onTick event for that count.
Any ideas?
Thanks for your information. Is there any way to have a CI executed by an onTick event for say EUR/USD. And then using that CI attached to the EUR/USD chart to trigger trades on a EA attached to the USD/JPY chart.
What I am trying to do is create a counter for incoming tick on the EUR/USD that is coded in an CI. For every incoming tick, it adds one to the counter. For example my EA would attached to the USD/JPY Chart and for every 100th tick on the counter for the EUR/USD would be triggered to buy or sell based on the onTick event for that count.
Any ideas?
Hi Boost,
That EURUSD CI writes tick counter to either file (click here) or MT Global Variable (click here), and EA read from it. I prefer MT Global Variable coz it's simple, however if I have to write tick counter from lot of pairs, I think I prefer file.
:D
Hi Boost,
That EURUSD CI writes tick counter to either file (click here) or MT Global Variable (click here), and EA read from it. I prefer MT Global Variable coz it's simple, however if I have to write tick counter from lot of pairs, I think I prefer file.
:D
Thanks. I think that will work. Thanks again for your time and input.
You also can use EventChartCustom function to send events to EA which is placed on the same or on another chart window.
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use