MT4Orders - MetaTrader 5 Library | MT5 EA Download - MetaTrader 5 Resources









The library allows processing orders in MQL5 (MT5 Hedging) in the same way as in MQL4.
That is, the Order Language System (OLS) becomes identical to MQL4. At the same time, it is still possible to use the MQL5 order system in parallel . In particular, the standard MQL5 library will continue to be fully functional.
No need to choose between order systems. Use them in parallel! When translating MQL4 -> MQL5, there is no need to touch the order system at all .
It is enough to add one line at the beginning:
#include// If there is #include , please add this line after
Similar operations in MQL5 code (adding a line) allow adding MT4 OLS to MT5 OLS, or replacing it completely.
The author created this functionality for himself, therefore, he deliberately did not apply the same "single line" transmission idea to time series, graphical objects, indicators, etc.
This work covers the only order system.
The possibility of creating a complete library to allow MQL4 code to work in MetaTrader 5 task has not been changed and has not been considered.
For example, several different types of MT4/5 Expert Advisors (from the code base) are used: Scalper, News Trading Expert, Martingale, Multi-Currency Expert, etc.
The following (parallelism of MT4 and MT5 OLS) is how to use them in the MT5 tester (or demo):
// MQL4&5 code #Define check start time #Define start MTstart #ifdef __MQL5__ // Select the desired MT5 EA // #include "Lucky.mq5" // https://www.mql5.com/en/code/1107 // #include "Puria.mq5" // https://www.mql5.com/en/code/138 // #include "Ilan_1_6_Dynamic_HT.mq5" // https://www.mql5.com/en/code/12220 // #include "Multik.mq5" // https://www.mql5.com/en/code/158 // #include "VLT_Trader.mq5" // https://www.mql5.com/en/code/1163 // #include "Exp_PFE_Extr.mq5" // https://www.mql5.com/en/code/16044 #endif // __MQL5__ #include// If there is #include , please add this line after #include// Only for this example // Select the desired MT4 EA // #include "Lucky.mq4" // https://www.mql5.com/en/code/7464 // #include "E-news-lucky6.mq4" // https://www.mql5.com/en/code/7672 // #include "cm_ea_news.mq4" // https://www.mql5.com/en/code/10511 // #include "Spreader_v2.mq4" // https://www.mql5.com/en/code/14500 #Includes "Ilan1_4_strict.mq4" // #property strict (MQL5), original - https://www.mql5.com/en/code/8492 #Include "OrdersToString.mqh" #undefcheck Blank check ( blank ) { ::MTstart(); if ( MQLInfo integer ( MQL_VISUAL_MODE )) Comment ( "Trade:" + OrderToString() + "\nHistory:" + OrderToString( Mode_History )); // Returns can be viewed in the tester's visualization mode ; }
If earlier it was possible to test real quotes from MT4 experts in the MetaTrader 4 tester, now the MT5 tester has multi-currency functionality. That is, multi-currency MT4 experts can now test directly in the tester!
Another example is a statistics script collected from multiple MT4 samples:
Attachment download
📎 ilan1_4_strict.mq4 (29.59 KB)
📎 mt4orders_exampleexpert.mq5 (2.41 KB)
📎 orderstostring.mqh (1.65 KB)
📎 mql4_to_mql5.mqh (8.41 KB)
📎 MT4Orders.mqh (220.2 KB)
📎 mt4orders_examplescript.mq5 (1.23 KB)
📎 report_strict.mq4 (20.27 KB)
Source: MQL5 #16006
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •