Download MetaTrader 5
To add comments, please log in or register
Start making profit using the Market. Publish your product!
Peter Williams
342
Peter Williams 2014.02.24 12:48 

I have just installed the new build and spent quite some time making changes that will be acceptable.

Looks very good!

My EA writes log data to a series of files - information to help find errors, MIN & MAX data and also a log of when contracts are liquidated

These files have moved across to the roaming area >>>

C:\Users\Peter\AppData\Roaming\MetaQuotes\Terminal\825A96AF7F79E0C50E6013DE75C58255\MQL4\Files


Previously I could access a file currently being used by MT4

(1 of the logs just records details of transactions and shows max committed funds, equity, margin, profit etc - and enables me to 'play with' in EXCEL and draw graph).

This no longer appears to be the case - i.e. CAN NOT OPEN FILE because MT4 still has the file open (I could read previously).


Presumably there are some different properties attached to the files.

Is there any means of changing these so that I can examine my log files (from Excel or using a TEXT editor)

whroeder1
13612
whroeder1 2014.02.24 13:46  
peterhw1:
These files have moved across to the roaming area >>>
This no longer appears to be the case - i.e. CAN NOT OPEN FILE because MT4 still has the file open (I could read previously).
  1. Data Structure in MetaTrader 4 Build 600 and Higher - MQL4 Articles
  2. MT4 doesn't have the file open, your EA does.
  3. So allow shared access or open, append, and close
Peter Williams
342
Peter Williams 2014.02.24 14:05  
WHRoeder:
  1. Data Structure in MetaTrader 4 Build 600 and Higher - MQL4 Articles
  2. MT4 doesn't have the file open, your EA does.
  3. So allow shared access or open, append, and close

Many thanks again.

I hadn't realised there was a file APPEND - so I just searched the forum and now know I just need to:-


FileOpen(file_name,FILE_CSV|FILE_READ|FILE_WRITE,'|');
Learned something else - thanks again.
whroeder1
13612
whroeder1 2014.02.24 15:01  
"Just need to" APPEND
   int         APPEND   = FILE_CSV|FILE_WRITE|FILE_READ;
   string      nameOPT  = WindowExpertName() + ".OPT";
   int      handleOPT   = FileOpen(nameOPT, APPEND, '~');   if(handleOPT < 1){
      AlertMe( "OptComplete: FileOpen(", nameOPT,") Failed: ", GetLastError() );
                                                                     return;  }
   FileSeek(handleOPT, 0, SEEK_END);
   FileWrite(handleOPT, result);
   FileClose(handleOPT);
ang yao
114
ang yao 2014.02.24 15:48  

Yes, I had finished changed my EAs and Indicators to fit the new version.

The compatibility is OK, and I only made a little change.

About Change:

switch( integer only ) here is something changed.

and We can use 'class'. That's something strange.

I'll use MQL5 grammar to code with MT4 next time. Wish you all have a good day.

Ian Venner
2583
Ian Venner 2014.02.24 16:18  

yes I agree, class and everything to do with it is very strange lol

/
To add comments, please log in or register