Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 827
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
Hello.
Let's say I have 2 indicators, the first has 4 buffers, the second has 2. I put them on a chart and open data window (CTRL+D). The list contains 6 buffers from 0 to 5. How can I read the value of buffer 5, say, from this list in MQL? It is not convenient to use iCustom by the required indicator. It is more convenient to use this list. I know they do it, but how?
Studying the examples in the help, object creation is always done with a check:
Why is this done for objects? What is the probability of an object failing to be created?
In general, I am interested in where I can read about rules of good manners in mql programming, to know in which bushes lie the rake, advise.
Studying the examples in the help, object creation is always done with a check:
Why is this done for objects? What is the probability of an object failing to be created?
In general, I am interested in where I can read about good manners in mql programming, to know where the pitfalls lie, advise me.
For example, an object with this name already exists.
When I create a button inside a function, I get swearing at
'return' - 'void' function returns a value 112 16
What should I do in this case?
How to fill 4-dimensional array with values of the format int Mas[1][2][2][2], how to assign a value to each cell of the array, in this case, there is a 2-dimensional array int Arr[1][2]={3,4}; how to fill 4-dimensional?
Multidimensional arrays are usually filled in loops with the right values - that makes it harder to make a mistake, for a four-dimensional array it should be something like this, but I could be wrong:
When I create a button inside a function, I get swearing at
The 'return' - 'void' function returns a value 112 16
What should I do in this case?
start reading the helpat https://www.mql5.com/ru/docs/basis/function
If you need more help, you should read any C++ book. The first chapter should explain the functions
When I create a button inside a function, I get a swearing at
'return' - 'void' function returns a value breakeven_fish.mq5 112 16
What to do in this case?
Comrades - look at the indicator for correctness. There is one formula Value = (Open[0]-SMA(P,n))/SMA(P,n))*100%.
I put it on the chart - it calculates and plots everything. I start checking on some bar on the calculator - its value does not coincide with the one drawn...
Here is an example - I calculate 1,0178 for Open and 1,0182 for MA(13) using the formula ((1,0178-1,0182)/1,0182) * 100% - the result on the calculator is -0.0393. And the MT4 chart shows -0.0929. Is it an error in the code or the calculator does not correctly calculate some values there? Please help. I am attaching the indicator.
If you are doing return of bool-type value from function, then function type should not be void, but guess which one it is.
What if you want to return data from a function?
Is it possible to loop through the positions only for a given symbol without using PositionsTotal every time?
So far, the only thing I've come up with is to write the tickets into an array and work with them separately, but maybe there's a simpler option?
What if you want to return data from a function?
Is it possible to loop through the positions only for a given symbol without using PositionsTotal every time?
So far, the only thing I've come up with is to write the tickets to an array and work with them separately, but maybe there's a simpler option?
It's not clear what's needed in the end - some disjointed thoughts.