Trailing Stop Management Function – script MetaTrader 5

Trailing Stop Management Function - script for MetaTrader 5
//+——————————————————————+ //|                                       TrailingStopManagement.mq5 | //|                                  Copyright 2023, MetaQuotes Ltd. | //|                                             | //+——————————————————————+ #property copyright “Copyright 2023, MetaQuotes Ltd.” #property link      “” #property version   “1.00” #define _MagicNum  NULL//set magic number input int    Stoplose      =992;// set stoplose value input int    TrailingStop  =986;// set TrailingStop value //+——————————————————————+ //| Script program start function                                    | //+——————————————————————+ void OnStart()   { //—    Management();   } //+——————————————————————+ //+——————————————————————+ //| Management … Read more

Creating fractals in MQL5 using the Iterated Function Systems (IFS) – EA MetaTrader 5

Introduction There are many programs, allowing the creation of self-similar sets, defined by Iterated Function System (IFS). See, for example, Fractint, Fractal Designer or IFS Matlab Generator. Thanks to the speed of MQL5 language and possibility of working with graphic objects, these beautiful sets can be studied in MetaTrader 5 client terminal. The cIntBMP library, … Read more

TimeSeries – Function Library for Working with Time Series – library MetaTrader 5

TimeSeries - Function Library for Working with Time Series - library for MetaTrader 5
Function Library for Working with Time Series The following equivalents of MQL4 functions are available: iTime, iOpen, iHigh, iLow, iClose, iHighest, iLowest and iBarshift. Short invocation version is available for all functions (with the current chart’s symbol and period). iHighest and iLowest are available in 2 versions: “from bar X to bar Y” and “from … Read more

CheckHistory – Check and load history function – library MetaTrader 5

CheckHistory - Check and load history function - library for MetaTrader 5
Function to check and load history: This is slightly modified CheckLoadHistory function from MetaQuotes. Title: #include <komposter\String.mqh> Usage: void OnTick() {    static bool first = true;    if ( first && !CheckLoadHistory( _Symbol, _Period, BarsToAnalyze ) )       return;    else       first = false;    // add your code here } The history of changes: … Read more

The function of program operation by time – library MetaTrader 4

The function of program operation by time - library for MetaTrader 4
The function allows the execution of the specific code in the specified time interval. It is generally used in the expert advisors to set the time interval, in which the EA is allowed to trade. There are three time intervals. The time can be entered in the convenient format of 8:40, which allows to specify … Read more

Function library for maintaining positions with a simple trailing stop – library MetaTrader 4

Function library for maintaining positions with a simple trailing stop - library for MetaTrader 4
With the help of this library it is possible to implement the ability to maintain positions with a simple trailing stop in any Expert Advisor. This library is universal and is designed to be able to connect to virtually any EA using the #include compiler directive and granting the EA the ability to maintain positions … Read more

Function library and Experts for trailing / Yury Dzyuban – library MetaTrader 4

Function library and Experts for trailing / Yury Dzyuban - library for MetaTrader 4
The algorithm for maintaining and closing a position is known to be almost more important that the rules for opening it. And sometimes a change in the trailing system can cause quite drastic changes in trading performance – either the increase or decrease of the latter. This is a library of functions for maintaining open … Read more

Example of plotting a function spectrum using the FFT library – indicator MetaTrader 4

Example of plotting a function spectrum using the FFT library - indicator for MetaTrader 4
Description: Example of plotting a function spectrum using the FFT library A test function based on the sum of 3 sinusoids with different parameters or market Close prices are set as input. Example of plotting a function spectrum using the FFT library – indicator MetaTrader 4

Trading signals function. – library MetaTrader 4

Trading signals function. - library for MetaTrader 4
The trading signals function is based on the values of the OsMA indicator. Add the function to the EA: #include <Signal.mqh> Condition if(GetSignal()==1) is for buys Condition if(GetSignal()==-1) is for sells Test Example: Symbol EURUSD (Euro vs US Dollar) Period 1 Minute (M1) 2009.01.19 00:00 – 2009.01.23 23:59 (2009.01.19 – 2009.01.24) Model Every tick (the … Read more