See Runtime Errors
There are several critical errors, appearing which a program is terminated immediately :
- division by zero;
- going beyond array ranges;
- using an incorrect object pointer;
I get the "critical runtime error" from all my Remote Agents. I quit trying to use them. Local Agents work fine.
Update them manually, please.
When running a test I get no errors at all. However when optimising I get the ' tested with error "critical runtime error" ' message for a lot of passes.
Because the regular test does not bring up any error messages, I am unable to pinpoint the problem via printf or Alert. I know my arrays are in order, I have no zero divides and am using no pointers... What could the problem be?
The problem seems to come from my not using pointers. It seems I the optimiser expects them for classes such as CiOpen. Now that am using pointers, and the optimiser is indicating no errors, the tester log does show some warnings since my DeInit function does not delete these pointers.
I have tried to delete them like so but to no avail.
CiOpen *op;
//+------------------------------------------------------------------+ //| Deinitialization | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { if(CheckPointer(op)!=POINTER_INVALID) { op.Clear(); op.Shutdown(); //op.~CArrayObj(); } }
I know I have seen the proper code to do this on this forum somewhere but I seem to have failed to trace this page. Can someone please post the link?
The problem seems to come from my not using pointers. It seems I the optimiser expects them for classes such as CiOpen. Now that am using pointers, and the optimiser is indicating no errors, the tester log does show some warnings since my DeInit function does not delete these pointers.
I have tried to delete them like so but to no avail.
I know I have seen the proper code to do this on this forum somewhere but I seem to have failed to trace this page. Can someone please post the link?
Should have used
delete op;
I have similar problem. I get the same error but when doing optimization on both local and remote agents - one-pass testing works fine.
Morover when I run metatrader on other instance of system (newly installed - the same type - windows 7 64bit home edition) everything is OK.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
HP 0 Agent_192.168.0.10:2005 22:42:19 EURUSD: history synchronization completed [4090 Kb]
RP 2 Agent_192.168.0.10:2003 22:42:20 genetic pass (9, 110627387037426572) tested with error "critical runtime error"
QR 2 Agent_192.168.0.10:2002 22:42:21 genetic pass (10, 134774014628841714) tested with error "critical runtime error"
GF 2 Agent_192.168.0.10:2004 22:42:22 genetic pass (2, 264134954275310602) tested with error "critical runtime error"
DD 2 Agent_192.168.0.10:2003 22:42:22 genetic pass (12, 325680458438922693) tested with error "critical runtime error"
NG 2 Agent_192.168.0.10:2002 22:42:22 genetic pass (13, 290864787677294524) tested with error "critical runtime error"
KE 2 Agent_192.168.0.10:2003 22:42:24 genetic pass (15, 51427463641274676) tested with error "critical runtime error"
GJ 2 Agent_192.168.0.10:2001 22:42:24 genetic pass (7, 100705350637282872) tested with error "critical runtime error"
GH 2 Agent_192.168.0.10:2002 22:42:24 genetic pass (16, 319963509674294406) tested with error "critical runtime error"
Is it generating the error when returing non-zero from OnInit()?