Easy to use Hedging Class for MQL4 by Peter Mueller – library MetaTrader 4 – library MetaTrader 4

Easy to use Hedging Class for MQL4 by Peter Mueller - library for MetaTrader 4 - library for MetaTrader 4
Input Parameters: OrderDistancePoints : Determines the distance in points from the current ask price for placing buy orders and from the bid price for placing sell orders. TPPoints : Specifies the take profit target in points. Startlotsize : Sets the initial lot size for trades. Gainperlot : Defines the desired gain per lot size. The … Read more

Take Profit based on current profit – library MetaTrader 4

Minimum Profit
Introduction Many Expert Advisors (EAs) tend to close orders at the take profit level, considering the pip distance from the purchase price. However, the code used by EA NextBot is based mainly on the current profit . This approach allows you to easily manage the take profit with multiple open positions, monitoring the total current profit based … Read more

Log4mql – library MetaTrader 4

Log4mql
Log4mql is an MQL4 (MetaQuotes MetaTrader 4 Language) library for flexible logging to files and the terminal console. It is modeled after the Log4j Java library. Documentation (GitHub):  Usage in your Code: CLog4mql::getInstance().error(__FILE__, __LINE__, “Something unexpected happen”); or (for more frequent usage) CLog4mql* logger = CLog4mql::getInstance(); logger.error(__FILE__, __LINE__, “Something unexpected happen”); logger.info(__FILE__, __LINE__, “Calcumation done”); … Read more

MiniVirtualAccount – library MetaTrader 4

MiniVirtualAccount - library for MetaTrader 4
Author: Russell At times one wants to see how an EA is performing without the clutter from other EA’s you’re running. MiniVirtualAccount (MVA) monitors data in your EA. Like EA Balance, EA equity, EA profit, etc. Full List: MVA_BALANCE MVA_PROFIT MVA_MARGIN MVA_FREEMARGIN MVA_EQUITY MVA_TOTAL_SELL MVA_TOTAL_BUY MVA_LOT_PROFIT Example code: #include <MVA_v1.0.3.mqh> extern string General = “—————“; … Read more

Capture MouseEvents on Chart – library MetaTrader 4

Capture MouseEvents on Chart - library for MetaTrader 4
Author: Russell The some functions in the cfunctions.dll ( attached ) are wrappers for two user32.dll functions. With those in combination with the extension of WinUser32.mqh will enable you to read the mouseevents on the chart. After which it becomes easy the attach some action to it. In the example I created a button on … Read more

ZI_File_Functions_Full_Lib – library MetaTrader 4

ZI_File_Functions_Full_Lib - library for MetaTrader 4
Author: These libraries were created in a close co-operation with Ilnur. Without his knowledge of WinAPI they would not appear soon. The package contains: 1. Four libraries. 2. One header file for all libraries. 3. Header file of the functions of the “kernel32.dll” system library. 4. The archive with everything listed above arranged by the … Read more

GetPaneHeights – library MetaTrader 4

GetPaneHeights - library for MetaTrader 4
This function calculates the height in pixel of each pane in a window. FOR WHAT: With the use of the built-in functions “WindowPriceMin/Max()” together, you can calculate appropriate spacing/margin to text/arrow objects (OBJ_TEXT/OBJ_ARROW), whatever size the window is. See the EXAMPLE section below. SYNOPSIS: #import “GetPaneHeights.ex4” int GetPaneHeights(int &height[]);#import height[i] = the height in pixel … Read more