[OPTIMISATION] Critical runtime error 517, yet no issues in the code at all.

 

Hello everyone,

I'm currently working on a robot, and I have to say that I'm confused by the issue I'm facing. Let me explain: 

The robot works perfectly during backtests, there are no, and I know it, "out of range" errors, no division by zero, no infinite loops. Similarly, the #property strict is enabled, and there are no errors. I should also mention that I use absolutely no pointers at all. Neither do I call any external libraries except for the classic ones (CTrade, CSymbol and CPositionInfo).

During backtests, everything worked very well. HOWEVER, when optimising the robot, I get one of the following two errors for certain passages:

 "critical runtine error 517 in OnInit function (module -1 exception 0x0000005)"

 "critical runtine error 517 in OnTester function (module -1 exception 0x0000005)"

Note that I've looked everywhere on the MQL5 site and there's no error corresponding to this code. It's very badly done. 

I noticed that this error appeared much more often when I was using a linked list implementation, compared with a classic array implementation. However, even with a classic array, these errors occur after several thousand optimization passes. 

Furthermore, the OnInit() and OnTester() functions are nothing special. OnInit() only has 4 lines (two ArrayResize() and two ArraySetAsSeries()), and the OnTester() function simply checks the statistics of the optimisations, as in the official documentation.

I should also add that this problem does not occur on all computers. In my opinion, it's a RAM problem. Have you ever had a problem like this?

Find screenshots attached below as well.

Files:
IMG_2761.png  7 kb
IMG_2762.png  141 kb
 
I have to add as well that the issue persists even when reinstalling MetaTrader from 0, while it never happens on other computers. 
 

What MT5 build ?

Please post the 4 lines of your OnInit() just to see.

P.S: There is no need at all for a #property script with MQL5.

 
Alain Verleyen #:

What MT5 build ?

Please post the 4 lines of your OnInit() just to see.

P.S: There is no need at all for a #property script with MQL5.

Hello Alain,

Finally, after long research, it seems this is not a MetaTrader issue, but rather an issue with the processor.

Intel's 14900KF processors are unstable when using all available cores, therefore leading to blue screens or critical errors. Changing the processor has shown to remove that error entirely. 

It is still unfortunate that MetaQuotes does not provide more information about those "runtime errors", such as the 517. 
 
Zaky Hamdoun #:
Hello Alain,

Finally, after long research, it seems this is not a MetaTrader issue, but rather an issue with the processor.

Intel's 14900KF processors are unstable when using all available cores, therefore leading to blue screens or critical errors. Changing the processor has shown to remove that error entirely. 

It is still unfortunate that MetaQuotes does not provide more information about those "runtime errors", such as the 517. 

I understand that you have taken into account the latest microcode updates that Intel is releasing for installation through motherboard manufacturers, right? Right now there is a beta 0x12b that is possibly the final one to stabilize the high voltage that the motherboard supplied to the processor. The processor that has already been degraded, surely cannot be made stable through microcode updates, because physically it is already impossible.

You would also have to consider reducing the voltage from the beginning of the processor purchase to avoid premature wear.

 
I was also getting this error. Something wrong with the tick data over Christmas 2024.