Smooth Algorithms – Corrected/Modified – library MetaTrader 5

SmoothAlgorithms.mqh logo
Original code and description here:https://www.mql5.com/en/code/17472 Modifications: Corrected errors that prevent compiling indicators that won’t due to errors in the <SmoothAlgorithms.mqh> file. I’ve also changed “int period” to “double period” in a lot of places so you can now use decimal periods on your custom indicators. This feature works, I’ve checked. Smooth Algorithms – Corrected/Modified – … Read more

xoshiro256 Random Number Generator – library MetaTrader 5

xoshiro256 Random Number Generator - library for MetaTrader 5
Xoshiro256** Random Number Generator xoshiro256** (named after its operations: XOR, shift, rotate) is a pseudorandom number generator designed by Sebastiano Vigna in collaboration with David Blackman https://prng.di.unimi.it/ This is a 64-bit all-purpose, rock-solid generator. It has excellent (sub-ns) speed, a state size (256 bits) that is large enough for any parallel application, and it passes all … Read more

Benchmark – library MetaTrader 5

Benchmark - library for MetaTrader 5
The include file “Benchmark.mqh” has a set of macros to benchmark various functions for their execution speeds to decide which is the fastest one. //+——————————————————————+ //| Macro to measure the execution time a function.                  | //| Prints the elapsed time in microseconds per call (µsec/call).    | //| TimeIt(sum += ArrayBsearch(arr, value));                         | //+——————————————————————+ #define TimeIt(func_invocation) //+——————————————————————+ //| Macro … Read more

Check if there are any new bar – library MetaTrader 5

Check if there are any new bar - library for MetaTrader 5
1、There is only one class function without additional variables. Please declare class CCheck before use class CCheck   { public:    bool              isNewBar(const string symbol,const ENUM_TIMEFRAMES period);      }; 2、Program variables are used to store corresponding data, while historical bar variables need to be statically modified for data storage //— Static variables used to save history bar … Read more

Dealing with time (2) functions – library MetaTrader 5

Dealing with time (2) functions - library for MetaTrader 5
The version of DealingWithTime.mqh v. 1.01 of the article “Dealing with Time (Part 2): The Functions” (https://www.mql5.com/en/articles/9929) did not work any more because MQ changed the behavior of the CopyTime() function some time after this article was published. Now this function no longer returns future time values if they are greater than TimeCurrent() specified for … Read more

PNG – library MetaTrader 5

PNG - library for MetaTrader 5
This library allows you to comfortably work with PNG graphic files, as well as scale them. There are two ways to upload PNG images: via file via a resource that is inside your ex5 file Working with PNG images via resource: // Constructor // CPng(const uchar &bin_data[], bool create_canvas = false, int x = 0, … Read more

Grid, MartinGale include File – library MetaTrader 5

Grid, MartinGale include File - library for MetaTrader 5
This include file provides programmers with a seamless solution for creating Martin Gale trading strategies effortlessly. The classes GridStrategy and MartinGaleStrategy are derived from the Strategy class, which encompasses various attributes such as Startprice, Lots(Volume available for the strategy), TakeProfit, Stoploss (in monetary terms), and more. While Grid and Martin Gale strategies possess their own … Read more

Reporting Memory Leaks in Strategy Tester – library MetaTrader 5

Reporting Memory Leaks in Strategy Tester - library for MetaTrader 5
The strategy tester does not report any memory leaks of MQL5 applications like expert advisors, scripts or indicators. And such memory leaks can occur by using the  new operator in your MQL5 code and forgetting to free the occupied memory later in your code by calling the  delete  operator. For example in complex programs with … Read more

Signals and Probability class – library MetaTrader 5

Signals and Probability class - library for MetaTrader 5
The provided code is an MQL include file and an Expert Advisor demonstrating how the classes work.It implements a trading strategy based on various technical indicators and trend analysis. The script defines several custom classes to create and manage trading signals based on different technical conditions. Trend Class : This class is responsible for determining the … Read more