bool result = trade.Buy(lotSize, _Symbol, 0, sl, tp, "Market Buy Order"); // Place a buy order if (!result) { Print("OrderSend failed, error code =", GetLastError()); } else { Print("OrderSend successful"); }
To place orders, you can use the CTrade class and its OrderSend method, this is very similar to MQL4. Just declare the CTrade class:
#include <Trade\Trade.mqh> // Include the trade functions library CTrade trade; // Create an instance of the CTrade class

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello everyone,
Moving from mql4 to mql5, I'm trying to code a simple EA to know about mql5 (coding an EA with MA5 and MA20 cross). But i'm very confuse to place an order buy (or send) by OrderSend and OrderSendAsync. Anyone can share to me a example about place order on mql5, please ?
Thank you so much.
Tomq