Goodmorning everyone. I have been a programmer for many years, but quite new to MQL5. I would like to clarify a doubt.
When I create an EA, the onTick() function (as well as for onCalculate() in indicators) is called when it receives a tick. But is this tick relative only to the symbol where the EA is placed, or is it also called when MT5 receives a tick from other symbols in the market watch ?
... and if it receives only from the symbol of the chart in which the EA is placed, how can I do to create an EA independent of the symbol of the chart to create a multi symbol EA that reacts to the arrival of multiple symbols (without obviously having to insert the EA on various charts with different symbols).
Thank you :)
The tick is for the current chart symbol only. I recommend: Do not trade multiple currencies in one EA.
-
You can't use any {MT4: predefined variables, MT5: predefined variables,}
-
Must poll (not OnTick, unless you use specific indicators)
The Implementation of a Multi-currency Mode in MetaTrader 5 - MQL5 Articles (2011) -
and usually other problems, e.g. A problem with iBarShift - MQL4 programming forum - Page 2
-
You must handle History {MT4:4066/4073 errors: Download history in MQL4 EA - MQL4 programming forum, MT5: Timeseries and Indicators Access / Data Access - Reference on algorithmic/automated trading language for MetaTrader 5.}
-
Code it to trade the chart pair only. Look at the others if you must. Don't assume that Time[i] == iTime(otherPair, TF, i) always use iBarShift.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Goodmorning everyone. I have been a programmer for many years, but quite new to MQL5. I would like to clarify a doubt.
When I create an EA, the onTick() function (as well as for onCalculate() in indicators) is called when it receives a tick. But is this tick relative only to the symbol where the EA is placed, or is it also called when MT5 receives a tick from other symbols in the market watch ?
... and if it receives only from the symbol of the chart in which the EA is placed, how can I do to create an EA independent of the symbol of the chart to create a multi symbol EA that reacts to the arrival of multiple symbols (without obviously having to insert the EA on various charts with different symbols).
Thank you :)