Converting MQL4 trade functions to MQL5
MT4, orders are pending or opened. MT5, opened orders are positions. Do a position loop, and read the results.
MT5: first select a position via CPositionInfo, directly, or by 'MT4Orders' library (2016)
MT5 OrderType equivalent.
OrderType() Functionality in MQL5 - General - MQL5 programming forum #1 (2022)
MT4, orders are pending or opened. MT5, opened orders are positions. Do a position loop, and read the results.
MT5: first select a position via CPositionInfo, directly, or by 'MT4Orders' library (2016)
MT5 OrderType equivalent.
OrderType() Functionality in MQL5 - General - MQL5 programming forum #1 (2022)
Thanks for the links, much appreciated.
Hi,
I've programmed MQL5 for a while but don't know much about MQL4 and I need to convert some MQL4 code with trade function to work with MQL5.
As far as I can see, MQL4 deals with both positions/orders with the same functions, whilst MQL5 has separate functions for positions/orders.
For example, am I correct in assuming that to convert the trade function in the MQL4 example code below, I'd need to separate it out and use Positionxxx for BUY/SELL and Orderxxx for SELLSTOP/BUYSTOP?
Thanks