MQL4 function for the maximum number of open trades

 
I have an EA which opens a big number of trades (it uses a system similar to grid trading), so when backtesting it, I often get error 148 (ERR_TRADE_TOO_MANY_ORDERS).
To avoid this problem, I ask you: is there a MQL4 function that returns the maximum number of open trades, so that I can code this info in the EA?

Obviously I could check this info for any particular broker I use, but this way I couldn't code it directly in the EA.

Thank you very much.
 
I have had the trade too many orders error manually trading but it goes away after a while and I am able to place another trade later. So it could be that your access to the brokers server has been denied because it can't handle all the trade requests its getting at that moment in tme. Its not you its them that can't handle the trafic. Just my experience of the error. However the best way to get the answer to your question is to ask your broker.
 
brouwer89:
I have an EA which opens a big number of trades (it uses a system similar to grid trading), so when backtesting it, I often get error 148 (ERR_TRADE_TOO_MANY_ORDERS).
To avoid this problem, I ask you: is there a MQL4 function that returns the maximum number of open trades, so that I can code this info in the EA?

Obviously I could check this info for any particular broker I use, but this way I couldn't code it directly in the EA.

Thank you very much.
You can do this: Get the " maximum number of open trades " from your broker and hardcode (may be a parameter) it in your code. If you're sure this error goes away after a while, then put a time=out function after receiving error..
Reason: