How to Start with Metatrader 5 - page 122

 

Using MATLAB 2018 computational capabilities in MetaTrader 5

Using MATLAB 2018 computational capabilities in MetaTrader 5


This article is a development of the article "Interaction between MetaTrader 4 and MATLAB" by A. Emelyanov, and it provides information on solving a similar task for modern 64-bit versions of all platforms utilized by users. Over the past period, the method for creating shared DLL libraries has been substantially upgraded in the MATLAB package. Therefore, the method discussed in the original article requires modification. This happened because MATLAB Compiler SDK or MATLAB Coder must now be used instead of MATLAB Compiler. In addition, the practice of working with dynamic memory in MATLAB has changed, which implies certain adjustments of the source code that addresses a library written in the MATLAB language.

 

Developing a cross-platform grider EA 

Developing a cross-platform grider EA

Most frequent users of this website know pretty well that MQL5 is the best option for developing custom EAs. Unfortunately, not all brokers allow creating accounts available in MetaTrader 5. Even if you currently work with a broker that allows that, you may switch to a broker offering only MetaTrader 4 in the future. What are you going to do with all the MQL5 EAs you have developed in that case? Are you going to spend a huge amount of time to rework them to fit into MQL4? Perhaps, it would be more reasonable to develop an EA able to work both in MetaTrader 5 and MetaTrader 4?

In this article, we will try to develop such an EA and check if a trading system based on an order grid is usable.

 

How to visualize multicurrency trading history based on HTML and CSV reports 

How to visualize multicurrency trading history based on HTML and CSV reports

Since its introduction, MetaTrader 5 provides multicurrency testing options. This possibility is often used by traders. However the function is not universal. In particular, after running a test, the user can open a chart with performed trading operations. But this is only a chart of one traded symbol selected in the strategy tester settings. The entire trading history of all used symbols cannot be viewed after testing, while visual examination is not always efficient. Additional analysis may be required after some time after testing. Also, a report can be provided by another person. Therefore, a tool for visualizing trading on multiple working symbols based on the HTML testing report would be very useful.

How to visualize multicurrency trading history based on HTML and CSV reports

How to visualize multicurrency trading history based on HTML and CSV reports

The previous article provided a description of the HTML parser based on CSS selectors[1]. The parser extracts the list of deals from the HTML report, based on which we can trades can be formed (graphical objects). Parsing of CSV files from the Signals section is a bit easier, while the file format for the MetaTrader 4 (*.history.csv) and MetaTrader 5 (*.positions.csv) signals is supported by the built-in MQL functions.

 
Where Do I start from?
https://www.mql5.com/en/forum/212020 
Where Do I start from?
Where Do I start from?
  • 2017.07.25
  • www.mql5.com
Hi fam! Am a total newbie in the forex niche... Just signed up here on this platform... Please where do i start from? I need help...
 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 platform build 2085: Integration with Python and Strategy Tester improvements

MetaQuotes Software Corp., 2019.06.11 17:36

The updated version of the MetaTrader 5 platform will be released on Thursday, June 13, 2019. The new version contains the following changes:


  1. Terminal: Added new API which enables request of MetaTrader 5 terminal data through applications using Python language.

    Python is a modern high-level programming language for developing scripts and applications. It contains multiple libraries for machine learning, process automation, as well as data analysis and visualization.

    MetaTrader package for Python is designed for efficient and fast obtaining of exchange data via interprocessor communication, directly from the MetaTrader 5 terminal. The data received via this pathway can be further used for statistical calculations and machine learning.



    Connection

    1. Download the latest Python version at https://www.python.org/downloads/windows
    2. During Python installation, check "Add Python X.X to PATH%" to enable the launch of Python scripts from the command line.
    3. Install the MetaTrader 5 module from the command line
      pip install MetaTrader5
    4. Add matplotlib and pytz packages
      pip install matplotlib
      pip install pytz

    Functions

    • MT5Initialize establishes connection with the MetaTrader 5 terminal
    • MT5Shutdown closes the previously established connection to the MetaTrader 5 terminal
    • MT5TerminalInfo receives status and parameters of the connected MetaTrader 5 terminal
    • MT5Version returns the MetaTrader 5 terminal version
    • MT5WaitForTerminal waits till the MetaTrader 5 terminal connects to the trade server
    • MT5CopyRatesFrom receives bars from the MetaTrader 5 terminal starting from the specified date
    • MT5CopyRatesFromPos receives bars from the MetaTrader 5 terminal starting from the specified index
    • MT5CopyRatesRange receives bars in the specified date range from the MetaTrader 5 terminal
    • MT5CopyTicksFrom receives ticks from the MetaTrader 5 terminal starting from the specified date
    • MT5CopyTicksRange receives ticks for the specified date range from the MetaTrader 5 terminal


  2. Terminal: The Market and Signal sections have been optimized. Now the product and signal showcases run up to seven times faster and thus provide a better service browsing experience.




  3. Terminal: Added support for "Market", "Signals" and "Search" in Wine. Linux and Mac OS users can now access the largest store of trading applications along with the copy trading service.




  4. Terminal: The built-in learning program has been translated into more than 30 languages, including Spanish, Chinese, Portuguese and German, among others. To view interactive tips in the desired language, switch to the required interface language using the View menu.




  5. Terminal: New options enable verification of phone numbers and emails, which are specified by traders when opening demo and preliminary accounts.

    The need for data verification is determined by the broker. If the option is enabled, confirmation codes are automatically sent to the trader during an account request and special code fields appear in the dialog box:




    Confirmation codes are valid for several minutes. If the code is not entered in the field within this time frame, the trader will need to repeat the procedure.
    Before sending codes, the system checks whether the specified phone/email was previously confirmed. If the trader has already passed verification from his or her computer, an account will be opened without additional confirmation. Thus, there will be no additional burden for traders during an account request.

  6. Terminal: MQL5.community payment options through the PayPal system have been expanded. Purchases can now be performed with one click, using this system.

    How it works
    After you log in using your PayPal account when making a purchase, you will be requested to allow further payments to our company:





    By confirming this option, and you will be able to perform further purchases with one click, by pressing the previously saved account button:




    If you click "Cancel and return to MetaQuotes Software Corp.", you will make the payments in a normal way, by entering the PayPal account details manually, for each purchase.
    The MQL5.com website and the MetaTrader 5 platform do not store your payment details. When you deposit funds, make a purchase in the Market service or subscribe to a Signal, the data verification is performed on the payment system side.
    You can always remove your PayPal account link.

  7. Tester: Strategy Tester improvements and optimization.

    We have introduced a large number of hidden improvements and fixed errors to optimize the Strategy Tester operation. The update enables much faster testing for some of the task types and higher operation stability. Major improvements include:

    Operations with frames
    Operations with frames on local, network and cloud agents have been optimized. Such operations are now processed faster and are never skipped.

    Distribution of tasks to agents
    The tester can now redistribute tasks to agents during the optimization process. If a new agent has become available (or one of the previously used ones has been released), the tester automatically creates a new package of tasks, using those which were earlier distributed among other agents. Tasks can also be redistributed if slow agents are detected. Tasks of such agents are sent to other agents to complete the optimization faster.

    Task distribution in math calculation mode has become much faster.

    Optimization statistics in the Journal
    Optimization logging has been extended: it includes detailed statistics related to the MQL5 Cloud Network usage and to the enabling and disabling of cloud agents, among others.

    Operation in full optimization log mode
    For optimal resource consumption, not all messages from agents are recorded to the tester log. To view all logs, you can enable the "Full optimization logs" option using the tester log context menu. Previously, this mode significantly slowed the optimization process. Now the calculation time is not affected.

    MQL5 Cloud Network
    Optimized operation of cloud testing agents. Now computation tasks are distributed more efficiently.

  8. Terminal: The built-in calendar features publications of more than 900 indicators related to the 18 largest global economies, including US, European Union, Japan and the UK, among others. Relevant data is collected from open sources in real time. By regularly checking the service, traders remain informed on the latest global news and can take informed trading decisions.

    The economic calendar is available in desktop terminals and websites, as well as on mobile devices. The application can be opened using the Calendar context menu in the terminal:




    Select your platform and download the Tradays apps:


    In addition to calendar functions available in the desktop platform, the mobile version provides event reminders and access to a complete history of indicators in the form of charts and tables.

  9. Terminal: Added automatic generation of custom symbol bar history during import of tick history. Now, if tick data of a custom symbol changes, corresponding bars are automatically recalculated:

    • Thus, unified data is preserved in the platform.
    • After importing tick data (provided that there is enough data), there is no need to import bars since they are automatically calculated by the terminal.

    Changes concern the import of ticks performed via the terminal interface, as well as the update of ticks performed from MQL5 applications using the CustomTicks* function. Any changes in tick data lead to recalculation of the corresponding 1-minute bars of the custom symbol.

  10. Terminal: Fixed data update in the Data Window when using a crosshair on a detached chart.
  11. Terminal: Fixed tick history saving. In earlier versions, multiple ticks within a millisecond could be saved in the wrong order.
  12. Terminal: Fixed generation of charts based on a too short price history (less than a day) available on the server.
  13. MQL5: Added MQL5 service debugging option. These applications can now be tested similar to Expert Advisors and indicators.
  14. MQL5: New profit and margin calculation modes have been added in the ENUM_SYMBOL_CALC_MODE enumeration:

    • SYMBOL_CALC_MODE_EXCH_BONDS — calculation for exchange bonds.
    • SYMBOL_CALC_MODE_EXCH_STOCKS_MOEX — calculation for the stocks traded on the Moscow Exchange.
    • SYMBOL_CALC_MODE_EXCH_BONDS_MOEX — calculation for the bonds traded on the Moscow Exchange.

  15. MQL5: The new TesterDeposit function enables the emulation of deposit operations during testing. The function can be useful when testing money management strategies.
    bool  TesterDeposit(
       double money      // the deposit amount
       );
  16. MQL5: During the OnDeinit method execution, the MQL5 application does not receive any events from the terminal. Previously, applications occasionally failed to complete de-initialization (for example, to delete all created objects) due to the receiving of other events.
  17. MQL5: Fixed occasional errors which could occur after a change in the custom symbol tick history for the current day.
  18. MQL5: Fixed occasional application slowdown when using a large number (tens of thousands) of graphical objects.
  19. MQL5: Fixed terminal freezing in the case of frequent trading history calls from MQL5 programs.
  20. MQL5: Fixed iBarShift function operation. With the "exact=false" flag and request outside the data, the function returned the oldest bar number instead of the newest one.
  21. Tester: Fixed determination of the cores number on computers with processors having several NUMA nodes.
  22. Tester: Added possibility to run testing and optimization with the zero initial deposit, since deposit operations can be emulated during testing using the new TesterDeposit function.
  23. MetaEditor: The code styler command can now be added to the toolbar for quick access.
  24. MetaEditor: Fixed switching to parameter definition and viewing of related data when using non-Unicode characters in function and variable names.
  25. Documentation has been updated.

The update is available through the LiveUpdate system.


 

Applying OLAP in trading (part 1): Online analysis of multidimensional data 

class Record
  {
    private:
      double data[];
      
    public:
      Record(const int length)
      {
        ArrayResize(data, length);
        ArrayInitialize(data, 0);
      }
      
      void set(const int index, double value)
      {
        data[index] = value;
      }
      
      double get(const int index) const
      {
        return data[index];
      }
  };

Traders often have to analyze huge amounts of data. These often include numbers, quotes, indicator values and trading reports. Due to the large number of parameters and conditions, on which these numbers depend, let us consider them in parts and view the entire process from different angles. The entire amount of information forms kind of a virtual hypercube, in which each parameter defines its own dimension, which is perpendicular to the rest. Such hypercubes can be processed and analyzed using the popular OLAP (  Online Analytical Processing) technology.

The "online" word in the approach name does not refer to the Internet, but means promptness of results. The operation principle implies the preliminary calculation of the hypercube cells, after which you can quickly extract and view any cross section of the cube in a visual form. This can be compared to the optimization process in MetaTrader: the tester first calculates trading variants (which may take quite a long time, i.e. it is not prompt), and then outputs a report, which features the results linked to input parameters. Starting from build 1860, the MetaTrader 5 platform supports dynamic changes of viewed optimization results by switching various optimization criteria. This is close to OLAP idea. But for a complete analysis, we need the possibility to select many other slices of the hypercube.

Online analytical processing - Wikipedia
  • en.wikipedia.org
OLAP tools enable users to analyze multidimensional data interactively from multiple perspectives. OLAP consists of three basic analytical operations: consolidation (roll-up), drill-down, and slicing and dicing.[6]: Consolidation involves the aggregation of data that can be accumulated and computed in one or more dimensions. For example, all...
 
Sergey Golubev:

Terminal: Added support for "Market", "Signals" and "Search" in Wine. Linux and Mac OS users can now access the largest store of trading applications along with the copy trading service.

Is it MT5 only?

What about MT4?

 
Bernhard Schweigert:

Is it MT5 only?

What about MT4?

It was the announcement for MT5 so I think - it may be for MT5 only.
Because I did not find same information or announcement related to Metatrader 4 ..

 
Sergey Golubev:

It was the announcement for MT5 so I think - it may be for MT5 only.
Because I did not find same information or announcement related to Metatrader 4 ..

Anyone with a MAC or Linux could test and tell here.