Beta MetaTrader 4 Build 555 with Updated MQL4 Language and Market of Applications Released - page 12

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
A forward slash in code excluded by conditional compilation crashes the compiler, which goes into an infinite loop requiring the process to be killed.
I like the enhancements to MT4 a lot, thank you, and want to use conditional compilation. Forward slashes in code to be excluded by conditional compilation are hardly unusual, so I hope this gets fixed soon.
I was able to reproduce the bug via the following simple bit of code:
// #define TRADING_BOT 0
void OnInit() {
#ifdef TRADING_BOT
int bug = 1234 / 2; // The division (single forward slash) crashes the compiler if the macro TRADING_BOT is not defined
string msg = "Up/Down (Green/Red) ..."; // Single forward slashes in quoted text will also cause the crash if excluded by conditional compilation. They are ok in comments.
#endif
}
That code snippet gave the crash with builds 562 and 563 running on Windows 7.
A workaround is to remove all '/'s from within code that might be excluded by conditional compilation by:
- using a macro for division e.g. #define DIV(a, b) ((a)/(b))
- reformulating text to avoid '/'s
This was corrected in MT4 build 565, Metaeditor build 882, though in the process a new bug was introduced: indented #ifdef #endif blocks cause spurious errors if being skipped via conditional compilation. I have reported the new bug to Service Desk.
Update: The indented conditional compilation blocks bug, and another conditional compilation bug re incorrect line numbers in errors message with skipped code, were corrected in build 566 issued 2013.12.24
MT4 build 566 broke the GUI Dialog and Control components.
Indicators using the dialog/controls do not even run once. They are immediately removed from the chart automatically. No errors reported in the journal. (SimplePanel example code from the website).
This is an old bug that has been reintroduced.
EDIT!
Regarding point 2, this happens when the EA/Indicator uses the CDialog/CAppDialog control.
Example of combobox in indicator that does not work correctly. (Point 1 above):
There is a conflict with the use of the keyword extern.
There is a conflict with the use of the keyword extern.
Thanks for your message. The issue will be fixed.
I was playing with examples in the Help file. This line always fails with runtime error ERR_SOME_OBJECT_ERROR (Graphical object error):
I am not sure if the chart-in-chart feature is implemented.
For the same reason(s) as in MT5, MT4 needs an OrderSendAsync() function and thus OnTrade() event handler. It is surprising that there is no such functionality in MT4 for the years and years that it exists. A simple example: if one needs to close say 4 orders in the same instrument in a row, it may take 'ages' to get finished.. That's a lot of time :) The other very usefull thing would have been to be able to call MT4 (or MT5) functions directly from a DLL or external application..
+1 for all requested features
I have another note about the editor. I know it is very simple, but there is a feature that slows me down a lot:
If using the method/member hints (by pressing ctrl+space), only direct members are listed, i.e. while object.<ctrl+space> lists all methods and members, then object.getAnotherObject().<ctrl+space> does not list any. In such case I have to search source files for the class definition (in addition, there is no direct hint what the class name is, so first step is to locate the function, next step to find the class).
A note about MT4/MT5 portability.
I did not find out, how I recognize which functions/keywords were not available in the MQL5 or had different use. In case I wish to port the MQL4 code to MT5 (which should be easy with the new editor/compiler), I would prefer to avoid the MQL4 specific keywords and features, if I could recognize them.