Take Profit based on current profit – library for 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

Log4mql – library for 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”);

MiniVirtualAccount – library for 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 = “—————“;

Capture MouseEvents on Chart – library for 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

ZI_File_Functions_Full_Lib – library for 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

GetPaneHeights – library for 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

WinSock – library for MetaTrader 4

WinSock - library for MetaTrader 4
WinSock is a windows network interface that descented from TCP/IP Berkley Sockets, and is the default network interface for TCP/IP. The sockets lie on the session layer (OSI/5). The attached code is an operational example of windows sockets and the included library, although easily expandable, is in a basic form and not a full winsock implemenation. The advantage of the library and code presented is that it’s written completely in mql4 without any use of external dll helper. The WinSock.mqh is the library and should be placed in your include folder The wsockserv.mq4 is a winsock echo server blocking mode example that should be put in