MQ L Easy

MQ L Easy
DOWNLOAD all MT4 librarys (97)
YouTube Video Thumbnail

Similar MetaTrader Tools

MQ L Easy

Info

The MQ L Easy is a Library for MetaTrader 4 that github: intro mql_easy is an open source cross platform library for developing mql4 and mql5 applications. The purpose of this library is to make the mql development easy, safe and fast in order to focus more on implementing complex trading ideas.

Usage

This tool is typically used for enhancing chart analysis and decision making.

Platform

This Library works exclusively on MetaTrader 4 (both build 600+ and newer versions).

Setup

Place the downloaded file in MQL4/Libraries folder via File ? Open Data Folder in MetaTrader 4.


How to Install and Use MQ L Easy

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

github: Intro MQL_Easy is an open source cross platform library for developing MQL4 and MQL5 applications.

Typical Use Case

This Library excels in automated trading and technical analysis on MetaTrader 4.

Compatible Platform & Setup

This Library works on MetaTrader 4. Place the file in the MQL4/Libraries folder and restart the terminal.

Description & Settings

Related: Easy Canvas (i Canvas) - another powerful library for MetaTrader 4 traders.

github: Intro
MQL_Easy is an open source cross platform library for developing MQL4 and MQL5 applications. The purpose of this library is to make the mql development easy, safe and fast in order to focus more on implementing complex trading ideas. The cross platform property assure that the same piece of code works on both platforms. In addition, it has implemented some unique features that make the development easier and faster. However, it does not cover the entire application-programming interface of the mql5/4 language. The goal is not to replace the entire MQL standard library which metaquotes has nicely implemented; it just fills the gap between the MQL4 and MQL5 programming and simplify the development of trading applications.

Also recommended: Easy Object - similar library with strong performance on MetaTrader 4.

Advantages:

Cross platform compatibility(same piece of code works on both platforms)

Error handling(all error codes are included with description)

Validation checks(build in validation checks for order management)

Hides complexity and speed up the development

Publishing products on MQL5 market easier and safer.
The library contains the following classes:

CExecute

CPosition

COrder

CHistoryPosition

CHistoryOrder

CUtilities

CError

CPrinter

CValidationCheck
It is important to mention that parts of code are collected from other resources on the internet. The goal is to gather any useful code into a single framework/library. The current documentation does not contain the whole functionality of the MQL_Easy framework/library. It will be updated periodically in the future.Feel free to test, change or customize it to suits your needs better.If you find any issue/bug/improvement let me know.
Getting Started
To start working with the library all you need are 3 steps.

Download the folder MQL _Easy.

Move it to Include folder inside MQL4 and MQL5 directory.

Copy paste the following command to your current MQL project:
(The above line of code includes all the library’s files and make them available
Example:
This example of code is written in MQL4 editor but it runs and works properly on both platforms.
MQL_Easy.mql
The MQL_ Easy.mqh is an include file that contains all the others includes files.It is a quick way to get started without necessary know the names of classes. In addition, if the development requires heavy usage of the MQL_Easy library then you can find them all in one place. When you get familiar with the library, you will be comfortable to include only the needed classes.
Code overview Structure and design
The MQL_Easy library has as many folders as the implemented classes. Each folder contains an include mql file and another folder called “Includes”. In order to use any class, it is just enough to include the mql include file in your project. The “Includes” folder just contains the implementation of a class for each platform. In some cases, the MQL4 and MQL5 platforms shares exactly the same code. However, in many cases the implementation is different, so the “Includes” folder has three files. One with a suffix “base” which implements the shared code and the others two with suffixes “MT4” and “MT5” for the platform dependent code. Therefore, in this way not only the platform dependent code is in separate file but also it can scale more easily with features which one platform supports and the other not.
CExecute class
The CExecute class is responsible for trade execution. There are two kind of trades: Position (Buy,Sell) and Order(BuyLimit,SellLimit,BuyStop and SellStop). One time saver feature for this class is the ENUM_SLTP_TYPE enumeration, which the developer can set the type of the Stoploss and Takeprofit values (price,pips,points,percentage). Therefore, with a single line of code the library take care of converting the ENUM_SLTP_TYPE feature into prices, making validation checks in order to ensure that the request for the trade is a valid one before send it to the broker’s server and executes the trade in both platforms. In case of any error, a user-friendly message is displayed with the error code and details in the Expert’s tab. Besides the printed error info, the CExecute class also fills theses details into its own CError object, which the developer can use it to handle these situations, as he want.
Example:
CPosition and COrder class
The CPosition and COrder classes are responsible to manage the active and pending trades of the account, such as collecting information about a trade or close it. With appropriate configuration, the developer can group trades by symbol, magic number, type or all together in order to manipulate these groups of trades easily. In general, the grouping property of the MQL_Easy library saves a lot of time and give the ability to create complex trading ideas with less effort. Another unique feature that these classes has implemented is the “quick access” of trade. With just a single line of code, the developer can retrieve a property of trade such open price, open time etc.
Examples:
The difference between the “quick access by index” and “quick access by ticket” is the type of variable that is set in the brackets. Integer for indexes and long for tickets.
CHistoryPosition and CHistoryOrder class
The CHistoryPosition and CHistoryOrder are responsible for collecting information about active and pending trades in the past. They have the same features such as grouping and quick access as the CPosition and COrder classes. In addition, they have start date and end date in order to specify a time of period as an extra grouping filter. If you not specify the time of period then it will search the entire history of the account.
Example:
CUtilities class
The CUtilitities class apply some common useful functions, which a trading application may needs.
Example:
CPrinter class
The CPrinter class implements a quick and nice way for custom formatted messages to the terminal. It could be useful for error messages and debugging.
Example:
The above code display in the Expert’s tab:
--------------- ATTENTION ---------------
Action For The User: You need to enable Auto Trading!!!
Steps: Press the Auto Trading Button at the top of the terminal
--------------- ATTENTION ---------------
CError class
The CError class is responsible for handling the errors. By default, it includes all the available error codes and their description. Therefore, the developer can deals with errors faster or alert the user with meaningful information.
Example:
The above code will display:
--------------- ERROR ---------------
Message : An Error occured!!!
Error(4301) : Unknown symbol
--------------- ERROR ---------------
CValidationCheck class
The CValidationCheck class implements useful functions for order’s checks and validations. Before a request for a trade send to the server, it is important to pass some checks. Most of them are well known, that is why the CExecute class use them by default. Therefore, it is quite useful to able to use this class in any case it is needed.
Example:
Final thoughts
The power of any library/framework is not only when it delivers its duties properly but also when it builds a community around it.The community should lead the MQL_Easy framework as any other open source project. Feel free to contribute in any levels(github: ).

You may also like: Easy to use Hedging Class - excellent alternative for library users on MetaTrader 4.

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.
RobotFX does not own any of the code provided on this platform. All tools are freely available on the internet; we simply index and re-offer them for download. We are not responsible for any financial losses that may occur. Trading responsibilities rely solely on the traders downloading and using the displayed Expert Advisors, indicators, and scripts. These tools are provided for educational purposes only and may require modification or optimization to align with a trader's specific strategy or needs.
© ROBOTFX - Best MetaTrader Expert Advisors & Indicators