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
The compiler errors when I put the path to the icon in the terminal_data_directory, the error says cannot open file in a virtual store folder even though I did not specify a folder in the virtual store. I specify a folder in the terminal_data_directory.
The only way I could get it to work was to put the file in the same folder as the source code and not specify a path at all, just #property icon "MyIcon.ico"
Hi just in case anyone has problem with #property icon "\\Images\\MyIcon.ico", you should consider the size of the icon 96x96 px or higher. I have experienced the error also, but now works.
I noticed that compiler performs casting that I would not expect to occur.
I have following code:
where the class of the key object is MT4String, while the function getKey() returns more generic class. The same case is with the button object. Explicit casting is omitted.
Original code looked like this:
In JAVA, there would be explicit casting necessary, but the MQL4 compiler works with this syntax properly as well.
Is this implicit casting a feature, that is also valid in C++? Or is it a bug?
I'm not a C++ expert but going from a base class to a child class is called downcasting and according to this page it looks like downcasting must be explicit in C++ too. (like Java) ?
As MQL4 allows implicit downcasting it's either a "feature" or a bug :)
If its a "feature" it probably means that the compiler will fail to warn the coder of a potential error, so its not a great feature. Both C++ and Java require explicit downcasting for a reason?
Furthermore, in MQL4, there is no built in way to check the class of an object (eg instanceOf etc) so it means a run time error can't be avoided unless you implement your own 'type' check...
I'm not a C++ expert but going from a base class to a child class is called downcasting and according to this page it looks like downcasting must be explicit in C++ too. (like Java) ?
As MQL4 allows implicit downcasting it's either a "feature" or a bug :)
If its a "feature" it probably means that the compiler will fail to warn the coder of a potential error, so its not a great feature. Both C++ and Java require explicit downcasting for a reason?
Furthermore, in MQL4, there is no built in way to check the class of an object (eg instanceOf etc) so it means a run time error can't be avoided unless you implement your own 'type' check...
Yes, I would appreciate instanceof or ".class" too, but as far as I noticed it is not available even in the C++. Even the MQL4 debugger does not know the type of the watched object. I do not care much, because the OOP feature in MQL4 is implemented surprisingly very well, and if this was the only bug, then I would say hurray. I just was curious, if it was following some existing pattern, but it seems it was rather a bug.
in old MT4 i use a dll file for creating EA one click trading
i can type the parameter.. LOT, TP SL directly on those white text box
when i click buy or sell.. my EA read the input text in the box.
in new MT4 i see button function.. but i can't find the function to create an read a text box like that
in old MT4 i use a dll file for creating EA one click trading
i can type the parameter.. LOT, TP SL directly on those white text box
when i click buy or sell.. my EA read the input text in the box.
in new MT4 i see button function.. but i can't find the function to create an read a text box like that
For the keyboard input there is the object type OBJ_EDIT. It fires CHARTEVENT_OBJECT_ENDEDIT event if you press the Enter key. But it seems that the Enter key is the only way how to finish editing, e.g. clicking a mouse outside the object boundaries does not finish editing. It prevents me from deploying the object as user unfriendly.
Moreover, if empty string is supplied as initial value, then automatic text "Edit" shows up instead (and this word even can be edited), which is really confusing.
I created this button to edit the text inside it and I would like to read and convert the text string into a double or int variable but it does not work and not print the "The text in the Edit field of the object with name" has been changed "
can you help me?