MetaTrader 4 build 184

 
MetaTrader 4 Build 184

The new build includes the following changes:
1. Fixed "Common error" of terminal connection;
2. Fonts of charts have fixed size, they don't depend on font settings of the operational system anymore;
3. Added GetObjectVisibility(), SetObjectVisibility(), SetLevelValue(), SetLevelStyle(), FirstVisibleBar(), BarsPerWindow() functions; parameters MODE_MINLOT, MODE_LOTSTEP in the function of MarketInfo() function;
4. Fixed appearance of comments for pending orders;
5. Added functionality to assign hot keys for indicators, expert advisors and scripts through context menu of the "Navigator" window;
6. Settings of the terminal toolbars were transferred to the file of terminal.ini;
7. Improved work of the Client Terminal in two monitors;
8. Added Turkish and Spanish interface languages;
9. Modified coloring of modeling quality indicator considering initial and end dates of testing;
10. Fixed "Trade context is busy" error during expert advisor trading;
11. Improved work of the terminal through Data Centers;
12. Fixed calculation of margin requirements when testing experts on futures;
13. Improved calculation of cross currencies when testing;
14. Strategy Tester symbol list is updated when relogging;
15. Updated MetaEditor Dictionary.

MetaTrader 4 download link: "MetaTrader 4 trading terminal"
 
These are nice updates, good work.
 
All the functions in #3 are a big help to custom indicator building. Thanks.
 
Thank you very much, keep up the good work, take care, Ted.
 
I agree. Great stuff, good work!


Markus
 
There seem to be a problem with builds 182, 183, 184. Method
FileOpen(file_name,FILE_BIN|FILE_READ|FILE_WRITE)

does not work the same way it worked earlier. I am creating a text file to store some text. Has there been a change/bug fix for File Open method in these builds?
What are the proper arguments to use with File Open for text file creation?

 
There seem to be a problem with builds 182, 183, 184. Method
FileOpen(file_name,FILE_BIN|FILE_READ|FILE_WRITE)

does not work the same way it worked earlier. I am creating a text file to store some text. Has there been a change/bug fix for File Open method in these builds?
What are the proper arguments to use with File Open for text file creation?


Definitely not FILE_BIN. And you may want to omit FILE_READ to create a new file to replace the existing one.
handle = FileOpen(file_name, FILE_READ | FILE_WRITE);
FileSeek(handle, 0, SEEK_END);


- to append text to the existing file or just

handle = FileOpen(file_name, FILE_WRITE);


to create a new file.

Both seem to be working okay.

 
Does not work for some reason on build 184. I run winXP, sp2. It could be my OS installation. I do not thinks that I am the only one who is using FileWrite. Which makes existence of this problem a bit puzzeling.

However, I had to revert back to build 178. With this build, FileOpen(file_name, FILE_READ|FILE_WRITE) successfully creates file on the first run and opens it for appending records in subsequent runs. (see code below)

Again, moved build to 184, recompiled the same code: file fail to be created. Tried various flag combinations: same result. GetLastError() does not return a meaningful error. It looks like a bad build/ compilation bug to me.

Ok, code:
string file_indicator="status.txt";

void file_clear(string file_name){
	int file_handle;
	file_handle=FileOpen(file_name,FILE_READ);
	FileClose(file_handle);
	if(file_handle>0){
		FileDelete(file_name);
	}
}

void file_record(int record,string file_name,string value1){
	if(record==0){
		return;
	}
	int file_handle;
	file_handle=FileOpen(file_name,FILE_READ|FILE_WRITE);
	int error_code=GetLastError();
	Print("file:",file_handle," err:",error_code," dsc:",ErrorDescription(error_code));

	FileSeek(file_handle,0,SEEK_END);
	FileWrite(file_handle,value1);
	FileFlush(file_handle);
	FileClose(file_handle);
}

void init(){
	file_clear(file_indicator);
}

void start() {
	file_record(1,file_indicator,"some text to record");
}


Now, when I look at it: it also might be the fact that this method is within another function call. But it should not. Ok, any ideas?

 
Yep, there is an ugly bug with the scope of local variable names in me4 compiler. Just use a different name for the file handle in file_clear.
 
Yep, there is an ugly bug with the scope of local variable names in me4 compiler. Just use a different name for the file handle in file_clear.

I have tried the above code on my 184 and it works perfect
The only thing I had to change was function definitions:

void start() to int start()
void init() to int init()
 
Tried both ideas, they did not work.
I had just realized what it might be. I am using build from Neuimex, not MetaQuotes. They must be messing up their build upgrades.
Thank you guys for your help and ideas.
Reason: