MQL5 Algo Trading
391K subscribers
2.58K photos
2.58K links
The best publications of the largest community of algotraders.

Subscribe to stay up-to-date with modern technologies and trading programs development.
Download Telegram
Discover the power of MetaTrader 5's export and import functions and elevate programmatic exchange beyond average standards. Its capacity to save rates and ticks from or to the 'Symbols' dialogue is especially notable. Keep in mind, however, some restrictions might affect tick export, possibly excluding portions of the required history.

To address this challenge, MetaTrader 5 makes use of a script which exports any part of the desired history into a compatible CSV-format. This aligns seamlessly with the standard procedures for data export and import. Moreover, the script operates based on the current chart's symbol, retaining its array of rates and ticks over a specified date range into two separate CSV-files.

The convenience doesn't stop at data extraction. Indeed, the files, saved in the MQL5/Files folder, have identifiers attached. The file names will carry the symbol name, the ...

Read more...
👍112👏1
Continuing on with insights from the previous article on EA automation, a fundamental observation was illuminated: the possibility of a system malfunction exists, no matter how remote. This factor necessitates measures to minimize potential damage or side effects. It stands to emphasize that creating a 100% automated EA is not a simple task. The goal has never been to obtain a 'foolproof' system devoid of supervision. In fact, that flawed perception about automatic EAs, that they're "set it and forget it", is misguided. As automation increases, complexity and gravity of potential errors amplify. Runtime errors can arise and must be managed in real time, which when coupled with potential system vulnerabilities, create a tiring demand on supervising staff. Always consider some salient points of potential problems, casings shadow even in a seemingly 'perfectly' running system.

The proce...

Read more...
👍7🔥1
Assistance is at hand to guide you through the process of modifying the TP/SL for all ongoing orders. This is done by configuring the TP/SL according to the percentage value introduced. Important guidelines to consider:

The TP/SL alteration should be performed precisely only when all ongoing orders are related to the same symbol. Adjust the leverage as specified in the expert advice given. The leverage value is entered as follows (for instance, 1:200 translates to 0.5, 1:100 correlates with 1, 1:400 converts to 0.25).

Further, to load the chart of the specific symbol, employ the expert's instructions. It's essential to be mindful regarding the intricate details in order to ensure smooth processing. The expertise available provides a solid foundation for synthesizing knowledge and executing tasks.

Read more...
5👍4
Meet our new book: "Neural Networks for algorithmic trading in MQL5". Learn how to use AI in trading robots for the MetaTrader 5 platform. The author, Dmitry Gizlyk, is a professional developer who has written around a hundred of articles on neural networks.

Now, with the support of MetaQuotes, all his valuable knowledge is conveniently collected in one book. It gradually introduces the reader to neural network basics and their application in algorithmic trading. You will learn how to create your own AI application, train it and extend its functionality.

The book is freely available online, under the NeuroBook section of the MQL5 Algo Trading community website.

Read more...
👍83👏3🔥2
The article takes an in-depth look at the practical use of quantization in creating tree models, without overuse of complex mathematical equations. Navigating through differing terminologies used by various researchers, it aims to select words that best convey the concept.
The piece provides readers with theoretical groundwork on quantization, a discussion on the uniform quantization method referencing MQL5 code and exploration of the application of the quantization process using CatBoost. This will prove beneficial for better understanding the goals and details of the process.
The article accentuates standard practices of data accumulation for model training. The accumulated data ranges from binary to quantitative indicators. It also underscores that the observations recorded can provide a comprehensive or a partial overview of the observed phenomenon.
Additionally, the piece provid...

Read more...
Presenting "Benchmark.mqh," an include file housing multiple macros designed for benchmarking execution speeds of various functions. The goal is to determine the speediest function, aiding in optimization practices. This library bases its architecture on public source codes, notably those of Python's 'timeit' module and C# 'Stopwatch' class.

The Python timeit module's link for reference: [Python timeit module](https://docs.python.org/3/library/timeit.html)
C# Stopwatch Class reference link: [C# Stopwatch Class](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.stopwatch)

Providing an example script for usage below, aiding practitioners in effectively using the library to maximize function performance. Further practical examples and usage guides will follow. Stay updated to optimize productivity through precise, time-efficient benchmarking.

Read more...
👍63
MetaTrader 5 users, get ready to level up! Discover how custom indicators in MQL5 can provide powerful insights, beyond the usual price action. Learn how to create the True Strength Index Indicator from square one, gaining insights that are hard to detect with strictly numerical analysis.

Moreover, the indicator can also be integrated into a trading system by creating an Expert Advisor. This tool allows you to interpret, calculate and code the True Strength Index indicator, optimized for use on the MetaTrader 5 platform - a winning edge for any trading strategy.

Make no mistake, this is not just about creating custom indicators, but also implementing them in trading systems and EAs. Practice coding the material independently for the maximum learning uptake. Familiarize yourself with the MetaTrader 5 IDE if needed, prior to coding the content to ensure smooth handling.

A guiding no...

Read more...
👍51👏1
Monitoring and maintaining profitable trades require meticulous measures. An Expert Advisor (EA) tool has been introduced that simplifies this process. Equipped with a mechanism that calculates the existing account balance, it formulates decisions based on the specified risk and profit percentages of the user.

For an increased understanding, one sell position is regulated at once in P_pro. The intent: to provide an effective demonstration of the EA's operations. Note that this feature tentatively exists, and has been eliminated in the money management mq5.

This sophisticated tool simplifies position management, catering particularly to those who favor this method. Highlighting scheduling flexibility, it enables closing trades either in profit or in loss. Feedback is welcomed. Please report any identified bugs or issues. Worth noting, this EA tool is an integral part of comprehensi...

Read more...
👍92🔥2👏1
Understanding the importance of special/unique domains is pivotal to leveraging predictive power in price volatility for traders. The concept of multi-domains, a generalization of domains, welcomes the replication of elements capturing all necessary metadata. They prove substantial in delineating intricate relationships in trading practices.

Consider the scenario of a multidomain accommodating multiple data points, or in some instances, a singular data point. When the homomorphism set represents a multidimensional domain, there are bound to be identical elements in the source domain. For the codomain, normalization of data points ranging from -100 to +100 enables unique representation. The possibilities become limitless when considering multi-faceted parameters coupled with today's robust computational capabilities.

The leverage of relative-domains is not extensively covered, despit...

Read more...
7👍2👏1👌1👀1
Recognizing the complexity and time consumption involved in using built-in functions of the SQLite database for storing simulation-generated statistics, a simplified class has been innovated. The goal is to avail of seamless, efficient data storing and extraction for developers. This developer-centric solution only requires the inclusion of the file in the code, followed by calling the database object using databases.xxxxfunction_name(). The efficacy of this approach has proven itself, successfully saving and extracting thousands of data points with ease. The innovation paves the way for a more streamlined experience working with SQLite databases.

Read more...
👍3👏1
An ongoing article series on the development of a multi-currency Expert Advisor currently witnesses the addition of source codes from new articles to its library. It's advised to review the code chronologically as per the publication of articles for a more streamlined understanding of the development progression and updates incorporated.

The article series serves as a detailed guide on multi-currency Expert Advisor creation. It begins with the inaugural part illustrating the benefits of using several parallel strategies implemented within one Expert Advisor for better risk diversification and sustainability.

The second part delves into transferring all operations related to market position openings from the strategy level to the expert management level, thereby enabling strategies to trade virtually sans real market position openings.

The third part involves a detailed walkthrou...

Read more...
👍8👏2
Continuing on the topic of creating templates for multi-symbol, multi-period indicators in Expert Advisors. To clarify their operation logic, bear in mind, indicators have two parts: calculation and plotting. Each part works independently from the other.

When an indicator is created, the system searches for an indicator with the same name and parameters on the chart. If found, the handle of the existing indicator is used rather than creating a new one. The plotting part uses the handle to get the required data from the calculation part.

In the case considering different time-frames, a higher-timeframe chart employs an algorithm similar to reality, albeit not exactly accurate. The CopyBuffer() function is used to obtain the data from the calculated indicator.

To make the process more resource-efficient, the OnCalculate() handler has predefined constant variables storing the size o...

Read more...
👍63🔥3👏1
Accelerate understanding of market activity using this relatively simple piece of code. The code offers insights into the speed of price fluctuations within financial markets, by stipulating the time taken to complete a set number of ticks - in this instance, 100. The outcome: a clearer picture of the pace at which prices shift.

Executed using a time subtraction method, the code fairly measures the time required for 100 ticks to take place. Prompt and efficient, this calculation provides data to assist market analysis.

Applying the algorithm to the chart is as user-friendly as drag and drop. The comments section provides any information needed, inclusive of the notable outcomes from the exercise. An effective tool to assess pricing velocity, expanding proficiency for market stakeholders.

Read more...
👏5👍2
The second part of our technical journey focuses on implementing a regression model forecast for financial asset closing prices. This approach analyzes market behavior, leading to informed decisions during trading. The accurate prediction of price trends can maximize profits and minimize losses while identifying trading opportunities and managing potential risks. The methodology used includes data collection and preparation, model selection and training, and assessing model performance. Following on from the previous article, where the infrastructure was laid out, the subsequent steps have now been completed; featuring Python scripts, historical price data, and a pantheon of regression models such as linear regression, polynomial regression and support vector regression. The final outcome will be a regression model used to predict financial asset closing prices, allowing for more effe...

Read more...
👍2👏2
Advances in offline reinforcement learning methods show promise in tackling complex problems. However, handling optimism that arises during learning remains a challenge. This often results in overconfidence in strategies based on a training set data, which does not always encompass every potential environmental state and transition. This optimistic approach, especially in stochastic environments, could increase risks and lead to undesirable outcomes.

In the pursuit of a solution, autonomous driving research offers valuable insight. Notably, algorithms aim for risk reduction and user safety maximization, with minimal online training. One such approach, known as SeParated Latent Trajectory Transformer (SPLT-Transformer), presented in "Addressing Optimism Bias in Sequence Modeling for Reinforcement Learning" offers a unique perspective.

The SPLT-Transformer is a sequence generation mod...

Read more...
👍2👏2
Understanding the intricacies of EA trading methods can provide a significant edge in the competitive field of market trading. The highlighted method, Breakout Range H1, comes with notable features.

Its primary functions include the application of a trailing stop, which supplements your trading strategy by securing earned profits. The method also integrates the use of a Moving Average (MA) filter to contribute to informed trading decisions. Additionally, it avoids auto lot sizing, relying instead on fixed lot preassignments.

Each trading move is supported by drawing lines of support and resistance, beneficial tools in identifying possible price action points. Furthermore, this approach advocates sequential completion of trades, maintaining a steady one-by-one transaction process for each trading period.

In the rapid-fire world of trading, using efficient, methodical strategies c...

Read more...
3👍3
In this segment, the focus falls on the process of using machine learning in the creation of an Expert Advisor for trading and subsequent testing. The key objective of deploying machine learning algorithms is so computers can learn from data and improve with time. As part of the process, the decision tree model, favored for its simplicity and fundamental role in constructing advanced models, will be applied.

Our comprehensive guide discusses how to maneuver within the subsets of artificial intelligence, utilizing statistical modeling and machine learning to enable computers to perform tasks autonomously. Concentration will be on decision tree models, valued for their basic principles and elemental role in creating more complex data models.

Additionally, the guide deals with the integration of the Pandas library, preferred by data scientists for examining and processing data. Not to...

Read more...
👍641
The latest EA has been programmed to operate with multi-symbol capabilities, a crucial feature in contemporary trading systems. Configuring parameters according to individual trading strategies is straightforward, ensuring a broad array of options for investors.

One of the key functionalities includes a logical calculation of buying conditions. It focuses on price movements and compares whether they are higher or lower than the Middle_band. This operation works in conjunction with the volume analysis, where the previous volume is compared with the previous MA_volume.

Performance efficiency of the system is of paramount importance. In this development update, assurances have been given that comprehensive backtesting has been carried out. This task is part of an ongoing commitment to provide a secure and efficient system for every user.

The backtesting results compile as a testament...

Read more...
👍5🔥1
In the realm of Forex trading, it's essential to have access to the current local time of specific or all Forex markets. An impressively functional library exists that not only helps to get this information, but also aids in managing broker's server time and trading within particular sessions. This versatile library takes care of different time offsets and variations in daylight time changes, significantly easing the coding process.

Time zone is an unavoidable concept in this field, defined as the standard time correlated to a particular geographical location. This is determined by Coordinated Universal Time (UTC) which is a universally accepted standard. The understanding of UTC offset becomes crucial here, which varies based on whether the timezone is east or west of GMT.

To obtain the current time, the RefreshTime() method comes in handy by updating the current local time of the ...

Read more...
🎉2👌2👍1
Implementing software features requires specificity. For efficient file storing, the specified path is designed for the 'Indicator' folder: C:\Users\HP\AppData\Roaming\MetaQuotes\Terminal\F762D69EEEA9B4430D7F17C82167C844\MQL5\Indicators\My Files\Donchian_Channel.

Remember, it is integral to add the requisite coding to the EA for proper operation. Careful and meticulous coding remains paramount to successful software development and operation. Following the guidelines set for file storing and code implementation will continue to uphold the high-quality work expected in this field.

Read more...
👍3👏1
Introducing a new manual trading Expert Advisor (EA) aimed at those starting out in the world of trading. This specific EA is capable of being utilized in backtesting visual mode as well as during live trading. Notably, the EA includes the function to pause or adjust the review backtest's speed, offering users an improved environment for manual trading exercises.

The EA's features are robust and beginner-friendly;
-Lots Button: Enables lots quantity modification
-Buy Button: Places orders equal to the quantity of lots
-Sell Button: Places one short order for the selected lot size
-SL Modify TP Button: Modifies all orders relative to the current price of Stop Loss and Take Profit distance
-Additionally, buttons to manage and close Buy and Sell orders are provided

Furthermore, the EA comes with specifically coded parameters that assist users in implementing trading systems effectively...

Read more...
5👍5👏1