Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 862
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
Speaking of cubes!
Can you tell me how to erase an unnecessary "cube"?
Speaking of cubes!
Can you please tell me how to erase an unnecessary "cube"?
To do this, you need to know in which position this "cube" is, how many bytes it occupies, rewrite a file pointer there and write a new value in that place.
Consequently, if strings have different lengths, it is simply not realistic. It will not be possible to calculate how many bytes to the required "cube".
To do this, you need to know in which position this "cube" is and how many bytes it occupies, then wrap the file pointer there and write the new value in that place.
Consequently, if strings have different lengths, we just can't do it. It will be impossible to calculate how many bytes to the right "cube".
Obviously, all these calculations will increase the processing time.
I will look for other methods.
Thank you.
To do this, you need to know in which position this "cube" is and how many bytes it occupies, rewrite a file pointer there and write a new value in this place.
Consequently, if strings have different lengths, it simply cannot be done. It will be impossible to calculate how many bytes to the desired "cube".
If it is not crucial and you can use WinApi, then I think the task can be solved via FileMapping.
I will try everything. I will start by creating an "empty" file, with abstract variables for the reserve. Then I'll replace it with the data I get.
Maybe it'll work. The only problem is the size of the file. It might get bigger. I will have to create a new backup before each read.
Looking for articles on the use ofnew operator in mql4, advise such articles? I have seen many video clips and read the help file many times, but I don't understand what's the point?
the new operator in MQL is only needed to create a pointer to an object instance
MQL programs are quite specialized and OOP is mainly suitable for encapsulation, I gave an example ofCWorkTime class abovehttps://www.mql5.com/ru/forum/160683/page861#comment_11840254
it's convenient to use encapsulation to make several instances of time-limit object, like this:
i.e., in my example, you can now specify 2 intervals of EA's working time
SZY: read - search forum articles section "Objects".
It's clear that to a greater extent classes compose data variables and functions, and to the remaining extent probably do something powerful if I understand correctly, because everything can be organized by functions, maybe classes work faster than functions, you get faster access to data, I read forums writing that they use memory more evenly and economically and all that.
Why doesn't this code work?
Maybe the class should be described with a colon ::? The idea is to create a pointer that points to another pointer.
Hello!
Thanks again toAlexey Viktorov for the tip on the quotes - everything works. This Monday we have a situation - Germans have traded, while Englishmen have a day off. It turned out that in condition for euro position opening old values of pound were used. Hence the request: advise how to set check in the code that both symbols are traded on this day?
Thank you.