StopOutPrice – script MetaTrader 5

StopOut price calculation
The script calculates Stop Out price (at this price position will be closed by broker) of the opened position and the price, at which Free Margin became negative (LockOut price). Generallty, position volume can be specified in the EnterVolume input parameter: EnterVolume=0 (by default) – use volume and direction of current position; EnterVolume>0 – perform … Read more

OpenCL Test – script MetaTrader 5

Mandelbrot set in MQL5, generated using OpenCL
Starting from build 581, the native support of the OpenCL interface has been added for using GPU capacities. Here is a small working example of the Mandelbrot fractal calculation in OpenCL. The OpenCL accelerates calculations of fractal approximately up to 100 times in comparison with the CPU calculations. OpenCL Test – script MetaTrader 5

sSortTest – script MetaTrader 5

Fig. 1. Sort algorithms performance
The script contains several sorting methods for sorting of double[] array: Bubble sort; Selection sort; Insertion sort; Shell sort; Hoar sort; sorting using ArrayMinimum() and ArrayMaximum() functions. There are 2 functions – ascending (Up) and descending (Dn) sort: SortBubbleUp(double & aAr[]); SortBubbleDn(double & aAr[]); SortSelectUp(double & aAr[]); SortSelectDn(double & aAr[]); SortInsertUp(double & aAr[]); SortInsertDn(double & … Read more