Download MetaTrader 5

Critical! FileReadString Error in Build 613

To add comments, please log in or register
They are already making profit from their signals. Publish your signal and join them!
Xiangdong Guo
3741
Xiangdong Guo 2014.02.28 02:21 

Critical Bug!

FileReadString couldn't return correct result in Build 613.

I lost many profit!!!!!

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.02.28 08:16  
asmywish:

Critical Bug!

FileReadString couldn't return correct result in Build 613.

I lost many profit!!!!!

Please post compilable test code which reproduces the issue so others can reproduce the issue.
Trevhib
184
Trevhib 2014.02.28 11:31  
Build 613?!
Xiangdong Guo
3741
Xiangdong Guo 2014.02.28 11:41  

I upgraded MT4 terminal to latest build 613, then my EA got wrong result from FileReadString function.

After many test, I found if using '\t' as the delimiter, FileReadString always returns empty string,

but if using ',' or ';', FileReadString returns correct result.

Alain Verleyen
Moderator
30737
Alain Verleyen 2014.02.28 11:55  
asmywish:

I upgraded MT4 terminal to latest build 613, then my EA got wrong result from FileReadString function.

After many test, I found if using '\t' as the delimiter, FileReadString always returns empty string,

but if using ',' or ';', FileReadString returns correct result.

Metaquotes test server update is not an official release, please don't use it unless you want to be a beta tester.
Xiangdong Guo
3741
Xiangdong Guo 2014.02.28 12:23  

Source code see below.

The log file:

2014.02.28 14:19 test 984.29

The result:


Xiangdong Guo
3741
Xiangdong Guo 2014.02.28 12:24  
angevoyageur:
Metaquotes test server update is not an official release, please don't use it unless you want to be a beta tester.


MT4 terminal Build 613 upgraded from Alpari UK
micclly
189
micclly 2014.02.28 12:31  

NOTE: asymwish, you should paste a code with SRC button in toolbar, just edit and remove a code, and paste it again with SRC button please.


asmywish:

MT4 terminal Build 613 upgraded from Alpari UK

Really it? I connected AlpariUK-Demo-Pro but 613 was not downloaded.

I'm asking this because MT4 update uses same shared directory %APPDATA%\MetaQuotes\WebInstall,

so if you connecting to demo.metaquotes.net:444 with another terminal, even if AlpariUK does not provide update, the terminal will be updated.


EDIT:

To see whether Alapri UK did provide update 613 or not, open data folder of the terminal, and open logs/20140228.log, finally you find (or not) the following log:

15:48:21.089 MetaTrader 4 build 610 started (MetaQuotes Software Corp.)
15:48:21.089 Data Folder: C:\Users\<USERNAME>\AppData\Roaming\MetaQuotes\Terminal\<LONG_UNIQUE_ID>
15:48:25.826 '2808': login
15:48:26.247 LiveUpdate: new version 4.00 build 613 is available   <---- HERE the log you should find

If found, you should ask Alpari UK to why provide update 613 as a release version. Maybe Alpari's mistake.

Xiangdong Guo
3741
Xiangdong Guo 2014.02.28 12:45  
#property copyright "Copyright 2014"
#property link      ""
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart() {
  WriteLog();
  ReadLog(); 
}

void WriteLog() {
  string log_file_name = (string)AccountNumber() + "-AccountEquity.log";
  int handle = FileOpen(log_file_name, FILE_ANSI|FILE_CSV|FILE_WRITE, '\t');
  if (handle > 0) {
    FileWrite(handle, TimeToStr(TimeCurrent()), "test", DoubleToStr(AccountEquity(), 2));
    FileClose(handle);
    Print("Done");
  }
}

void ReadLog() {
  string log_file_name = (string)AccountNumber() + "-AccountEquity.log";
  int handle = FileOpen(log_file_name, FILE_ANSI|FILE_CSV|FILE_READ, '\t');
  if(handle > 0) {
    if (!FileIsEnding(handle)) {
      string update_time = FileReadString(handle);
Print("update_time=",update_time);
    }
  }
}
Xiangdong Guo
3741
Xiangdong Guo 2014.02.28 12:47  
micclly:

NOTE: asymwish, you should paste a code with SRC button in toolbar, just edit and remove a code, and paste it again with SRC button please.



Really it? I connected AlpariUK-Demo-Pro but 613 was not downloaded.

I'm asking this because MT4 update uses same shared directory %APPDATA%\MetaQuotes\WebInstall,

so if you connecting to demo.metaquotes.net:444 with another terminal, even if AlpariUK does not provide update, the terminal will be updated.


EDIT:

To see whether Alapri UK did provide update 613 or not, open data folder of the terminal, and open logs/20140228.log, finally you find (or not) the following log:

If found, you should ask Alpari UK to why provide update 613 as a release version. Maybe Alpari's mistake.


Not only Alpari UK, but also FXOpen, Armada, FXCM, ThinkForex, etc...
Alain Verleyen
Moderator
30737
Alain Verleyen 2014.02.28 12:50  
asmywish:

MT4 terminal Build 613 upgraded from Alpari UK
Thank you for this information.
123
To add comments, please log in or register