MQL5 Algo Trading
400K subscribers
2.63K photos
2.63K 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
Explore innovative enhancements to the classical moving average crossover strategy, tackling its common pitfalls like noise and delayed signals. The article delves into robust filtering to enhance signal reliability, utilizing statistical models for superior trade selection. The discussion includes practical backtesting, with consistent parameters, spanning 2022 to 2025. Initial strategy improvements focus on candle wick analysis, leading to stable uptrends in results. Further advancements utilize machine learning, notably through ONNX models, enhancing decision-making. Transitioning to non-linear models like random forests offers deeper market insights, correcting bias and leveraging data relationships, aiming for refined trade accuracy and performance.

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Strategy
❀36πŸ†3πŸ‘Œ2🀑2πŸ‘¨β€πŸ’»2πŸ‘€2
In recent technical publications, the focus has been on enhancing trading psychology through session awareness rather than just relying on clock times. Traditional explanations of market sessions often miss the importance of geographical dynamics. Understanding when different parts of the world are active can significantly improve decision-making. This project uses MQL5 to create a visual layer that highlights active trading sessions on a chart in real-time. This approach turns trading into an interactive geographical experience rather than a linear timeline, helping traders maintain psychological and strategic alignment with market rhythms. The development utilizes efficient coding practices to reduce cognitive load and increase market awareness.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #Forex
❀45πŸ‘11πŸ‘¨β€πŸ’»3πŸ‘Œ2
Discover a technical implementation of the Tillson T3 indicator designed for improved performance. This version calculates 6 EMAs internally, avoiding the use of auxiliary indicator buffers. This approach streamlines operations and enhances efficiency. Developers can access the source code at the AlgoForge repository, structured in multiple files for clarity and ease of understanding. This structured format aids in comprehending the logic and functionality behind the implementation. Ideal for those seeking to understand or incorporate advanced algorithmic elements into their projects.

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #Indicator
❀59✍4πŸ‘¨β€πŸ’»4πŸ‘Œ3πŸ‘2⚑1
The text covers the integration of AutoIt with MQL5 for automation tasks in MetaTrader 5. AutoIt is highlighted as a tool for Windows GUI automation, offering capabilities not possible with MQL5 alone, such as script and expert advisor management on charts and alert handling.

The integration process includes using AutoItX, a DLL library for AutoIt functions, compatible with MetaTrader 5. This requires setting up a working environment and handling limitations due to AutoIt's reliance on standard Win32 API components.

The text introduces classes such as CAutoit and CTerminalController to encapsulate AutoIt functions for streamlined automation in MetaTrader 5, focusing on GUI element identification and control interactions for efficient task execution.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #AutoIt
❀148πŸ‘¨β€πŸ’»17πŸ‘Œ10πŸŽ‰6😁5🀣4⚑2
An Expert Advisor (EA) has been developed to alert users about the Depth Per Inch (DPI) of their monitors, a crucial tool for those working with varying screen resolutions. Typically, panels are designed to function with a limited range of resolutions when default settings are applied. However, to ensure compatibility across all monitor resolutions, integrating DPI measurements into panel dimensions is essential. This code provides a solution, facilitating the creation of adaptable panels that adjust according to the specific DPI of the user's display. This ensures consistent performance and appearance regardless of the monitor setup.

πŸ‘‰ Read | Forum | @mql5dev

#MQL4 #MT4 #EA
❀33πŸ†3⚑2πŸ‘Œ2πŸ‘¨β€πŸ’»2πŸ‘1
The article delves into developing advanced container controls for modern UI design within MetaTrader 5, emphasizing their integration within the MVC paradigm. Key controls like Panel, GroupBox, and Container are explored for placing various UI elements, each having distinct properties: Panels act as general-purpose containers, GroupBoxes group elements for specific functionalities, and Containers enable seamless content scrolling with automatic event handling for intuitive navigation. The article highlights implementing a Singleton class for shared data management, and auto-repeat classes for standard OS-like button behavior. These innovations enhance developers' ability to create user-friendly, ...

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 provide a mechanism for overriding by derived classes when necessary. The following hashtags are recommended based on the key focal points of the content: #Singleton
❀32πŸ‘Œ2πŸ‘€2πŸ‘¨β€πŸ’»1
Modern algorithmic trading requires balancing high returns with risk management to protect capital against volatility and systemic risks. An Expert Advisor (EA) achieves this through a multi-layered protection framework integrating dynamic lot sizing, exposure controls, and real-time monitoring. This approach uses adaptive measures, including equity floors, drawdown management, and recovery protocols to regulate trades and adjust exposure dynamically.

A sophisticated automated trading system focused on gold employs a martingale recovery strategy with robust protections like dynamic stops and daily loss limits. By using EMA crossovers, the system strategically places trades and manages risk through multi-layer defense mechanisms to limit potential losses while allowing for recovery from setbacks. During volatile market sessions, the EA employs circuit brea...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #EA
❀32πŸ†3πŸ‘¨β€πŸ’»2πŸ‘Œ1
In the latest iteration of our MetaTrader 5 series, we transform the Kagi chart engine into a full-featured Expert Advisor. Building on the Kagi structure, we introduce features enabling automated trading in response to market changes. The EA now detects reversal signals, places trades, manages risk, and visualizes signals with markers. Designed for flexibility, traders can enable or disable trading, choose trade directions, and select between manual or automatic lot sizing. Enhanced risk management includes stop loss, profit-taking, and optional trailing stops, all aligned with Kagi patterns. This update equips traders with a comprehensive system for any instrument on MetaTrader 5.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #EA
❀27⚑3πŸ‘Œ3πŸ‘¨β€πŸ’»2
We are progressing with the system for automating the optimization of trading strategies in MetaTrader 5. At its heart is a database designed for optimization projects. We've crafted a script to initiate projects, notably for the SimpleVolumes strategy, but adaptable to others. Exporting optimized strategy groups into an EA database occurs automatically, updating trading systems' settings without recompilation.

We've reorganized the project files, moving non-strategy-specific components to a library in the MQL5/Include folder. Remaining components like stage EAs and scripts reside in MQL5/Experts. This setup facilitates automatic optimization across varying strategies, easily integrating new strategies like the SimpleCandles strategy into this framework.

For SimpleCandles, the strategy employs a candle direction approach for trading decisions, rely...

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #Trading
❀20πŸ‘Œ4πŸ‘¨β€πŸ’»2
The recent archive of models offers a diverse set of options for personalizing model training, particularly due to varying hyperparameters. These machine learning models are developed in Python and are then converted to ONNX format, ensuring ease of use without requiring code adjustments in the encludnik. The configuration remains straightforward, although users can apply custom filters for enhanced model performance, such as optimizing stop loss and take profit across different timeframes.

The models connect via a header file, exemplified on 31 March 2024. Examples include clustering techniques using the k-means method and training data spanning from 2010 to 2020, with forward testing from 2020 to 2024. The "ONNX Trader Clusters" bot embraces these models, supporting the training method from "Matching trades using clustering." By linking the ...

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #MachineLearning
❀18πŸ‘¨β€πŸ’»6πŸ‘Œ4πŸŽ‰2
A library offering concise descriptions for each error in the MQL5 Reference has been developed, with regular updates as the documentation evolves. The latest update was released on February 29, 2024. For optimal use, ensure the file ErrorDescription2.mq5 is placed in the \MetaTrader 5\MQL5\Include folder. An upcoming library will feature a class to streamline error handling in MQL5, enabling simplified user error reporting through methods like Raise(my_error). This endeavor promises enhanced efficiency in managing errors within MQL5 projects. Stay informed for future developments and releases.

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #Library
❀16πŸ‘Œ3✍1⚑1
The Chaos Game Optimization (CGO) algorithm, introduced by Siamak Talatahari and Mehdi Azizi in 2020, employs chaos theory principles and chaotic sequences for achieving global optimization in complex multidimensional spaces. The algorithm's effectiveness lies in its ability to leverage chaotic sequences, which help in navigating around local optima and enabling the discovery of high-quality solutions across diverse problem domains.

Implementation of CGO involves an algorithm class derived from a base class, with specific methods like SetParams, Init, Moving, and Revision that set parameters, initialize search spaces, orchestrate agent movements, and revise solutions, respectively. Key components include generating new solutions using chaotic sequences and updating best-known solutions.

Test results indicate that CGO's performance, though mode...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Optimization
❀16πŸ‘3πŸ‘Œ3
The development of an Inverse Fair Value Gap (IFVG) detection strategy continues in MetaQuotes Language 5 (MQL5). Following detection of Fair Value Gaps (FVGs), IFVGs are introduced to identify states where a mitigated gap inverts direction due to price action. Settings like colors for state visualization, trading modes, and handling overlapping FVGs are configurable.

The implementation involves setting up input parameters, declaring global variables, and utilizing existing MQL5 libraries for managing trades. Specific functions are defined for creating and updating visualization elements such as rectangles and labels to display FVG zones and states. Historical data is analyzed during initialization to process past FVGs, updating their states to guide decision-making.

The system extends its capability by scanning and updating setups with the appearance of new bar...

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #EA
❀21✍4⚑3πŸ‘Œ2
A script has been developed to calculate autocorrelation and partial autocorrelation functions, displaying results graphically. Key input parameters include:

1. N: Data window for calculation, where a default value of 100 is set. Capable of handling large datasets, it efficiently processes over 100,000 bars.

2. K: Number of lags for analysis, defaulted at 16. Typically, analysis remains effective with lags under 40, though the script supports up to 500.

3. start_pos: Defines data window offset, with zero indicating calculations start from the latest loaded bar.

4. duration: Chart display period, set for 10 seconds.

These settings facilitate comprehensive time series analysis, enabling efficient examination of large datasets for technical insights. Adjust parameters according to specific analysis needs.

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #script
❀20πŸ‘Œ2
A library for keyboard operation is essential for managing keyboard layouts and key processing. It includes comprehensive data on various keyboard layouts, allowing for the configuration and recognition of different key arrangements. This library aids in determining the status of keys, whether they are pressed, released, or held down, and provides efficient processing for these events to trigger corresponding actions in applications.

An example usage scenario includes handling key inputs in a software program, where the library detects the keyboard layout in use, interprets user input correctly, and reflects real-time key status changes. By integrating such a library, developers can ensure their applications respond accurately to various keyboard inputs across different systems and configurations. This enhances user interaction and input reliability in d...

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Keyboard
❀15πŸ‘Œ2
Explore a new approach in trading with the integration of RSI for smart stop-loss mechanisms. The research compares two strategies: a traditional fixed stop-loss against an innovative RSI-based stop-loss system. The findings reveal that while RSI lowers the risk of being hunted, traditional methods demonstrate higher profitability and consistency in practice. Notably, the RSI strategy showcases reduced risk and psychological benefits for traders, offering an alternative for those seeking a more methodical approach. For developers and traders, this insight highlights the importance of risk management and presents RSI as a potential tool to minimize stop-loss hunts, albeit with some trade-offs in profitability.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Strategy
❀19✍2πŸ‘Œ2
Deploying machine learning-driven trading applications poses numerous challenges, primarily due to hard-to-detect errors not addressed in standard literature. A major issue is model assumptions violation, which often leads to silent failures in trading algorithms. All statistical models require assumptions about data relationships, and flexible models with minimal assumptions are often preferred. However, a model without any assumptions is unfeasible.

Models depend on the assumption that the target is a function of given observations. Violating this foundational assumption can lead to unnoticed failures. Existing statistical tests to verify assumptions are problematic and may yield misleading results, exposing practitioners to substantial risks.

A proposed solution involves generating new candidate targets from input observations. This self-supervised le...

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #ML
❀24πŸ‘€5πŸ‘Œ2
An advanced MetaTrader 5 Expert Advisor (EA) seamlessly combines Smart Money Concepts (SMC) like Order Blocks, Fair Value Gaps, and Break of Structure with real-time market sentiment analysis. The EA dynamically adapts to market conditions, selecting optimal strategies for bullish, bearish, or neutral phases. It operates across multi-timeframes to analyze trends and volatility, ensuring a cohesive trading approach. By focusing on sentiment and structural price insights, the system intelligently executes trades aligned with market directions, enhancing efficiency and precision. This framework offers a sophisticated tool for traders and developers aiming to implement adaptive algorithmic trading strategies.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #EA
❀33πŸ‘Œ2
Analyzing indicator combinations for the VGT ETF was the previous focus, but here the goal shifts towards selecting complementary indicators methodically. The process of selecting technical indicators is prone to subjectivity and could lead to biases like survivorship and hindsight-confirmation. Rigorous methods are crucial, particularly for ETFs like FXI, which exhibits dynamic behavior influenced by external events. Volatility, momentum shifts, and liquidity changes mandate a robust analytical approach.

A Python-based plan integrates segmentation of FXI’s data into quarterly β€˜discrete-windows’ to assess indicator performance across market regimes. Data preparation is critical to ensure integrity with operations to validate, re-synchronize, and label data properly. A well-organized dataset facilitates reliable indicator scoring with minimal errors.
...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #Dataset
❀54⚑7πŸ‘Œ5🀯4
The primary function of this indicator is to assess the possibility of price maximums and minimums. It begins by gathering historical price data for analysis. By evaluating the current market conditions and comparing them to historical statistics, the indicator generates signals. These signals can serve as an auxiliary filter to predict potential market reversals.

Key parameters include iPeriod, denoting the period length with a minimum of 2, and History, indicating the number of bars analyzed for statistical collection. A History value of 0 implies a comprehensive analysis of all data. Be aware that larger history values may slow down initialization. The Percent parameter sets the signal threshold; a higher value results in less frequent alerts. Initial calculations may require additional time due to the extensive statistical gathering process.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #Indicator
❀30πŸ‘€4