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
When I call my function, should I pass the array by reference, via pointer or something else?
Read the section about passing parameters by value and by reference:
MQL5 Reference / Language Basics / Functions / Passing Parameters
Read the section in the Reference Manual about passing parameters by value and by reference:
MQL5 Reference / Language Basics / Functions / Passing Parameters
Actually, I've just come from there and the compilation errors I mentioned in my previous message have happened after reading the above section.
Now I've reread it carefully - it's all about const and where to put it.
Thanks, I've figured it out.
InOnCalculate I can easily use array elements like high by index. Is it also possible to access the index elements of this array in ExtFunc? When calling my function, should I pass the array-argument by reference, via pointer or something else? So far I've managed to minimize the error messages to: "'high' - parameter conversion is not allowed" and "'high' - constant variable cannot be passed as reference" regarding the same line of my function call with the array argument from OnCalculate. Is it hopeless or is there a solution?
So far in OnCalculate I have resorted to copying high to another array:
and then use CopyOfHigh in ExtFunc instead of using high-array directly.Just pass the array to your function by reference
Greetings all!
What does the warning mean:
possible loss of data due to type conversion expert.mq5
when compiling it? It says this:
What's wrong?
Simply pass the array to your function by reference
Not exactly:
Greetings all!
What does the warning mean:
possible loss of data due to type conversion expert.mq5
when compiling? It says this:
What's wrong?
What the warning means:
possible loss of data due to type conversion
The meaning of this message varies, depending on the context in which it is being considered.
For example:
1. "Make an explicit type conversion!"
2. "Possible data twitching with implicit type conversion." // This is a literal translation.
This is understandable, since the long type returned by the function has a larger size and covers a wider range of values.
Another option that comes to my mind most often lately:
3. "MetaQuotes staff doesn't understand how cool, attractive, and effective it would be to learn if error messages and mql5 compiler warnings were given in the user's native language."
... how cool, attractive, and effective it would be to learn if mql5 compiler error messages and warnings were given in the user's native language."
I have a suspicion that if the indicator is activated through iCustom, it is calculated on every tick. And it doesn't depend on the calls to it through the CopyBuffer. Is it correct?
If it is correct, then is it possible to disable the calculation of indicator and enable it only before calling the CopyBuffer?
I have a suspicion that if the indicator is activated through iCustom, it is calculated on every tick. And it doesn't depend on the calls to it through the CopyBuffer. Is it correct?
It depends on the logic of the custom indicator. Actually, it can re-calculate its values once a day, skipping all the other ticks. So to say, according to the author's will.
If so, is it possible to disable the recalculation of indicator and enable it only before calling the CopyBuffer?
Basically, some people try to use this monster approach: create a copy of the indicator via iCustom, copy the required data, delete the copy of the indicator. The procedure is repeated as needed.
There is also OnTimer() function, I haven't worked with it myself, but maybe you can adapt it to your task.