Can someone please identify the the cause of this? < [invalid request] OrderSend failed with error 4756 >
Im writing an EA which will place market order at a specific time, everything seemed to be right, no bug, no warning were found when I compiled it. But the problem is when I run it, the system kept warning that my order is invalid
CTrade::OrderSend: market buy 0.66 EURUSD sl: 1.07209 tp: 2.00000 [invalid request]
OrderSend failed with error 4756
I tried to figure out what is that error, and found this, but I can't stand why the request cannot be sent
ERR_TRADE_SEND_FAILED | 4756 | Trade request sending failed |
Below is the full code, I'm new to this so it may not be optimized. You can just skip the input part. I guess the problem comes from the order send function, but can't figure out what was wrong
Your OrderSend command is indeed wrong, if you are using the CTrade class then you are using the instructions in the library which you can see in the following link:
https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade

- www.mql5.com
The problem could be too close entry price for the order.
if(entry>Bid+SYMBOL_TRADE_FREEZE_LEVEL*_Point) //send sell limit order

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Im writing an EA which will place market order at a specific time, everything seemed to be right, no bug, no warning were found when I compiled it. But the problem is when I run it, the system kept warning that my order is invalid
CTrade::OrderSend: market buy 0.66 EURUSD sl: 1.07209 tp: 2.00000 [invalid request]
OrderSend failed with error 4756
I tried to figure out what is that error, and found this, but I can't stand why the request cannot be sent
ERROR CODE LIST (fromMQL5)
ERR_TRADE_SEND_FAILED
4756
Trade request sending failed
Below is the full code, I'm new to this so it may not be optimized. You can just skip the input part. I guess the problem comes from the order send function, but can't figure out what was wrong
And because I need to open 2 positions at the same time, but I still want to keep my positions without taking profit in the next open time, so I cannot use PositionsTotal() to limit positions, so may be Ctrade.Buy or Ctrade.Sell cannot work here