Situation with pending orders

 

Hello.

I have simulate in my EA situation when program place pending order and when price going to hit it, in account no money for execution order, so I get information from server :

2026.02.28 17:12:44.096 2024.10.23 19:31:28   current account state: Balance: 1000.00, Credit: 0.00, Commission: 0.00, Accumulated: 0.00, Assets: 0.00, Liabilities: 0.00, Equity 541.17, Margin: 500.00, FreeMargin: 41.17

2026.02.28 17:12:44.096 2024.10.23 19:31:28   calculated account state: Assets: 0.00, Liabilities: 0.00, Equity 541.17, Margin: 600.00, FreeMargin: -58.83

2026.02.28 17:12:44.096 2024.10.23 19:31:28   not enough money for order [#16 buy limit 0.1 GBPUSD at 1.29256]


Is server or terminal generate any error in this case and how I can handle that? I try get last error, but it show strange number  belowe , which I did not find in documentation.

2026.02.28 17:12:44.096 2024.10.23 19:31:28   =============================last error   69550

Thanks.

 

Thanks , have done it using  HistoryOrder .

Please just let me know is every time generated comment "deleted [no money]" or broker can generate it own?

 
Piotr Storozenko #:

Thanks , have done it using  HistoryOrder .

Please just let me know is every time generated comment "deleted [no money]" or broker can generate it own?

Possible causes of that strange error are:

  • Your Balance is simply too low (at all times);
  • You're trading on an exchange that has variable initial (day) and overnight margin rates (making your Balance too low sometimes); or
  • Your EA's order handling code contains erroneous order parameters for the instrument that you're trading (including price format, price increments, etc.).

Based on my experience with MT5 connected to a centralized futures exchange through a gateway (with a clearing broker), data such as exchange commissions and broker commissions are not always transferrable to MT5. In this case, the broker issues notice and simply omits them from MT5. If the broker were allowed to modify MT5, it would have done so instead of omitting data. Brokers are not allowed to modify (hack) MT5.

Therefore, I highly doubt that a broker can create its own MT5 error codes. 69550 may represent an empty value of sorts where no specific error code is returned. Based on your post and your location, it looks like you're trading a GBPUSD CFD. Based on your "every time generated comment," the cause is/was probably your code.