Download MetaTrader 5

Build 540 crashes when declaring a big local array

To add comments, please log in or register


I'm working extensively with MT5 and DLLs.

In a method I declare a large local array:

MqlRates rates[5000];

Everything was fine until the new build 540 came out.

Since then MT5 crashes when preparing the local variables on the stack.

You are now forced to work with small arrays and the compiler gives you a warning that the local variable size is too large (512kb).

Well, I think a warning should be a warning and not a sign that the client will crash!

Anyway, I would rather use dynamic arrays but it is not possible to pass dynamic arrays to a DLL(the marshalling is not clear).

Hope this helps you in case you have no clue why your MT5 crashes all of a sudden.

Best Regards,


To add comments, please log in or register