New MetaTrader 4 Client Terminal Build 507: Trading Signal Registration Command and Setting a Spread When Testing - page 4

 
fudge:


1. Did you compile the EA with the new build? If yes, this might be one of the symptoms that I experience.

2. Does your EA includes any mqh files using #include keyword?

3. If your EA is not confidential, can you post it using the SRC button? 


1. Yes I compile it without any problems with the new build

2. Yes, it includes stdlib.mqh and stderror.mqh (in this order), but if I comment the include clauses and corresponding instructions the result is the same - no problems with the compilation, but tester crashes.

3. I'm not sure if I can post it, because EA is modified version of commercial one... maybe after I delete some parts of code I will post it.

 
YanevFX:

1. Yes I compile it without any problems with the new build

2. Yes, it includes stdlib.mqh and stderror.mqh (in this order), but if I comment the include clauses and corresponding instructions the result is the same - no problems with the compilation, but tester crashes.

3. I'm not sure if I can post it, because EA is modified version of commercial one... maybe after I delete some parts of code I will post it.


3. Modified version of a commercial one? Are you using a decompiled EA? If yes, it's not permitted by Metaquotes and might be the reason to your problems and not related to the current discussion. 
 
fudge:

3. Modified version of a commercial one? Are you using a decompiled EA? If yes, it's not permitted by Metaquotes and might be the reason to your problems and not related to the current discussion. 

It's not decompiled! It was sold with the source code.
 

I am having a similar problem with build 507, involving the #include file directive.

My environment is Win 7 64 bit

The MT4 files are installed in their own folder outside of the program files folders

My EA does an #include <TradeContext.mq4> as well as several imports of functions as shown below.

When the EA is compiled with 500, it works with the include.

When it is compiled with 507 (the compile works fine), the EA crashes and MT4 closes immediately after clicking Start on the Backtester, and there are no entries in the log files.

When the #include <TradeContext.mq4> line is replaced by copying the contents of that file into my EA source, it compiles and runs normally under 507.

The only change is replacing the #include directive with the contents of that included file; the other imports from dll's don't seem to be involved. The TradeContext.mq4 file has no other includes, and is the file available on this forum here, also attached.

#include <TradeContext.mq4> // when this line is commented out and the contents of TradeContext.mq4 are copied into this EA source, the EA runs under 507

#import
#import "Kernel32.dll"
int CreateFileA(string lpFileName, int dwDesiredAccess, int dwShareMode, int lpSecurityAttributes, int dwCreationDisposition, int dwFlagsAndAttributes, int hTemplateFile);
int CloseHandle(int hObject);
#import
#import "stdlib.ex4"
#define         NumberOfSymbols                    9

string ErrorDescription(int error_code);
int    RGB(int red_value, int green_value, int blue_value);
bool   CompareDoubles(double number1, double number2);
string DoubleToStrMorePrecision(double number, int precision);
string IntegerToHexString(int integer_number);
#define OPEN_EXISTING 3
#define FILE_SHARE_READ 1
#define GENERIC_READ 0x80000000
#define FILE_ATTRIBUTE_NORMAL 128
#define INVALID_HANDLE_VALUE 0xFFFFFFFF
#define NL "\n"
#define  TpPrefix "Tp"
#define  SlPrefix "Sl"
Files:
 

Well, it's very clear that there are some serious problems with build 507 and people will start going crazy tomorrow when the markets will open.
From what I've noticed so far, it's mainly related to include files, but might be caused by other things as well.
cody_r, since it's a bad practice to include mq4 files, can you rename the file to mqh and put it in the include directory. Maybe this will resolve your problem. Let us know.

 
fudge:

Well, it's very clear that there are some serious problems with build 507 and people will start going crazy tomorrow when the markets will open.
From what I've noticed so far, it's mainly related to include files, but might be caused by other things as well.
cody_r, since it's a bad practice to include mq4 files, can you rename the file to mqh and put it in the include directory. Maybe this will resolve your problem. Let us know.

I did that just now, and with #include <TradeContext.mqh> it compiles fine and still crashes, closing MT4, immediately on backtest.

 

Well, maybe I got the key.

As I wrote above, my expert written by commercial developer. I modified it many times, I added many additional improvements and changed the code.

After each update I changed the name of the expert with adding to it +NewFunctionality (very stupid, but...). The result is that the name of the EA become over 100 symbols long.

Now, after the described problem and after the proposed solution with installing MT4 outside Program Files folder, I decided to shorten the name of the expert. And the result was successful Backtest!


Please, report if it helps for you too.

Regards to all!

 
YanevFX:

Well, maybe I got the key.

As I wrote above, my expert written by commercial developer. I modified it many times, I added many additional improvements and changed the code.

After each update I changed the name of the expert with adding to it +NewFunctionality (very stupid, but...). The result is that the name of the EA become over 100 symbols long.

Now, after the described problem and after the proposed solution with installing MT4 outside Program Files folder, I decided to shorten the name of the expert. And the result was successful Backtest!


Please, report if it helps for you too.

Regards to all!


As you can see here: http://msdn.microsoft.com/en-us/library/aa365247.aspx, filename + path might be limited to 260 characters, so I don't think that you problem related to build 507.
 
cody_r:

I did that just now, and with #include <TradeContext.mqh> it compiles fine and still crashes, closing MT4, immediately on backtest. 


Well it was worth a try. Build 507 is buggy for sure, but please try to put the include after the imports. Maybe it will help...
 
fudge:

Well it was worth a try. Build 507 is buggy for sure, but please try to put the include after the imports. Maybe it will help...
Unfortunately, it didn't. Same result with an instant crash and closure of MT4.