If you receive a MetaTrader 4 error: OrderSend error 134, this means that you do not have enough money in your account to place an order with the given lot size What should you do?
OrderSend Error 134 A lot of people get coded by people expert advisors to Money Style which increases the size a lot like Martingale. The code eventually gets too big and you don’t have enough margin to keep the trade. This can happen over time if your account balance becomes too low or if you choose too large a size.
Error occurs when you try to place a trade, so it is an “orders error”. To prevent this error you can check the free margin of your account before attempting to place a trade. To do this you will use the function, AccountFreeMarginCheck ():
Double AccountFreemargincheck (string symbol, anti centimeter, double volume)
Returns available after opening the specified position at the current price in the current account. If the free margin is insufficient, an error 134 (ERR_NOT_ENOUGH_MONEY) will be generated.
Symbol – Symbol for trading operations.
cmd – operation type. This can be either OP_BUY or OP_SELL.
Volume – Lots of numbers.
An example would be:
You can use another function to find the remaining margin:
Double AccountFreeMargin ()
This provides the free margin value of the current account.
The following example prints a free margin for your account:
Print (“free margin =”, accountfreemargin ());