Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1412

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
I got what I need
LoY[r] = 1.6104---LoY[r] = 1.6105---LoY[r] = 1.6106---LoY[ r] = 1.6107---LoY[r] = 1.6108---LoY[r] = 1.6109---LoY[r] = 1.6110---LoY[r] = 1.6111....
I will be very grateful if you could write an example of such a code instead of explaining it in words.
Thank you for your help.
This only happens to me during seizures......... One seizure has already happened to me today, the next one won't happen any time soon...
Thank you very much for your help. Your code is more compact and so I am taking it on board and proceeding to study it carefully to understand it in great detail.
I have studied your code carefully. Understood every single character. I don't understand only the + signs in red
str+="--LoY["+IntegerToString(r)+"]--,"+DoubleToString(LoY[r],4)+",";
I'd appreciate if you could tell me what function these pluses perform and where to read about them. I couldn't find information about them in Kovalev's tutorial.
When I removed these options the compiler gave me some errors. Unfortunately I'm no good at English, so I don't know what he meant by that.
Thanks again for the informational support.
I have studied your code carefully. Understood every single character. I don't understand only the + signs in red
str+="--LoY["+IntegerToString(r)+"]--,"+DoubleToString(LoY[r],4)+",";
I'd appreciate if you could tell me what function these pluses perform and where to read about them. I couldn't find information about them in Kovalev's textbook.
When I removed these options the compiler gave me some errors. Unfortunately I'm no good at English, so I don't know what he meant by that.
Thanks again for the informational support.
And here are explanations in words, please.........
If you add up numbers, for example 2.3+3.6, the same number, 5.9, and if you add up strings DoubleToString(2.3, 1)+ DoubleToString(3.6, 1), it will be 2.33.6 as a string.
That's right Alexey said, it's just stringing together.
This might be of interest to you:
But explanations in words are welcome.........
If you add up numbers, for example 2.3+3.6, it will be the same number, 5.9, and if you add up strings DoubleToString(2.3, 1)+ DoubleToString(3.6, 1) then it will be 2.33.6 as a string.
Thanks for the tip.
That's right Alexey said, it's just stringing together.
That might be of interest to you:
Thanks for the tip.
But here's an explanation in words, please.........
If you add up numbers, e.g. 2.3+3.6, it will be the same number, 5.9, and if you add up strings DoubleToString(2.3, 1)+ DoubleToString(3.6, 1), it will be 2.33.6 as a string.
That is, at each iteration the value of LoY["IntegerToString(r)"] is incremented by 1 and the value of DoubleToString(LoY[r],4) is incremented by 1.
But the increment by 1 is not arranged in the way I'm used to LoY["IntegerToString(r)"]++; But the increment by 1 is arranged speciallyLoY["+IntegerToString(r)+"], i.e. the variable is placed between pluses.
How should we handle increasing a string variable by 2 instead of 1? Normally this increment is VARIABLE +=2, but how should I format increment by 2 in my code?
Further, the values of my array elements will go differently from each other, and not in strict order like now. For example, it will be like this....
LoY[0]= 1.6104, LoY[1]= 1.6114,LoY[2]= 1.6100,LoY[3]= 1.6120, LoY[4]= 1.6115, LoY[5]= 1.6115, LoY[6]= 1.6098,LoY[7]= 1.6085, LoY[8]= 1.6125,..... and so on. In other words, these values will be assigned to array items in a different part of the code and not necessarily using a loop.
I don't think we can correctly display such a sequence in the Print() function using string variables connection......
Thanks for the help.
That is, at each iteration the value of LoY["IntegerToString(r)"] is incremented by 1 and the value of DoubleToString(LoY[r],4) is incremented by 1.
But the increment by 1 is not arranged in the way I'm used to LoY["IntegerToString(r)"]++; But the increment by 1 is arranged speciallyLoY["+IntegerToString(r)+"], i.e. the variable is placed between pluses.
How should we handle increasing a string variable by 2 instead of 1? Normally this increment is VARIABLE +=2, but how should I format increment by 2 in my code?
Further, the values of my array elements will go differently, not strictly as they are now. For example, it will be like this....
LoY[0]= 1.6104, LoY[1]= 1.6114,LoY[2]= 1.6100,LoY[3]= 1.6120, LoY[4]= 1.6115, LoY[5]= 1.6115, LoY[6]= 1.6098,LoY[7]= 1.6085, LoY[8]= 1.6125,..... and so on. In other words, these values will be assigned to array items in a different part of the code and not necessarily using a loop.
I don't think we can correctly display such a sequence in the Print() function using string variables connection......
Thank you for your help.
The IntegerToString() and DoubleToString() functions just represent a number as a string that is passed into the function. Here is an example
This is my forum for trading, automated trading systems and strategy testing.
Any questions from newbies on MQL4 and MQL5, help and discussion of algorithms and codes
Aleksei Stepanenko, 2021.03.12 16:39
This is exactly where the r number is converted to a string and the strings are "added". But before that the value of r changes.
I don't quite understand the question, but if you want to select only even-numbered elements from the array, the loop should be built like this