Errors, bugs, questions - page 1492
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
And global (not external) is not, and that's not good.
Why is it not good? It is explicitly said that global variables are initialised once at program startup.
You want different behavior, initialize as you want in OnInit
It would be good to reflect this in the documentation.
In MQL4++ I can't do without extern when I need to change input parameters programmatically. For example, when converting a standard indicator into an interactive one I have to replace input with extern. The compiler treats input variables as const and complains at attempt to change them. With extern there will be no such problems.
Use "doublers" of input parameters
We have an example in MQL5\Indicators\Examples\ADX.mq5.
Use "doublers" for input parameters
We have an example in MQL5\Indicators\Examples\ADX.mq5
Now, to convert an indicator to the interactive version, you need to add only one line to the source code. If you make the doublers, in addition to the additional string for creation of the doubler, you must make replacement of the entire text. Why this hassle when you can simply change one line.
What prevents you from removing const-awareness of input variables at compile time?
To convert the indicator into an interactive variant you only need to add one line to the source. If you make a double, then in addition to the extra line to create a double, you will need to replace the entire text. Why this hassle when you can easily change one line.
What prevents you from removing const-awareness of input variables at compile time?
What prevents you from removing const-awareness of input variables at compile time?
Global storage of indicators in the MT5 history base. For them the input parameters are key. When you change the input parameters, the indicator with the old parameters is destroyed and the same indicator with modified parameters is created again.
That is, the restriction is purely architectural
In the fourth version we could remove the constancy from the instances, but then there is an incompatibility of the new MQL4 and MQL5. Therefore, we will not do it. Please continue using extern
Slawa:
That is, the limitation is purely architectural.
Window to detach from the terminal
how?