The function Oncalculate() can not be used in an expert. So we have to create our indicator separately from our expert and run both the expert and the indicator on the chart. I have a global variable in my indicator(that I wrote it in metaeditor) and I want to change the amount of this variable when a specific global variable in my expert is changed. Is it possible?

Documentation on MQL5: Language Basics / Functions / Event Handling Functions
- www.mql5.com
The MQL5 language provides processing of some predefined events . Functions for handling these events must be defined in a MQL5 program; function...
- Pause EA in Strategy Tester to wait for SQL Server
- Questions about MQL4
- Wishes for Meta Trader 4/5
Hello!
Use terminal global variables, with the functions such as GlobalVariableSet(), GlobalVariableGet() and so on.
- When calling a custom Indicator, from an Expert Advisor via the iCustom() function, one can pass it parameters to define how it should function.
- Global Terminal Variables can be created, accessed and modified from any and all MQL programmes running on the terminal, be they Indicators, Expert Advisors, Scripts or Services. Which means they can be used as a type of Interprocess Communication method.
- Just because the OnCalculate() event is not handled by Expert Advisors (EAs), does not mean you can't implement something equivalent in EAs, purely for calculations without graphical output.
- EAs don't have "eyes" and don't need visual feedback. One can easily carry out all calculations in the EA itself without depending on Indicators, if one so wishes to do that.

Documentation on MQL5: Global Variables of the Terminal
- www.mql5.com
There is a group set of functions for working with global variables. Global variables of the client terminal should not be mixed up with variables...
Fernando Carreiro #:
This is excellent. Thank you very much for this complete answer.
- When calling a custom Indicator, from an Expert Advisor via the iCustom() function, one can pass it parameters to define how it should function.
- Global Terminal Variables can be created, accessed and modified from any and all MQL programmes running on the terminal, be they Indicators, Expert Advisors, Scripts or Services. Which means they can be used as a type of Interprocess Communication method.
- Just because the OnCalculate() event is not handled by Expert Advisors (EAs), does not mean you can't implement something equivalent in EAs, purely for calculations without graphical output.
- EAs don't have "eyes" and don't need visual feedback. One can easily carry out all calculations in the EA itself without depending on Indicators, if one so wishes to do that.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register