[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 192

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
NewBar() is called; but if you look long enough, you won't make things worse for yourself :)
newbar https://book.mql4.com/ru/variables/arrays
Conceptually, it's no different.
newbar https://book.mql4.com/ru/variables/arrays
Conceptually, it's no different.
Not conceptually, but it won't work - sorry about that.
I wouldn't play around with a variable of the double type here! You need more memory! ;)))
And when conversion of int type to target type double occurs, I understand, there will be no extra digits after decimal point? I personally have not come across such cases. But it's worth asking.
Conceptually - nothing, but it won't work, sorry.
The one you quoted will miss some of the bars.
The one you quoted will miss some of the bars.
Suggest your own variant and explain why it is better. So far it's just words.
1. Missing part of the bars will be, because the result of comparison double==int depends on the particular int value that was previously placed in double. This is exactly what happens here: time (int) is written in double - for all numbers that are not degrees of two there is a loss of precision, which results in double3 != int3, although double4 == int4.
2. I understand that this is just someone's technical mistake, then repeatedly propagated. Actually you should just correct the OpenBar type to datetime or int. But - slumber of the mind spawns monsters: it's easier just to repeat someone else's code and close your eyes :)
3. Incorrect solution in terms of memory allocation: a local variable static is enough here, extra global variable is useless - software rubbish, although it's a trifle :(
1. Missing part of the bars will be, because the result of comparison double==int depends on the particular int value that was previously placed in double. This is exactly what happens here: time (int) is written in double - for all numbers that are not degrees of two there is a loss of precision, which results in double3 != int3, although double4 == int4.
2. I understand that this is just someone's technical mistake, then repeatedly propagated. Actually you just should fix the OpenBar type on double. But sleep of reason breeds beasts: it's easier just to repeat somebody else's code and close your eyes :)
3. Incorrect solution in terms of memory allocation: a local variable static is enough here, extra global variable is useless - program rubbish, although it is a trifle :(
There is still some code to be cited. I'm just tired of repeating the same thing five pages later. Especially since the right solution is easy to find through a search
Good day everyone!
Question about EAs. Looking through a lot of EAs, I want to understand how trades are automatically made. I think I have set everything correctly, I allow the EA to trade, I understand the idea, but there are no trades for some reason. Perhaps, it is applied to a certain symbol? Or a timeframe? How can I find out?