Libraries: CLiveTradeInfo - CHistoryTradeInfo

CLiveTradeInfo - CHistoryTradeInfo:

The library reconstructs a complete MQL4-style order model on top of the native MQL5 Position, Order, Deal, and History APIs. This design allows legacy MQL4 Expert Advisors to operate with minimal code changes while preserving MQL5.

CLiveTradeInfo - CHistoryTradeInfo

Author: Hans Alexander Nolawon Djurberg

Serious stress tests are needed.
fxsaber #:
Serious stress tests are needed.
It's tested with several opening/closing orders/positions, you can try the test demo file on your side.
It would be good to add all the Order functions.
Trade Functions - MQL4 Reference
Trade Functions - MQL4 Reference
  • docs.mql4.com
Trade Functions - MQL4 Reference
Hans Alexander Nolawon Djurberg #:
It's tested with several opening/closing orders/positions, you can try the test demo file on your side.
#include <MQL4TradeCompat_define.mqh> // https://www.mql5.com/en/forum/518160#comment_60549462

#define Bid SymbolInfoDouble(_Symbol, SYMBOL_BID)
#define Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

void OnStart()
{
  Print(AccountInfoString(ACCOUNT_SERVER));
  
  // https://docs.mql4.com/trading/ordersend
  Print(OrderSend(_Symbol, OP_BUY, 0.1, Ask, 0, 0, 0));
}


Result.

Trades  '': market buy 0.1 AUDCAD
Trades  '': deal #10662681920 buy 0.1 AUDCAD at 0.99357 done (based on order #10922861691)
Trades  '': accepted market buy 0.1 AUDCAD
Trades  '': order #10922861691 buy 0.1 / 0.1 AUDCAD at 0.99357 done in 38.948 ms
MetaQuotes-Demo
-1962040197