MetaTrader 5 Platform Beta Build 1910: Unbound drag-and-drop of charts and .Net libraries in MQL5

 

The beta version of the updated MetaTrader 5 platform is to be released on October 14, 2018. We will update our public MetaQuotes-Demo server located at access.metatrader5.com:443. We invite all traders to join testing in order to evaluate the updated platform features and to help developers fix errors.

To update the MetaTrader 5 platform up to build 1910, connect to access.metatrader5.com:443 server.

The final build of the new MetaTrader 5 platform will be released after the public beta test.

The update will feature the following changes:

  1. 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.

  2. Terminal: 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.



  3. Terminal: Added support for increased 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.




  4. Terminal: 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 without the need to leave the terminal. New articles are published weekly.



  5. Terminal: Added support for extended authentication using certificates when working under Wine.
  6. Terminal: Fixed display of the market depth when it is limited to one level.
  7. Terminal: Added the "Save As Picture" command to the Standard toolbar. Now, it is much easier to take pictures of charts and share them in the community.




  8. Terminal: Fixed applying the time shift when importing bars and ticks. Previously, the shift was not applied in some cases.



  9. MQL5: Added native support for .NET libraries with "smart" functions import. Now .NET libraries can be used without writing special wrappers —  MetaEditor does it on its own.

    To work with .NET library functions, simply import DLL itself without defining specific functions. MetaEditor automatically imports all functions it is possible to work with:
    • Simple structures (POD, plain old data)
    • Structures with simple data types
    • Public static functions having parameters, in which only simple types and POD structures or their arrays are used

    To call functions from the library, simply import it:
    #import "TestLib.dll"
    
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
      {
       int x=6;
       TestClass::Inc(x);
       Print(x);
      }
    The C# code of the Inc function of the TestClass looks as follows:
    public class TestClass
    {
       public static void Inc(ref int x)
       {
        x++;
       }
    }
    As a result of execution, the script returns the value of 7.

  10. MQL5: Added support for 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.

  11. MQL5: 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 1910 and later cannot be launched in terminal versions below 1880. Programs compiled in earlier MetaEditor versions can run in new terminals.

  12. MQL5: Significantly optimized multiple MQL5 functions.
  13. MQL5: Added new properties for attaching/detaching charts from the terminal main window and managing their position.

    Added the following properties to the ENUM_CHART_PROPERTY_INTEGER enumeration:

    • CHART_IS_DOCKED — the chart window is docked. If set to 'false', the chart can be dragged outside the terminal area.
    • CHART_FLOAT_LEFT — the left coordinate of the undocked chart window relative to the virtual screen.
    • CHART_FLOAT_TOP — the upper coordinate of the undocked chart window relative to the virtual screen.
    • CHART_FLOAT_RIGHT — the right coordinate of the undocked chart window relative to the virtual screen.
    • CHART_FLOAT_BOTTOM — the bottom coordinate of the undocked chart window relative to the virtual screen.

    Added the following functions to the ENUM_TERMINAL_INFO_INTEGER enumeration:

    • 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.

  14. MQL5: Added volume_real field to the MqlTick and MqlBookInfo structures. It is designed to work with increased 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 time
       double           bid;           // Current Bid price
       double           ask;           // Current Ask price
       double           last;          // Current price of the Last trade
       ulong            volume;        // Volume for the current Last price
       long             time_msc;      // Last price update time in milliseconds
       uint             flags;         // Tick flags
       double           volume_real;   // Volume for the current Last price with greater accuracy
      };

    struct MqlBookInfo
      {
       ENUM_BOOK_TYPE   type;            // order type from the ENUM_BOOK_TYPE enumeration
       double           price;           // price
       long             volume;          // volume
       double           volume_real;     // volume with greater accuracy
      };

  15. MQL5: Added new properties to the ENUM_SYMBOL_INFO_DOUBLE enumeration:

    • SYMBOL_VOLUME_REAL — the volume of the last executed deal;
    • SYMBOL_VOLUMEHIGH_REAL — the highest deal volume for the current day;
    • SYMBOL_VOLUMELOW_REAL — the lowest deal volume for the current day;

    Use the SymbolInfoDouble function to get these properties.

  16. MQL5: Added the MQL_FORWARD property to the ENUM_MQL_INFO_INTEGER enumeration — forward test mode flag.
  17. MQL5: Relaxed requirements for casting enumerations. In case of an implicit casting, the compiler automatically substitutes the value of a correct enumeration and displays a warning.

    For the following code:
    enum Main
      {
       PRICE_CLOSE_,
       PRICE_OPEN_
      };
    
    input Main Inp=PRICE_CLOSE;
    //+------------------------------------------------------------------+
    //| Start function                                                   |
    //+------------------------------------------------------------------+
    void OnStart()
      {
      }
    The compiler displays the warning:
    implicit conversion from 'enum ENUM_APPLIED_PRICE' to 'enum Main'
    'Main::PRICE_OPEN_' instead of 'ENUM_APPLIED_PRICE::PRICE_CLOSE' will be used
    Previously, the following error was generated in that case:
    'PRICE_CLOSE' - cannot convert enum
    The compiler will still display the error if enumerations are used incorrectly in the function parameters.

  18. MQL5: Fixed compilation of template functions. Now, when using overloaded template functions, only the necessary overload, rather than all existing ones, is instantiated.
    class X {  };
    
    void f(int)  {  }
      
    template<typename T>
    void a(T*) { new T(2); }  // previously, the compiler generated the error here
      
    template<typename T>
    void a()  { f(0); }
      
      
    void OnInit()  { a<X>(); }  
    
  19. MQL5: Optimized some cases of accessing tick history via the CopyTicks* function.
  20. Tester: Fixed calculating the deposit currency accuracy when testing/optimizing and generating relevant reports.
  21. Tester: Optimized and accelerated the strategy tester operation.
  22. MetaEditor: Fixed search for entire words. Now when searching, the underscore is counted as a regular character, rather than a word delimiter.
  23. Updated documentation.
 

10. MQL5: Added support for 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.

So that means a function will not be really inlined. Will the inlining be implemented later ?
 

12. MQL5: Significantly optimized multiple MQL5 functions.

Isn't possible to say which functions ?
 

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

Thank you very much!

Is it possible to make detached chart windows stick "always on top" above other programs' windows (not just above MetaTrader 5's windows)?

 

Verry good

Thanks you for your efforts

 
Thank you!
 
9. MQL5: Added native support for .NET libraries with "smart" functions import. Now .NET libraries can be used without writing special wrappers —  MetaEditor does it on its own.

A great one. Thanks to the team.

 

Yes, I like it - 

 

Hi guys,

anybody else having the problem, that indicators called from an EA don't update anymore during testing/optimizing with this new beta build?

OnCalculate simply isn't called anymore, except directly after OnInit. It works, when I put the indicator or the EA directly into the main window, but not when I use the strategy tester.

And yes, I re-compiled each mq5 file.


Thanks for your responses,

Clock

 
Sergey Golubev:

Yes, I like it - 

Let the darkness flow through you.

If timeframes buttons were also included on undocked charts it would be great.

Pinning undocked chart window over other programs' windows works nicely in KDE Linux, in Windows there are some external programs that can do the job, but directly from MetaTrader something like this can be used:

#import "user32.dll"
   int GetParent(long hWnd);
   bool SetWindowPos(long hWnd, long hWndInsertAfter, int x, int y, int width, int height, uint uFlags);
#import

void OnStart()
  {
   long ThisChartID = ChartID();
   long ThisChartHandle, ThisChartParentHandle;
   ChartGetInteger(ThisChartID,CHART_WINDOW_HANDLE,0,ThisChartHandle);
   ThisChartParentHandle=GetParent(ThisChartHandle);

   SetWindowPos(ThisChartParentHandle,-1,32,64,512,512,0);   
  }