Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 513
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
how to do it properly?
How do you do it?
Simplified so, CopyOpen I understand is superfluous for OnCalculate, but so it only sees the history from the terminal window?
Simplified, CopyOpen is unnecessary for OnCalculate, but so it sees only the history from the terminal window?
Array mas is created with zero size on every tick and doesn't change its size anywhere else. So any access to it will cause array overrun.
To solve the problem, we should either resize it to the size, that will contain readings of all history bars, or bind it to the indicator buffer (declared as a global variable of the program). If I understand correctly, these values should be displayed using the indicator.
Simplified, CopyOpen I understand is superfluous for OnCalculate, but so it only sees the history from the terminal window?
Example:
The mas array is created with a zero size on every tick and does not change its size anywhere else. Therefore, any reference to it will cause exit from the array.
To solve the problem, you should either resize it to the size that will contain readings of all history bars, or bind it to the indicator buffer (declared as a global variable of the program). If I understand correctly, it is these values that must be displayed using the indicator.
My mistake, mas[] should really be a global array, but the indicator buffer is not suitable either, it will rather be an intermediate multidimensional array. What is the best way to determine the optimal array size for M5, not through indicator buffer?
My inaccuracy, mas[] is really a global array, but indicator buffer is not suitable either, rather it would be an intermediate multidimensional array. What's the best way to determine optimal array size for M5, not through indicator buffer?
I don't understand what I mean by multidimensional. We are speaking of a one-dimensional array. In addition, in MQL4 the maximum dimension of an array is 4.
To make the array the same size as the timeseries, we should resize it according to the number of bars available on the chart for the needed symbol and period:
My inaccuracy, mas[] is really a global array, but indicator buffer is not suitable either, rather it would be an intermediate multidimensional array. What's the best way to determine the optimal array size for M5, not through an indicator buffer?
Why don't you want to use arrays as indicator buffers? They are monitored by the subsystem, which makes your job easier.
And the intermediate indicator buffer array is easy to do:
Hello.
The volumes on the platform are tick volumes, will there be real volumes?
Hello.
On the platform the volumes are ticking, will there be any real volumes?
It won't. Use MT5, some brokers provide real volumes there.
Good afternoon!
Please help with the following problem:
1) After some conditions are met, a pending order opens:
Please tell me what to add and where to delete a pending order if price has already passed stop loss (of this pending order).
Sorry for the stupid question, I got lost in the forums while searching for an answer.
Thanks in advance!