How to Start with Metatrader 5 - page 135

 

Hello!

Apologies if not being on the right thread, i have one question...  for starting in MQL4 coding...which is closer and better to learn...python or C++ ??

 
Daniel cioca:

Hello!

Apologies if not being on the right thread, i have one question...  for starting in MQL4 coding...which is closer and better to learn...python or C++ ??

MQL5-

MQL5 + Python-

 
Thanks I am so comfortable with mql5.com
 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 platform beta build 3060: Improvements in MQL5 services and design updates

MetaQuotes, 2021.09.24 16:48

The beta version of the updated MetaTrader 5 platform will be released on Friday, September the 24th, 2021. We invite traders to join the testing of the new version, to evaluate all its features and to help developers fix errors.

To update the MetaTrader 5 platform up to build 3060, navigate to Help \ Check Desktop Updates \ Latest Beta Version:

Update to beta and join testing


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

The new version features the following changes:

MetaTrader 5 Client Terminal build 3060

  1. Terminal: Improved navigation in MQL5.community services.

    Market, Signals and VPS sections have been moved from the main platform workspace to the Navigator. The new positioning provides easy access to the desired products and enables efficient management of purchases and subscriptions. "How it works" sections have been added to each service, to provide the basic usage information.


    Improved navigation through MQL5.community services


  2. Terminal: All menu and toolbar icons have been completely redesigned. The terminal interface has become more user-friendly:

    • Removed small elements from icons
    • Reduced the number of used colors to avoid color noise
    • Fewer gradients are used to improve readability
    • More straightforward metaphors are used


    All menus, toolbars and dialogs have been redesigned in the platform


  3. Terminal: Added the display of costs resulting from deal execution. The relevant information is shown in the trading history. This feature is used by NFA regulated brokers.


    The account history now shows deal costs>


    If your broker enables cost calculation on the server, the new Costs column will appear in your account trading history. The column shows the deal execution cost relative to the current mid-point price of the symbol (mid-point spread cost).

  4. Terminal: Launched Korean version of MQL5.com.

    This is the eighth language available at MQL5.community, the largest community of algorithmic traders. The website interface, articles, the Economic Calendar and important forum topics are already available in Korean. MQL5 documentation will be translated soon.

  5. Terminal: Fixed loading of custom trading instruments. In some cases, newly created symbol settings could overwrite existing symbol settings.
  6. Terminal: Fixed the on-chart display of the signal trading history. Previously, the relevant option enabled the display of all trades for all financial instruments, and not only for the chart symbols.
  7. Terminal: Added export of the Fee column to the trading history report. Previously the value was only displayed in the history, but it could not be saved to a file.
  8. Terminal: Optimized and accelerated operation of one-click trading panels in Market Watch and on charts.
  9. Terminal: Fixed operation of the Margin Ratios field for custom trading instruments. The values could be reset to zero under certain conditions.
  10. Terminal: We continue implementing the Subscriptions service through which traders can purchase additional trading services from brokers. Fixed errors in the quotes subscription window.
  11. Terminal: Fixed display of the Trend Line analytical object. Previously the line could disappear upon scaling or upon chart window resizing.
  12. Terminal: Fixed display of the Rectangle analytical object. The object could disappear if one of the anchor points was beyond the chart visibility area.
  13. Terminal: Fixes and operation speed improvements related to operation of built-in MQL5.community charts.
  14. Terminal: Fixed rounding of the Value parameter in the list of open positions. The fractional part could be hidden in previous versions.
  15. Terminal: Fixed mobile phone verification during the account opening process. Phone numbers could be identified as incorrect for some Chinese operators.
  16. Terminal: Added support for MQL5 account passwords longer than 32 characters.
  17. Terminal: Fixed export of certificates when working in Wine. This option is used for accounts with extended authentication, when migrating such accounts from desktop to mobile.
  18. Terminal: Fixed buttons opening MQL5 services in the lower panel of the Toolbox window. The buttons were inactive when the window was undocked.
  19. MQL5: We continue adding vector and matrix support. The new functions will significantly expand the possibilities for neural network-based solution developers.
  20. MQL5: Added DEAL_SL and DEAL_TP values in the ENUM_DEAL_PROPERTY_DOUBLE enumeration — the Stop Loss and Take Profit levels of a deal.

    The relevant values for entry and reversal deals are set in accordance with the Stop Loss/Take Profit of orders, which initiated these deals. The Stop Loss/Take Profit values ​​of appropriate positions as of the time of position closure are used for exit deals.

  21. MQL5: Added the MQL_HANDLES_USED value in the ENUM_MQL_INFO_INTEGER enumeration — the number of active class objects (handles) in an MQL program. These include both dynamic (created via new) and non-dynamic objects, global/local variables or class members. The more handles a program uses, the more resources it consumes.

  22. MQL5: Added new methods for working with the MqlCalendarValue structure which describes an economic calendar event:

    • HasActualValue(void) — returns true if the actual value is set; otherwise returns false
    • HasForecastValue(void) — returns true if the forecast value is set; otherwise returns false
    • HasPreviousValue(void) — returns true if the previous value is set; otherwise returns false
    • HasRevisedValue(void) — returns true if the revised value is set; otherwise returns false
    • GetActualValue(void) — returns the actual value of an event (double) or nan if the relevant value is not set
    • GetForecastValue(void) — returns the forecast value of an event (double) or nan if the relevant value is not set
    • GetPreviousValue(void) — returns the previous value of an event (double) or nan if the relevant value is not set
    • GetRevisedValue(void) — returns the revised value of an event (double) or nan if the relevant value is not set

  23. MQL5: Fixed debugging of the MQL5 programs which use libraries in the form of EX5 files.
  24. MQL5: Accelerated compilation of programs containing large arrays initialized by a sequence.
  25. MQL5: Fixed execution of the CopyTicksRange function with custom trading symbol data. The function could return data out of the requested period.
  26. Signals: Added capability to automatically renew Signal subscriptions.

    Your subscription will not end abruptly, as the system will automatically renew it for another month through the payment method that you previously used for the initial subscription purchase.


    Enable auto renewal for your Signal subscription


    If you made your previous payment using a card and the renewal payment fails, the system will try to make a payment from your MQL5 account balance.

    Do not worry about changes in subscription prices. If the price grows, auto-renewal will be canceled. You will receive a relevant notification by email.

    You can enable or disable the auto renewal option at any moment via the My Subscriptions section at MQL5.com.


    Manage auto renewals from the My Subscriptions section at MQL5.com


  27. Signals: Fixed display of the Signals showcase. Now the system correctly identifies the compatibility of signals with the current account.
  28. Market: Added product search by the author's name and login in the Market showcase. Previously, the service only supported search by product name and description.
  29. VPS: Improved the auto subscription renewal option.

    Previously, the payment for the renewal could only be made from the MQL5 account balance. The user had to make sure the relevant amount is available on their account.

    Now there is no need to top up the MQL5 account. The system will renew the subscription using the same payment method which you used for the initial subscription. If you paid for the VPS with a card and enabled the auto renewal option, the system will use the same payment method for the new subscription period. If the payment fails, the system will try to make a payment from your MQL5 account balance.


    Use cards and other payment methods for auto renewal


    With the new option, you can be sure that your Expert Advisors and signal subscriptions will not stop due to the end of the VPS period. Furthermore, there is no need to check and top up your balance manually.
    The option will only be used for new subscriptions. Payments for the renewal of existing subscriptions will be made from the MQL5 account balance.
  30. Tester: Fixed visual testing errors. Under certain conditions, charts could fail to display indicators used in Expert Advisors.
  31. MetaEditor: Fixed jumping to the function or variable declaration using Alt+G. The action could fail if the declaration was below the call line.
  32. MetaEditor: Added display of the object type for references to class objects in the debugger.
  33. Fixed errors reported in crash logs.

MetaTrader 5 iPhone/iPad, MetaTrader 5 Android

  1. Added display of a disclaimer during application start. Please read it carefully. Additionally, some brokers can automatically create a demo account during the first start of the application. In this case, you will see the relevant terms.


    Disclaimers added in MetaTrader 5 for iPhone/iPad

  2. Added capability to connect an account to monitoring in the Signals service directly from the mobile application. This can be done by selecting "Account Monitoring" from the menu. For convenience, the account number and the broker name are automatically added to the registration window. You should additionally specify the signal name and an investor password.

    Connect your account to the monitoring to access advanced trading statistics, to share the results with other traders or to start selling your signals.

  3. Added support for Huawei AppGallery and HMS Services for mobile terminals running on Android OS. Huawei smartphone owners can install the app from the relevant store and use push notifications.

The update will be available through the Live Update system.


 

Hey everyone I have seen that a lot of hosting companies suggest to use MT4 for forex trading like this: 

<...>

 but there is also the MT5 version. Can anyone tell me if it is good to switch to MT5?

 
neli-89 #:

Hey everyone I have seen that a lot of hosting companies suggest to use MT4 for forex trading like this: 

<...>

 but there is also the MT5 version. Can anyone tell me if it is good to switch to MT5?

MT4 vs MT5 

MQL5 vs QLUA - Why trading operations in MQL5 are up to 28 times faster? - the article  

The Video from MQ: demonstration of the calculations on the GPU in MQL5 code and the graphics capabilities of the terminal 

MQL5 speed test (compare with MQL4 and C++)
https://www.mql5.com/ru/forum/217992#comment_5943518 (in Russian)

----------------

How to Start with Metatrader 5
How to Start with Metatrader 5
  • 2016.10.17
  • www.mql5.com
I decided to create this thread to help to myself and to the others to start with Metatrader 5...
 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 platform build 3210: Revised Sharpe Ratio calculation algorithm, new matrix methods and control over indicator minimum/maximum values

MetaQuotes, 2022.02.10 16:30

The MetaTrader 5 platform update will be released on Friday, February the 11th, 2022.

The update provides the revised Sharpe Ratio calculation algorithm based on a traditional formula, new matrix methods, optimized memory consumption, and improved network system operation for better data transfer.

We have also added two new properties, INDICATOR_FIXED_MINIMUM and INDICATOR_FIXED_MAXIMUM, in the ENUM_CUSTOMIND_PROPERTY_INTEGER enumeration, which fix/unfix minimum and maximum indicator values using the IndicatorSetDouble function.


In addition, we have fixed some errors in the Math\Stat\Math.mqh mathematical library and corrected the operation of the CopyTicks and CopyTicksRange functions, which could return outdated data when crossing over midnight.

These changes, along with other new features of the updated MetaTrader 5 platform version, are described in detail below:


  1. MQL5: Added Min, Max, ArgMin, ArgMax and Sum functions for vectors and matrices. Use the functions to find the minimum and the maximum values, relevant indexes and the sum.
  2. MQL5: Added support for Flat methods for the matrix. With these methods, a matrix element can be addressed through one index instead of two.
    double matrix::Flat(ulong index) const;      // getter
    void matrix::Flat(ulong index,double value); // setter

    Pseudocode for calculating the address of a matrix element:

    ulong row=index / mat.Cols();
    ulong col=index % mat.Cols();
    
    mat[row,col]

    For example, for 'matrix mat(3,3)', access to elements can be written as follows:

      reading: 'x=mat.Flat(4)', which is equivalent to 'x=mat[1][1]'
      writing: 'mat.Flat(5, 42)', equivalent to 'mat[1][2]=42'

    If the function is called with an invalid matrix index, the OutOfRange critical execution error will be thrown.

  3. MQL5: Improved formatting of floating-point numbers in MQL5-program input parameters. When reading some real numbers, numbers with many zeros were substituted into the input parameters, for example, 0.4 was represented as 0.400000000002.
  4. MQL5: Fixed errors in the Math\Stat\Math.mqh math library. The MathSample function from this library has been revised to match the traditional behavior of similar math libraries when sampling with backtracking.
  5. MQL5: Fixed CopyTicks/CopyTicksRange error which could cause the return of outdated data when crossing over the midnight, when no ticks are provided for the financial instrument.
  6. MQL5: Added new INDICATOR_FIXED_MINIMUM and INDICATOR_FIXED_MAXIMUM values into the ENUM_CUSTOMIND_PROPERTY_INTEGER enumeration.
    Using these properties, you can fix or unfix the minimum and maximum indicator values using the IndicatorSetInteger function. When calling IndicatorSetInteger(INDICATOR_FIXED_MINIMUM/INDICATOR_FIXED_MAXIMUM, true), the current minimum or maximum value is used.





  7. Tester: Revised Sharpe Ratio calculation algorithm to match the traditional formula, in which the value corresponds to a one-year interval. The previous algorithm was based on the variability of obtained PnL and it ignored equity fluctuations against open positions. Now the calculation includes equity movements, while the Sharpe ratio is interpreted in a classical way:
    • Sharpe Ratio < 0              The strategy is unprofitable and is not suitable. Bad.
    • 0 < Sharpe Ratio  < 1.0    The risk does not pay off. Such strategies can be considered when there are no alternatives. Indefinite.
    • Sharpe Ratio ≥ 1.0          If the Sharpe ration is greater than one. This can mean that the risk pays off and that the portfolio/strategy can show results. Good.
    • Sharpe Ratio ≥ 3.0          A high value indicates that the probability of obtaining a loss in each particular deal is very low. Very good.

  8. Terminal: Optimized memory consumption by the terminal.
  9. Terminal: Improved platform operation with a network subsystem to enhance performance and to reduce network delays.
  10. Terminal: Removed the display of the zero grid level in indicators when grid rendering is disabled.


The update will be available through the Live Update system.


 
Matrices and vectors in MQL5
Collections of ordered data, wherein all elements have the same type, are usually operated through Arrays, in which each element can be accessed by its index. Arrays are widely used in solving various linear algebra problems, in mathematical modeling tasks, in machine learning, etc. In general terms, the solution of such problems is based on mathematical operations using matrices and vectors, with which very complex transformations can be compactly written in the form of simple formulas. Programming of such operations requires good knowledge in mathematics along with the ability to write complex nested loops. Debugging and bug fixing in such programs can be quite challenging. 

By using special data types 'matrix' and 'vector', it is possible to create the code which is very close to mathematical notation while avoiding the need to create nested loops or to mind correct indexing of arrays in calculations. In this article, we will see how to create, initialize, and use matrix and vector objects in MQL5.