MT4 Orders
Info
The MT4 Orders is a Library for MetaTrader 5 that this library facilitates working with orders in mql5 (mt5-hedge) using the same approach as in mql4. By employing this library, the order language system (OLS) in MQL5 becomes identical to MQL4, enabling seamless compatibility between the two.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Library works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Libraries folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use MT4 Orders
1. Storage: Place library files in the MQL/Libraries directory to ensure they are accessible to your projects.
2. Implementation: Include the library in your code using the #import directive, ensuring you match the exact function names and parameters.
3. Compilation: Ensure the library is present in the directory before you compile your main EA or script, as the compiler links them during this phase.
4. Management: Keep libraries organized in sub-folders if you manage many custom functions to maintain a clean project structure.
Frequently Asked Questions
Q: What is a library file used for? A: Libraries store reusable code modules, allowing you to centralize common logic used by multiple EAs or indicators.
Q: Is a library executable? A: No, libraries are non-executable files containing functions; they must be imported into an EA, indicator, or script to function.
Q: Can I update a library while the platform is running? A: You should compile your EA or script after updating a library to ensure the latest code changes are integrated.
What this tool does
This library facilitates working with orders in MQL5 (MT5-hedge) using the same approach as in MQL4.
Typical Use Case
This Library excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Library works on MetaTrader 5. Place the file in the MQL5/Libraries folder and restart the terminal.
Description & Settings
Related: close orders - another powerful library for MetaTrader 5 traders.
This library facilitates working with orders in MQL5 (MT5-hedge) using the same approach as in MQL4.By employing this library, the order language system (OLS) in MQL5 becomes identical to MQL4, enabling seamless compatibility between the two.
Also recommended: modify orders - similar library with strong performance on MetaTrader 5.
One of the key advantages is the ability to use both order systems in parallel. The standard MQL5 library continues to function without any interference.
When translating MQL4 to MQL5, there's no need to modify the order system. Simply adding a single line at the beginning of the code is sufficient:
Similarly, by adding a single line to your MQL5 codes, you can either integrate the MT4 OLS with the MT5 OLS or completely replace it.
This library focuses solely on the order system, without addressing the broader challenge of creating a comprehensive library for running MQL4 code in MetaTrader 5 without modifications.
To demonstrate its versatility, various types of MT4/5 expert advisors from the codebase have been utilized, including scalpers, news trading experts, martingales, and multi-currency experts.
Here's how they can be employed in the MT5 tester (or demo):
Previously, testing MT4 experts on real ticks was possible in the MetaTrader 4 tester. Now, the MT5 tester offers multi-currency capabilities, allowing multi-currency MT4 experts to be tested directly in the tester.
An additional example is a statistical script compiled from multiple MT4 samples.
You may also like: mt4 orders quick report - excellent alternative for library users on MetaTrader 5.
Source Code
#define ontick mtstart
#define start mtstart
#ifdef __mql5__
#endif // __mql5__
#include <mt4orders.mqh> // #include <trade/trade.mqh>,
#include <mql4_to_mql5.mqh> //
#include "ilan1_4_strict.mq4" // #property strict (mql5), original - https://www.mql5.com/ru/code/8492
#include "orderstostring.mqh"
#undef ontick
void ontick(void)
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.