I want to send an order to the server using CTrade class.
I want to send the following order to the server:
Type: buyLimit
Volume: 1000
Price: 3000
Stop Loss: 0
Take profit = 0
Fill policy= return
Expiration: Today
what is the complete needed code for that?
should I use CTrade.OrderOpen() method first and then use CTrade.OrderSend()?
or is it just enough to use CTrade.BuyLimit() method?
Please explain
thanks
I want to send an order to the server using CTrade class.
I want to send the following order to the server:
Type: buyLimit
Volume: 1000
Price: 3000
Stop Loss: 0
Take profit = 0
Fill policy= return
Expiration: Today
what is the complete needed code for that?
should I use CTrade.OrderOpen() method first and then use CTrade.OrderSend()?
or is it just enough to use CTrade.BuyLimit() method?
Please explain
thanks
Show your code.
CTrade trade; trade.SetTypeFilling(ORDER_FILLING_RETURN); trade.OrderOpen(Symbol(),ORDER_TYPE_BUY_LIMIT,300,0,3746,0,0,ORDER_TIME_DAY,0,"comment"); trade.BuyLimit(300,3746,Symbol(),0,0,ORDER_TIME_DAY,0,"comment");
Should I login to my account before sending orders in MT5?
I mean before using commands like: Ordersend(), should I send user information to server? should I do somehting else? because the server rejects all of my orders, but when I manually put them there is no error.
How does the Server know what account the Order is for if you haven't logged in ?
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Should I login to my account before sending orders in MT5?
I mean before using commands like: Ordersend(), should I send user information to server? should I do somehting else? because the server rejects all of my orders, but when I manually put them there is no error.