MetaTrader 4 Platform update build 1330 - page 3

 

IMPORTANT


Need set types on GlobalVariableSet as int, string not only double.

Need access to keys from indicators not only EA. Can't confirm workin keys form indicaotrs in case on EA working.

Need long strin on ShortName, now is limited still and if too long then cuted to .ex name. And need control this ShortName from Start(), not only init()


Can't turn off the msg counter by alt+m, always see 1 notification what made disonanse.

 
Alain Verleyen:
I confirm it. Reported on Russian forum.

Thanks, it is indeed a bug, but I just found that the issue is caused by ArrayResize, as I coded a function for copying array elements and got the same result.

I also found a work-around for this issue, if the third parameter of ArrayResize (reserve_size) is set to at least twice the buffer size, no access violation occurs.

#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
{
   char m_buffer[255];
   ArrayInitialize(m_buffer, 'H');
   char result[];
   int response_size=0;
   int bytes_read=255;
   int reserve_array_size=255*2;
   for(int i=1; i<5000; i++)
   {
      if(ArrayResize(result,response_size+bytes_read,reserve_array_size)==response_size+bytes_read &&
            ArrayCopy(result,m_buffer,response_size,0,bytes_read)==bytes_read)
      {
         response_size+=bytes_read;
         Print(IntegerToString(response_size)+" bytes read.");
      }
   }
}
 
Mohammad Hossein Sadeghi:

Thanks, it is indeed a bug, but I just found that the issue is caused by ArrayResize, as I coded a function for copying array elements and got the same result.

I also found a work-around for this issue, if the third parameter of ArrayResize (reserve_size) is set to at least twice the buffer size, no access violation occurs.

Thanks for sharing.
 

EA stop on for loop modify (while loop or for loop) takeprofit 10-20 order.

Test code 

//+------------------------------------------------------------------+
//| Return Average Price By Symbol                                   |
//+------------------------------------------------------------------+
double ReturnAveragePrice(string sys,int cmd)
  {
//---- Calculate Buy   
   double AveragePrice,TotalPrice,TotalOpenPrice,TotalSize;
   int mg=MAGICMA;
//---   
   if(CountOrders(cmd,sys)>0){
      for(int i=0;i<OrdersTotal();i++){
         if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
         if(OrderSymbol()==sys && OrderMagicNumber()==mg && OrderType()==cmd){   
            TotalOpenPrice += OrderOpenPrice()*OrderLots();
            TotalSize += OrderLots();
         }
      }       
      TotalPrice = TotalOpenPrice/TotalSize;
   }
   AveragePrice = NormalizeDouble(TotalPrice,MarketInfo(sys,MODE_DIGITS));
      
   return(AveragePrice); 
  }
//---- Modify Code
TakeProfitBuy = ReturnAveragePrice(sys,OP_BUY)+TP;
TakeProfitSell = RetuenAveragePrice(sys,OP_SELL)-TP;
for(j=0;j<OrdersTotal();j++){
  if(OrderSelect(j,SELECT_BY_POS,MODE_TRADES)==true)
  if(OrderSymbol()==sys && OrderMagicNumber()==mg){                                 
    if(OrderType()==OP_BUY && OrderTakeProfit()!=TakeProfitBuy) res = OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),TakeProfitBuy,0,clrNONE);
    if(OrderTypr()==OP_SELL && OrderTakeProfit()!=TakeProfitSell) res = OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),TakeProfitSell,0,clrNONE);
  }
}
I solved the problem to keep it running by re-login.
 
Trader Mike:

I have discovered that the problem is from an msimg32.dll file that I have in the C:\Program Files (x86)\OANDA - MetaTrader folder, which is used by one of my EAs.  If I remove the file, then the MetaEditor works again!  I don't know what is causing this in the new build.  The DLL file was there in the old build and it caused no problem.  I have numerous MT4 platforms, so only a couple where I have that DLL file are effected.  I can still access the MetaEditor from the other platforms.  It's inconvenient, but I can live with it.

 

Hi

Since this mt4 update 1330, I can't use any mt4 indicator or expert from mql5.com purchased or free .... 

The error msg is always "global initialization failed".


Insert Error

 

I'm sure this 1330 build is pretty buggy.

I constantly get "out of memory", "invalid ex4 (7)" and "global initialization failed" errors. Crazy!

Furthermore, I constantly get "array out of range" errors that are caused by the faulty ArrayResize(..) function.

MT4 reinstall did not solve the problems.

The programs that drop these errors worked well for years before this build (maybe the 1320 also produced this, I'm not sure yet).

I found this old thread: https://www.mql5.com/en/forum/13305

It seems the problem is the same, my programs that do give these errors also use the faulty CopyHigh(...), CopyLow(...) functions.

Please, anyone who is able to report it to MetaQuotes, do it. Thank you!

Idenfity reason for "out of memory"
Idenfity reason for "out of memory"
  • 2013.08.06
  • www.mql5.com
Hi, my EA seems to have a memory leak since after a while it crashes with "out of memory...
 
all newly downloaded EA in this new 1330 build has "2021.04.15 01:03:52.457    Access violation write to 0xFFFFFFFF in 'C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\294B6FCE6F709DE82DA4C87FDBF1DE36\MQL4\Experts\Market\xx.ex4'" , only for this build , before build ok, only for newly downloads ,  copying EA over  from existing MT4 , also ok
 
Xi Ning Zhou:
all newly downloaded EA in this new 1330 build has "2021.04.15 01:03:52.457    Access violation write to 0xFFFFFFFF in 'C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\294B6FCE6F709DE82DA4C87FDBF1DE36\MQL4\Experts\Market\xx.ex4'" , only for this build , before build ok, only for newly downloads ,  copying EA over  from existing MT4 , also ok

Can confirm that this also happens to me for any demos downloaded now.

 
Xi Ning Zhou:
all newly downloaded EA in this new 1330 build has "2021.04.15 01:03:52.457    Access violation write to 0xFFFFFFFF in 'C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\294B6FCE6F709DE82DA4C87FDBF1DE36\MQL4\Experts\Market\xx.ex4'" , only for this build , before build ok, only for newly downloads ,  copying EA over  from existing MT4 , also ok

My reply on your other thread:

Forum on trading, automated trading systems and testing trading strategies

cannot download and install any new EA or update any EA from MT4, seemed only 1320build ok 1330build and older versions all problem

Sergey Golubev, 2021.04.15 06:12

You can delete this purchase from Metatrader and install it once again (in case you have activations enought).
If it does not help so - ask the seller for help (for example, ask the seller to adapt this product to the latest build of Metatrader).

Reason: