MetaTrader 4 Client Terminal build 646: New Smart Search, Books in the Market and Updated Window of MQL4 Application Settings - page 13

 
A compiler bug that made older ex4 files not work in profiler has also been fixed.
 

When there's no internet connection (leave alone connected to broker) and chart is refreshed, the journal show that MT4 b 646 trying to synchronize to history center over and over indefinitely forever.

Please fix that to stop that.

For crying out loud, if there's no internet connection - don't synchronize.

Check if there's internet connection using this http://msdn.microsoft.com/en-us/library/windows/desktop/aa366143(v=vs.85).aspx .


 

I found that a very large size (average 5GB) created in the following folders daily starting from 6th Feb 2014 on my C:/ drive and its used up space heavily:

 C:\Users\VPCSVE15118FGB\AppData\Roaming\MetaQuotes\Terminal\CCD68BFB06049A8615C607C3F6AD69B7\MQL4\Logs

 

There are very big text files with name  like 20140226.log and 20140227.log, etc.

What are these files for? Can I delete them?

 

Anyone knows this? Please help. thank you

 
mshaipudin:

I found that a very large size (average 5GB) created in the following folders daily starting from 6th Feb 2014 on my C:/ drive and its used up space heavily:

 C:\Users\VPCSVE15118FGB\AppData\Roaming\MetaQuotes\Terminal\CCD68BFB06049A8615C607C3F6AD69B7\MQL4\Logs

 

There are very big text files with name  like 20140226.log and 20140227.log, etc.

What are these files for? Can I delete them?

 

Anyone knows this? Please help. thank you


During weekends, close your terminal and delete the logs.

 
mshaipudin:

I found that a very large size (average 5GB) created in the following folders daily starting from 6th Feb 2014 on my C:/ drive and its used up space heavily:

 C:\Users\VPCSVE15118FGB\AppData\Roaming\MetaQuotes\Terminal\CCD68BFB06049A8615C607C3F6AD69B7\MQL4\Logs

 

There are very big text files with name  like 20140226.log and 20140227.log, etc.

What are these files for? Can I delete them?

Yes, you can delete them when the MT4 terminal is not running.

These files are the log files of your expert / indicator activity. The big file size indicates that you've some faulty, or poorly programmed expert/indicator which has a recurring error or too much logging. These messages are constantly been written to the logfiles when a tick (price change) came in. So if you would like to avoid this, you have to check your indicators/experts one by one and find the faulty one. You could open these files with Notepad for example, or just have a glimpse in the "Experts" tab of the Terminal panel.

 

One more : seems conditional operator "if" does not works well in OnInit in my EA.

Please try the code below. Anyone else able to reproduce the problem/have this problem ?

Now I'm not sure if all of conditional if runs correctly in my code.


datetime gdt_EXPIRED_END   = D'2015.12.31';

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
void OnInit()
  {
//--- 
   EventSetTimer(1);
   
   datetime expired = gdt_EXPIRED_END;
   int today,expired_day,this_month,expired_month,this_year,expired_year;
   
   today         = TimeDay(TimeCurrent());
   expired_day   = TimeDay(expired);
   this_month    = TimeMonth(TimeCurrent());
   expired_month = TimeMonth(expired);
   this_year     = TimeYear(TimeCurrent());
   expired_year  = TimeYear(expired);
   
   Print("Expired time ",TimeToStr(expired, TIME_DATE));
   Print("Today ",IntegerToString(today));
   Print("Expired day ",IntegerToString(expired_day));
   Print("This month ",IntegerToString(this_month));
   Print("Expired month ",IntegerToString(expired_month)); 
   Print("This Year ",IntegerToString(this_year));
   Print("Expired Year ",IntegerToString(expired_year));
   
   //--- this part works correctly
   if (today > expired_day && this_month >= expired_month && this_year >= expired_year)
       {   
       MessageBox("Your EA just expired at "+TimeToStr(expired, TIME_DATE) +
                  " !!!.\nToday is "+TimeToStr(TimeCurrent(), TIME_DATE) +".\n\nWrong Expired Time on Year !!!", 
                  WindowExpertName(), MB_OK|MB_ICONSTOP);
       }
       else
       {
       MessageBox("Your EA is NOT yet expired.\n\nCorrect !!!", 
                  WindowExpertName(), MB_OK|MB_ICONINFORMATION);
       }
   
   //--- This part does NOT works correctly    
   if (TimeDay(TimeCurrent() > TimeDay(expired) && TimeMonth(TimeCurrent()) >= TimeMonth(expired) && 
       TimeYear(TimeCurrent()) >= TimeYear(expired)))
       {
       MessageBox("Your EA just expired at "+TimeToStr(expired, TIME_DATE) +
                  " !!!.\nToday is "+TimeToStr(TimeCurrent(), TIME_DATE) +".\n\nWrong Expired Time on Year !!!", 
                  WindowExpertName(), MB_OK|MB_ICONSTOP);
       }
       else
       {
       MessageBox("Your EA is NOT yet expired.\n\nCorrect !!!", 
                  WindowExpertName(), MB_OK|MB_ICONINFORMATION);
       }
              
   ExpertRemove();
//---
  }
 
Usually, those usually put at start() not oninit() because you need continuous run to make it check the correct time.
 
onewithzachy:

One more : seems conditional operator "if" does not works well in OnInit in my EA.

Please try the code below. Anyone else able to reproduce the problem/have this problem ?

Now I'm not sure if all of conditional if runs correctly in my code.


It seems you may have run into parentheses mess:

if (TimeDay(TimeCurrent() > TimeDay(expired) ..... 

 

Yes I was thinking that too ... I would rewrite it like this just because it is easier to write the parenthesis, I have never liked &&  || conditions for that reason.

if( TimeDay(TimeCurrent() > TimeDay(expired) )
{if( TimeMonth(TimeCurrent() >= TimeMonth(expired) ) 
 {if( TimeYear(TimeCurrent() >= TimeYear(expired) )
 
deysmacro:
Usually, those usually put at start() not oninit() because you need continuous run to make it check the correct time.

Not really. The first code works because the values of TimaDay() ... etc were assigned to integer variables and the conditional ifs compare those values using those integer variables. While in second code the conditional ifs compare those values directly fromTimeDay()...etc.

That mean TimeDay()...etc runs correctly on OnInit.



DeepThought 


It seems you may have run into parentheses mess:

if (TimeDay(TimeCurrent() > TimeDay(expired) ..... 

Nope. both code has the same comparison. See yourself, I colored them to compare.

if (today > expired_day && this_month >= expired_month && this_year >= expired_year)

if (TimeDay(TimeCurrent() > TimeDay(expired) && TimeMonth(TimeCurrent()) >= TimeMonth(expired) && 
    TimeYear(TimeCurrent()) >= TimeYear(expired)))


SDC 

Yes I was thinking that too ... I would rewrite it like this just because it is easier to write the parenthesis, I have never liked &&  || conditions for that reason.

if( TimeDay(TimeCurrent() > TimeDay(expired) )
{if( TimeMonth(TimeCurrent() >= TimeMonth(expired) ) 
 {if( TimeYear(TimeCurrent() >= TimeYear(expired) )

 

I'll try that, but Im quite sure that's not the problem. See my reply for DeepThought. Same comparison, the first code runs correctly, but the second fails.



BTW, Obviously you guys didn't read my code thoroughly because I forget to declare variable gdt_EXPIRED_END. The code above is edited, my apology for forgetting that

datetime gdt_EXPIRED_END   = D'2015.12.31';

Thanks for the replies, guys.


Reason: