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
So make a factory. That would solve the problem.
It's easy enough to work in there as it is. The object is quite rigidly structured. It calls a virtual Load method of each of its members, they in turn do the same. At the beginning of each data block (object) the ID of type is written (for control when loading). That's all there is to it. It is a kind of a self-made factory.
It makes sense to make a factory if previously unknown type can be in the file. Then the factory and type register table will be needed. While the problem was not so solved, I have managed with paper clips and adhesive tape. :)
Gunn's fan.
If the second anchor point is in the future, the angle changes.
Also, this object has some problems with copying (with Ctrl pressed). Very often it doesn't copy, but drags the original, and it takes the third or fifth tries to copy.
OK, great.
Slava, can I ask (for general development) why you can't initialize virtual method table at the beginning of constructor (after ancestor initialization)?
I've told you before. Constructors work out the hierarchy. While an ancestor is being built, there is no information about descendants.
I've already read it. And I understood it very well. And I asked a question based on my understanding of what I've read. I'll try to make it clearer, with pictures.
I understand everything, it is more difficult to do, there are all sorts of subtleties. It's much easier and versatile (for you) to write all the implicit initialization at the end. And I even believe beforehand that "no one does that" and that "it's not customary in C++" etc.
But for us ( users ), it is simpler, more universal, reasonable and logical to consider MySecond() constructor as a territory of MySecond class and not MyFirst. Think about what's easier: making virtual functions work in constructors or expressing important and serious restrictions on constructor code in documentation in several places, and, despite that, regularly receiving important and serious messages from newbies to Service Desk and the Forum "about the virtual bugs in constructors". This is also a serious factor - newbies are expected a lot soon...
The tensor operator with structures leads to Code Generation Error (although if you replace it with if, it works)
I get error 4401 regularly
ERR_HISTORY_NOT_FOUND
The following indicator code
will produce an error immediately on startup (if not on D1). Or rather, once after the start of the terminal and opening of the chart - to put the indicator on, we will get an error. If the terminal is not closed, then there will not be such an error at start.
But after some time (a couple of hours - 2 hours were enough for me) we will see that we will get the error on the already open chart. (I ran it on m30)
Hello, gentlemen developers!
Can we make changes in the MQL5 compiler to at least give us a warning?
for errors of this kind in the code.
if(Flag_Exitl=true) {break;}
The comparison condition here is not correct (it should be == ), that's why it will always be break.
How to address this situation in the compiler (if it's possible at all), so that I could get less bumpy when writing code?
(I thought it won't work, it seems to separate assignment and comparison in if, then the question is removed).
Hello, gentlemen developers!
Is it possible to change the MQL5 compiler to at least give a warning?
for errors of this kind in the code.
if(Flag_Exitl=true) {break;}
The comparison condition is not correct (it should be == ), that's why it will always be break.
How to address this situation in the compiler (if at all possible), so that I could get less bumpy when writing code?
(I've thought it won't work, I may split assignment and comparison in if, so the question is removed).
The condition may be written incorrectly but it is allowed in MQL5.
I will translate what you have coded: Flag_Exitl variable must be set to true and then checked if Flag_Exitl is true, then break.
The sequence of actions is exactly like this.
I don't quite understand how to work with buffers that don't need to be shown on the screen.
According to the code below for some reason
1) does not draw anything
2) both buffers are called Label1
although they contain the right data
Hello. I may be writing in the wrong direction, but I hope you can point me in the right direction. Where to go with a question on Web API for mt5? )
I will try to explain the situation just in case. I have МТ manager and WEB API with php... Invoice in russian is created, data is sent and even is displayed in МТ manager, but there is a problem - data in МТ manager is displayed in unicode ("044404300c0438043b0438044f" - that's how user name looks like). When sending data nothing is encoded or decoded, from MT client everything is created normally... At least which way to look? (