MQL5 Algo Trading
388K subscribers
2.57K photos
2.57K 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
In constructing robust trading systems, technical analysts often employ a range of tools and techniques to enhance accuracy and reliability. Utilizing an H1 time period is popular among traders seeking to capitalize on strong trends. Enhancements such as color-coded histograms in multi-time-frame (MTF) settings provide clear visual cues, helping traders assess market conditions swiftly. For instance, green indicates an uptrend, orange signals undefined market states, and red denotes downtrends.

Furthermore, the implementation of the Bollinger Inverse technique, where the upper Bollinger Band is adjusted with a lower-mode setting, and the lower Bollinger Band with an upper-mode setting, adds a layer of precision. This adjustment is particularly effective when coupled with moving averages (MA), where a crossover of the upper Bollinger Band by a fast MA suggests a potential uptrend, whe...

Read more...
πŸ‘26❀10πŸ‘3πŸ‘€1
We are releasing MetaTrader 5 build 4410, introducing important improvements and fixes:

β€’ Web Terminal update fixes browser compatibility checks and demo account opening procedures, ensuring smooth connection and stable operation.
β€’ In the previous version, the terminal could crash after starting the testing process. With this error now being corrected, you can seamlessly use our cloud-powered tester to optimize your strategies without being disturbed.
β€’ Another fix concerns service application development in MQL5. Its MQL_PROGRAM_NAME property has been fixed and now returns the correct name of the current running program.

Tablet version of MetaTrader 5 for Android app has also been completely redesigned. It got a fresh look that is already warmly welcomed by the users of the iOS and web version of the platform. Switching between the main sections of the app is now done on the lower panel, while chart commands are now located on the left.

Discuss the update...
πŸ”₯84πŸ‘78❀45πŸ‘Œ11πŸ‘8πŸŽ‰7✍6
Discover the fascinating alignment between nature's ingenuity and technological innovation with the Bat Algorithm (BA), a heuristic approach based on the echolocation mechanism of bats. Developed in 2010, this algorithm has proven its worth in global optimization challenges across various sectors.

The BA transforms the essence of how bats locate their prey in the dark into an algorithmic solution to find optimal values in complex problem spaces. Each 'bat' in the algorithm represents a potential solution, navigating through the solution space by dynamically adjusting frequency, speed, and loudness based on proximity to the desired outcome.

Key parameters such as minimum and maximum frequency, loudness, and pulse rates are meticulously handled to fine-tune the search process, ensuring efficiency and accuracy. The algorithm's adaptability to multiple types of optimization problems sho...

Read more...
❀22πŸ‘21😐3πŸ‘2πŸ‘Œ2⚑1πŸŽ‰1
The xoshiro256** Random Number Generator, developed by Sebastiano Vigna and David Blackman, is a high-performance, 64-bit algorithm designed primarily for non-cryptographic needs. This generator excels in speed and has a robust state size of 256 bits, making it ideal for any parallel processing application. It is renowned for passing all known statistical tests without compromising performance.

Notably, while the xoshiro256** does not cater to cryptographic applications, its quick processing capabilities and robust statistical profile make it highly suitable for Monte Carlo simulations, where speed and accuracy are paramount. This algorithm is integrated into the .NET framework by Microsoft and is also employed across various major JavaScript engines including those in Chrome, Node.js, Firefox, Safari, and Microsoft Edge.

For developers seeking an efficient and reliable solution for...

Read more...
πŸ‘72❀54⚑7πŸ‘6πŸŽ‰4πŸ‘Œ3
In a continuation of our discussions on creating automated trading solutions using MetaTrader 5, this post focuses on crafting an order management system leveraging the unique capabilities of MQL5. While MetaTrader 5's Standard Library is quite robust, there is significant value in understanding the inner workings of its TRADE library for those who are serious about custom functionality.

The goal here is not to replace the existing library but to enhance understanding by building a simplified version that aligns closely with the core needs of an Expert Advisor (EA). This endeavor begins with constructing the C_Orders class from scratch, rather than using the pre-defined structures, hence promoting deeper insights into class utilization and object-oriented programming within the MQL5 environment.

For effective order management, the proposed system will rely on basic commands sent dir...

Read more...
❀27πŸ‘14πŸŽ‰3😁2
In the realm of algorithmic trading, the need for precise and automated tools is ever-present. A request from a client has led to the development of a new Expert Advisor that leverages Fibonacci lines to automatically identify the Highest High and Lowest Low between any two bars from the start bar to the current bar in trading platforms. This custom tool was designed to address the lack of functionality in existing Fibonacci indicators and to enhance trading strategies. Its utility lies in its ability to simplify market analysis and improve decision-making by providing clear, automated Fibonacci measurements. This development represents a significant advancement in trading technology, offering traders a more robust and efficient method to gauge market movements and potential reversals.

Read more...
πŸ‘41❀32πŸ”₯7πŸ‘7πŸ†5🀩2✍1
Programming an automated Expert Advisor (EA) is a complex yet achievable task if approached correctly. It involves understanding the necessary components and the typical pitfalls associated with developing these automated systems. The process begins with creating a robust order system that functions effectively without constant developer intervention. This system needs to be rigorously tested using demo accounts to ensure stability and reliability.

Developers are advised to focus on simplicity, particularly when designing the trigger system of an EA. Overcomplicating the process can lead to inefficiencies and potential failures, contrary to popular beliefs surrounding the glamour of quantitative or algorithmic trading. Misconceptions often lead to undue risks, emphasizing the need for thorough background knowledge and research, especially about major market incidents that have been i...

Read more...
πŸ‘31❀6πŸ‘5πŸ†3πŸ‘€2πŸ€”1πŸ‘Œ1
Implementing a Relative Strength Index (RSI) bot offers a systematic approach to trading by issuing buy and sell alerts based on specific RSI thresholds. This bot is programmed to send a buy alert when the RSI falls to 20 or lower and a sell alert when it reaches 80 or higher.

Key parameters include:
- RSI averaging period set at 30 days.
- Calculation based on the weighted price.
- Alert thresholds configured at RSI levels 80 (sell) and 20 (buy).

This setup helps in identifying potential overbought and oversold market conditions, enabling traders to potentially capitalize on market reversals. It is essential for users to test these settings against historical data to ensure strategy effectiveness under various market conditions.

Read more...
❀43πŸ‘20✍2πŸ‘€2πŸ‘1πŸ€”1πŸŽ‰1
In the rapidly evolving domain of algorithmic trading, the ability to discern effective expert advisors for a portfolio is crucial. An expert advisor must be chosen based on its performance qualifications rather than potential promises. Here are pivotal exclusion scenarios when selecting or dismissing a trading bot.

Firstly, reject any expert advisor that relies on the developer's intervention post-purchase, as it raises questions about its autonomy. The same principle applies to bots requiring frequent manual inputs or adjustments, indicating a dependency that could hamper operations. Secondly, those bots exhibiting errors in initialization or throughout regular operations should be avoided, as these could indicate deeper issues in programming and reliability. Additionally, bots conditioned to perform under specific and often unrealistic market criteria or those that perform only u...

Read more...
πŸ‘23❀7✍4πŸ€”3πŸ‘1
A new tool is now available for efficiently capturing widescreen screenshots directly from your chart interface. By simply pressing the 'S' key on your keyboard, this functionality allows users to instantly take screenshots. Each captured image is conveniently named with the date of capture appended automatically, enhancing file management and retrieval. This feature aims to streamline documentation and analysis processes for users, offering a quick and organized method to record visual data.

Read more...
❀28πŸ‘23πŸ‘3πŸ‘Œ2πŸ€“2⚑1
In the evolving realm of computational optimization, the inheritance from a base class for population algorithms presents promising avenues for the development and enhancement of hybrid optimization methods. This technique facilitates the integration of various computational strategies such as genetic algorithms, particle swarm optimization, and others into a unified framework, advancing the efficiency of solving complex problems.

Utilizing a single base class streamlines the process of algorithm development by enabling the use of common interfaces and testing environments. This structured approach not only speeds up the evaluation of different optimization strategies but also simplifies the customization of algorithms to suit specific needs.

The creation of hybrid algorithms through this methodology allows for the amalgamation of the distinct advantages of various optimization te...

Read more...
πŸ‘16❀3⚑1πŸ‘1πŸ€”1
In the realm of trading automation, upholding strategic control while adapting parameters dynamically enhances outcomes. A sophisticated trading algorithm includes multiple key functions to regulate its operations efficiently:

- **SetParameters Function**: Adjusts essential variables including target profit, starting lot size, gain per lot, and ordering levels.
- **TargetProfit and GainPerLot Functions**: These methods allow for the setting and querying of profit objectives and gains expected per trading lot.
- **SqueezeDistance and SetHardSL**: Determine the strategic placement of orders relative to current prices and set a hard stop loss to manage risks.
- **Volume and Trade Count Functions**: Provide insights into active and pending trade volumes, crucial for assessing the strategy's market engagement.
- **Run, Stop, and Running Functions**: Control the operational state of the tr...

Read more...
πŸ‘23❀13πŸ‘4✍3πŸ”₯2πŸŽ‰2πŸ‘€2
In the realm of artificial intelligence, configuring powerful GPU environments is crucial for accelerating model training. This article highlights the process of configuring AMD graphics cards for training large financial language models, complemented by solutions to common challenges encountered with these setups.

Setting up an AMD environment involves multiple steps that differ from NVIDIA configurations. Ubuntu is recommended as the operating system, due to its current support frameworks. Hardware configurations require careful attention to detail, such as ensuring an adequate power supply is available and tweaking driver settings to optimize performance.

For training adjustments, using ROCm and the ROCm-SMI tool proves effective. These tools offer a multitude of commands for fine-tuning hardware settings, like adjusting clock speeds, setting the power limit, and configuring fan...

Read more...
πŸ‘12❀7πŸ”₯2😎1
Exploring the Multi-layered Utilization of Moving Averages in Trading Solutions

The Moving Average (MA) holds versatile applications in the trading domain, extending beyond the traditional time-series visualization on charts. This versatility includes its use as an oscillator and, intriguingly, as part of the envelopes' indicator framework. A distinctive configuration under investigation involves the 'Pythagorean Means'β€”namely, the Arithmetic Mean (AM), Geometric Mean (GM), and Harmonic Mean (HM).

The arithmetic mean, typically the first approach to calculating MA, is straightforwardβ€”the average of values within a set. In comparison, the geometric mean emphasizes smaller values more significantly, which is demonstrated through its mathematical formula. It maintains positivity across computations, ensuring representational accuracy regardless of negative inputs.

Harmonic Mean (HM), ...

Read more...
πŸ‘16❀12πŸ‘4🀯2
This enhanced version of the Time Segmented Volume (TSV) indicator, originally developed by Worden Brothers, Inc., offers customizable options for deeper data analysis. Users now have the flexibility to select the price type applicable to the formula, which deviates from just the default close price set in the original version. Additionally, this version introduces various volume weightings, including an option based on the true range, or even to operate without any volume weighting.

The indicator now features two types of moving averages: the traditional simple moving average as found in the original, alongside an exponential moving average for quicker responsiveness to price changes. The implementation is versatile, supporting both MQL4 and MQL5 environments through conditional compilation. For developers interested in customization or integration, the source code of this and other...

Read more...
❀31πŸ‘21πŸ”₯3🀝1
In the ongoing development of multi-currency Expert Advisors (EA) with multiple strategies, significant enhancements have been implemented to streamline and expand functionality without extensive code modification. The EA architecture now supports virtual pending orders including Buy Stop, Sell Stop, Buy Limit, and Sell Limit, alongside mechanisms for visualizing these orders to ensure the correct execution during testing phases.

Further improvements focus on the EA's ability to save its state, enabling it to resume operations seamlessly after a system restart or transfer between terminals. This is achieved by saving data concerning virtual orders and positions, ensuring continuity and stability across sessions.

Development efforts also led to simplifications in handling virtual pending orders by consolidating similar functionalities into a unified class to reduce redundancy. This a...

Read more...
❀12πŸ‘7πŸ‘3πŸ€“2⚑1
Understanding the integration of the Telegram Bot API with MetaTrader 5 can significantly enhance trading efficiency by enabling real-time notification and messaging capability directly from the trading platform. This setup facilitates immediate updates from trading indicators without necessitating the switch between different applications.

This integration uses a combination of Python scripts and MetaTrader's MQL5 programming language. The process involves configuring the Trend Constraint Indicator to send trading alerts to a Telegram bot, created via Telegram's BotFather. This allows users to receive instant indicator-based notifications on Telegram.

Key components for the integration include the Telegram Bot API, Python scripts hosted on a server to handle requests, and the MQL5 program customized to trigger alerts. While Telegram is the current focus, this methodology can be ada...

Read more...
πŸ‘12πŸ”₯7❀2πŸ‘¨β€πŸ’»2πŸ‘1😁1
Understanding the nuances of the Quadratic Mean (also recognized as the Root Mean Square) in financial analysis is pivotal for developers implementing it as a moving-average indicator. The Quadratic Mean is accurately applied only to datasets where all values are zero or positive. This entirely computational function yields congruent results to the Simple Moving Average (SMA) under this restriction.

However, the instant a dataset includes even one negative value, the Quadratic Mean no longer provides valid outputs, deviating substantially from what traditional moving averages would indicate. This limitation is critical to consider in practical applications, making it unsuitable for generalized use across typical financial datasets that might incorporate negative figures.

For developers and analysts, acknowledging these constraints is crucial when integrating or modifying indicators ...

Read more...
πŸ‘18❀15πŸ”₯2πŸ€”2πŸ‘1
Auto-optimization is crucial in trading strategies for maintaining reliability and consistent performance in the dynamic financial markets. Optimization of trading bots can prevent losses due to irrelevant data response and poor adaptation to market changes, thereby increasing overall efficiency and stability. Readers can expect to learn about various optimization techniques and algorithms, including brute-force, grid search, and random search, each offering a balance of thoroughness and efficiency based on the resources and time available.

For technical implementation, Python serves as a versatile tool allowing rapid development and testing of trading models with the capability of integrating historical data for strategy validation. For developers focusing on algorithmic trading, understanding and applying these optimization techniques are essential. Furthermore, detailed examples i...

Read more...
πŸ‘11❀3πŸ‘2πŸ‘Œ2✍1⚑1
The Zone Recovery Martingale Strategy is a sophisticated approach in forex trading designed to mitigate losses by initiating countertrades that leverage market reversals. This strategy, when automated via an Expert Advisor (EA) in MQL5 for MetaTrader 5, dynamically manages trades within specified price boundaries without requiring predictions of market direction.

The EA utilizes market analysis to establish initial and countertrades. If a trade goes against initial expectations, the system activates a countertrade of increased volume to potentially balance or profit from the situation. The coding process involves defining zone recovery levels and using the RSI indicator for trade signals. Assets are managed to ensure that each trade adheres to a precise hedging and averaging methodology, requiring a solid grasp of risk management.

Implementation requires imprinting detailed steps wi...

Read more...
πŸ‘9❀5✍5πŸ‘€2🀯1