To open positions there are only two types of market orders, a ORDER_TYPE_BUY, or a ORDER_TYPE_SELL.
A buy order/position opens at the Ask price and a sell opens at the Bid price.
So yes, you should supply the current price (Ask or Bid) according to the order type (Buy or Sell).
tks you Fernando Carreiro
With which function then can we use the other types of orders as shown in the photo?
Or maybe it's something else I'm still missing?
Operations with orders |
|
Places a pending order with specified parameters |
Also, please read the following ...
Orders, Positions and Deals in MetaTrader 5
MetaQuotes, 2011.02.01 16:13
Creating a robust trading robot cannot be done without an understanding of the mechanisms of the MetaTrader 5 trading system. The client terminal receives the information about the positions, orders, and deals from the trading server. To handle this data properly using the MQL5, it's necessary to have a good understanding of the interaction between the MQL5-program and the client terminal.
tks you
It's a wonderful platform, there are so many possibilities, I'm going to take the time to read it all at my leisure and I'll of course get back to you or perhaps ask you more questions,
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everyone, I hope you're well 😊.
I'm still a beginner and I see that the PositionOpen function can use different order types,
and if I've understood correctly, the ORDER_TYPE_BUY order type means that it's a market order. Do we need to specify a price like SYMBOL_ASK for a market buy?
And how do we know which order type our broker accepts?