What's new in MetaTrader 5

26 October 2018

Terminal

Now you can detach financial symbol charts from the trading terminal window.

This feature is convenient when using multiple monitors. Thus, you
may set the main platform window on one monitor to control your account
state, and move your charts to the second screen to observe the market
situation. To detach a chart from the terminal, disable the Docked
option in its context menu. After that, move the chart to the desired
monitor.

A separate toolbar on detached charts allows applying analytical
objects and indicators without having to switch between monitors. Use
the toolbar context menu to manage the set of available commands or to
hide it.

Fully updated the built-in chats. Now they support group
dialogs and channels. Conduct private discussions with a group of
people in a unified environment without switching between different
dialogs and create channels according to your interests and languages.
Communicate with colleagues and friends at MQL5.community without
visiting the website.

Group chats and channels can be public or private. Their creators
decide whether it is possible to join them freely or only by invitation.
You can also assign moderators to channels and chats for additional
communication control.

Added support for extended volume accuracy for
cryptocurrency trading. Now the minimum possible volume of trading
operations is 0.00000001 lots. The market depth, the time and sales, as
well as other interface elements now feature the ability to display
volumes accurate to 8 decimal places.

The minimal volume and its change step depend on financial instrument settings on the broker's side.

Added the tab of articles published on MQL5.community
to the Toolbox window. Over 600 detailed materials on the development
of trading strategies in MQL5 are now available directly in the
terminal. New articles are published every week.

The work on support for .NET libraries continues. Their features are to be expanded in the future.

Added support for working with WinAPI functions to Standard
Library. Now, there is no need to import libraries manually and describe
function signatures to use operating system functions in an MQL5
program. Simply include the header file from the MQL5\Include\WinAPI
directory.

WinAPI functions are grouped in separate files by their purpose:

libloaderapi.mqh — working with resources

memoryapi.mqh — working with memory

processenv.mqh — working with environment

processthreadsapi.mqh — working with processes

securitybaseapi.mqh — working with OS security system

sysinfoapi.mqh — obtaining system information

winbase.mqh — common functions

windef.mqh — constants, structures and enumerations

wingdi.mqh — working with graphical objects

winnt.mqh — working with exceptions

winreg.mqh — working with the registry

winuser.mqh — working with windows and interface

errhandlingapi.mqh — handling errors

fileapi.mqh — working with files

handleapi.mqh — working with handles

winapi.mqh — including all functions (WinAPI header files)

The binding works only with the 64-bit architecture.

Added support for the inline, __inline and __forceinline
specifiers when parsing code. The presence of the specifiers in the code
causes no errors and does not affect the compilation. At the moment,
this feature simplifies transferring С++ code to MQL5.
Find more information about specifiers in MSDN.

Significantly optimized execution of MQL5 programs. In some
cases, the performance improvement can reach 10%. Recompile your
programs in the new MetaEditor version to make them run faster.

Unfortunately, new programs will not be
compatible with previous terminal versions due to this additional
optimization. Programs compiled in MetaEditor version 1912 and later cannot be launched in terminal versions below 1912.
Programs compiled in earlier MetaEditor versions can run in new
terminals.

Significantly optimized multiple MQL5 functions.

Added new properties for attaching/detaching charts from the terminal main window and managing their position.

TERMINAL_SCREEN_LEFT — the left coordinate of the virtual
screen. A virtual screen is a rectangle that covers all monitors. If the
system has two monitors ordered from right to left, then the left
coordinate of the virtual screen can be on the border of two monitors.

TERMINAL_SCREEN_TOP — the top coordinate of the virtual screen.

TERMINAL_SCREEN_WIDTH — terminal width.

TERMINAL_SCREEN_HEIGHT — terminal height.

TERMINAL_LEFT — the left coordinate of the terminal relative to the virtual screen.

TERMINAL_TOP — the top coordinate of the terminal relative to the virtual screen.

TERMINAL_RIGHT — the right coordinate of the terminal relative to the virtual screen.

TERMINAL_BOTTOM — the bottom coordinate of the terminal relative to the virtual screen.

Added the volume_real field to the MqlTick and MqlBookInfo
structures. It is designed to work with extended accuracy volumes. The
volume_real value has a higher priority than 'volume'. The server will
use this value, if specified.

struct MqlTick
{ datetime time; // Last price update timedouble bid; // Current Bid pricedouble ask; // Current Ask pricedouble last; // Current price of the Last trade ulong volume; // Volume for the current Last pricelong time_msc; // Last price update time in millisecondsuint flags; // Tick flagsdouble volume_real; // Volume for the current Last price with greater accuracy
};

Added the pack( integer_value ) property for structures. It
allows you to set the alignment of the fields arrangement within a
structure, which can be necessary when working with DLL. The values of
1, 2 ,4 ,8 and 16 are possible for integer_value.
If the property is not defined, the default alignment of 1 byte is used — pack(1).

Added the new TesterStop function allowing for early
completion of a test/optimization pass. When calling it, the entire
trading statistics and OnTester result are passed to the client terminal just like during the normal test/optimization completion.

Added the new property for custom indicators #property
tester_everytick_calculate. It is used in the strategy tester and allows
for forced indicator calculation at each tick.

Tester

Now, in case of a non-visual test/optimization, all used
indicators (standard and custom ones) are calculated only during a data
request. The exceptions are indicators containing the EventChartCustom function calls and applying the OnTimer
handler. Previously, all indicators were unconditionally calculated in
the strategy tester at each incoming tick (even from some other
instrument). The new feature significantly accelerates testing and
optimization.

To enable the forced indicator calculation at each tick, add the
#property tester_everytick_calculate property for the program.
Indicators compiled using the previous compiler versions are calculated as before — at each tick.