Structs offer a fundamental bridge between object-oriented and conventional programming. They simplify data management, yet demand careful handling, especially when passing values to functions or procedures. Historical constraints of languages like C have given way to safer data transfer mechanisms. Effective use involves minimizing the knowledge functions require about structures.
Understanding structures as special data types enriches programming flexibility. Global struct declarations allow smoother data transfer, a common practice in languages like Python and JavaScript. This aids in reducing function overloads, enhancing code efficiency. Employing structures in this way allows for clearer code organization, data encapsulation, and easier management of complex datasets. Proper implementation ensures a clean, efficient codebase ready for future expa...
๐ Read | Freelance | @mql5dev
#MQL5 #MT5 #coding
Understanding structures as special data types enriches programming flexibility. Global struct declarations allow smoother data transfer, a common practice in languages like Python and JavaScript. This aids in reducing function overloads, enhancing code efficiency. Employing structures in this way allows for clearer code organization, data encapsulation, and easier management of complex datasets. Proper implementation ensures a clean, efficient codebase ready for future expa...
๐ Read | Freelance | @mql5dev
#MQL5 #MT5 #coding
โค49๐จโ๐ป9โ4
An effective signal indicator for MetaTrader 5 combines RSI and Moving Average to identify trend-following signals. Designed as a clean visual tool, it aids manual trading or provides signals for Expert Advisors. The strategy draws arrows based on specific conditions. For a buy signal, a blue arrow appears when the closing price is outside the Moving Average, and the RSI value exceeds 50, indicating an uptrend with bullish momentum. For a sell signal, a red arrow is drawn when the closing price falls below the Moving Average, and the RSI is below 50, confirming a downtrend with bearish momentum.
Features include clean, commented code and customizable parameters for RSI and MA periods. The indicator utilizes standard MT5 buffers, making it ideal for iCustom() function use in Expert Advisors.
๐ Read | Calendar | @mql5dev
#MQL5 #MT5 #Indicator
Features include clean, commented code and customizable parameters for RSI and MA periods. The indicator utilizes standard MT5 buffers, making it ideal for iCustom() function use in Expert Advisors.
๐ Read | Calendar | @mql5dev
#MQL5 #MT5 #Indicator
โค42โก2๐คจ2๐จโ๐ป2๐1๐1
The development and refinement of the Table View control in the MVC paradigm has led to significant advancements in both the Model and View components. Initial efforts focused on creating a foundational object for graphical elements. Progress is now moving towards simple controls, which will eventually be used as components for more complex UI elements. These controls will enable interactivity, essential for the Controller component, thanks to MQLโs integrated event model.
The Base class is being refined for graphical objects by organizing event handling to connect the View and Controller components. This involves refining classes, macros, and enumerations, primarily focusing on the base graphical element object. The implementation includes methods for file operations, refining object descriptors, and utilizing efficient event-driven logic.
Auxiliary classes...
๐ Read | AlgoBook | @mql5dev
#MQL5 #MT5 #MVC
The Base class is being refined for graphical objects by organizing event handling to connect the View and Controller components. This involves refining classes, macros, and enumerations, primarily focusing on the base graphical element object. The implementation includes methods for file operations, refining object descriptors, and utilizing efficient event-driven logic.
Auxiliary classes...
๐ Read | AlgoBook | @mql5dev
#MQL5 #MT5 #MVC
โค33๐จโ๐ป5๐2โ1
Explore a systematic approach to improving logging in MetaTrader 5 using principles from Python's logging module. Gain insights into configuring specific parameters like file naming, size limits, and verbosity control through a custom MQL5 class. Optimize file I/O operations by utilizing caching mechanisms, reducing execution time in strategy tests significantly. Understand the convenience of defining tailored log messages with variable formats and severity levels, from debug to critical. This advanced logging system facilitates more maintainable and debuggable trading code, aligning with professional software development standards. Learn how to effectively integrate these practices into your algorithmic trading setups.
๐ Read | NeuroBook | @mql5dev
#MQL5 #MT5 #Logging
๐ Read | NeuroBook | @mql5dev
#MQL5 #MT5 #Logging
โค31๐ค2๐จโ๐ป2๐1
Discover how to transform forex chaos into clarity with a cutting-edge currency strength indicator on MetaTrader 5. This innovative tool evaluates real-time strength across three timeframes (H1, H4, D1) using a smart weighting system to highlight true market dynamics. The multi-level analysis dashboard aggregates data with a dynamic ranking system, offering traders a comprehensive view of market movements. Designed for both seasoned and aspiring traders, the indicator delivers precise insights for strategic decision-making, ensuring timely and profitable trading actions. Dive into algorithmic trading and elevate your market analysis with this robust and intuitive solution.
๐ Read | AlgoBook | @mql5dev
#MQL5 #MT5 #Forex
๐ Read | AlgoBook | @mql5dev
#MQL5 #MT5 #Forex
โค66๐7๐จโ๐ป4โ2๐1๐ฏ1
The Dynamic Gaussian Channel indicator constructs dynamic support and resistance levels by utilizing smoothed price data through a Gaussian filter. It consists of three main lines: resistance, median, and support. The algorithm applies Gaussian smoothing to the high and low prices to identify extrema over a specified period and creates a channel based on the smoothed values.
It offers customizable parameters, allowing users to adjust the calculation period and line colors/styles. During initialization, the Gaussian filter weights are calculated for smoothing. The smoothing process applies this filter to high and low prices. Resistance is determined by the maximum smoothed high, support by the minimum smoothed low, and the median by the average of these two.
Implementation uses indicator buffers, the Gaussian filter with a 5-bar window, and is opt...
๐ Read | Quotes | @mql5dev
#MQL5 #MT5 #Indicator
It offers customizable parameters, allowing users to adjust the calculation period and line colors/styles. During initialization, the Gaussian filter weights are calculated for smoothing. The smoothing process applies this filter to high and low prices. Resistance is determined by the maximum smoothed high, support by the minimum smoothed low, and the median by the average of these two.
Implementation uses indicator buffers, the Gaussian filter with a 5-bar window, and is opt...
๐ Read | Quotes | @mql5dev
#MQL5 #MT5 #Indicator
โค33๐7๐จโ๐ป3๐2๐คฏ1
The script effectively compiles total profits and swaps for each currency pair, enhancing its utility for hedging strategies and accounts. It accommodates multiple entries that rely on trading signals, promoting efficient analysis of financial performance. This feature is particularly beneficial for traders who require comprehensive oversight of their trading activities and outcomes. By aggregating these metrics, the script aids in the decision-making process and improves strategic planning. This tool integrates seamlessly into trading routines, offering valuable insights into overall profitability and financial health of hedging activities. The meticulous attention to detail supports informed trading strategies.
๐ Read | CodeBase | @mql5dev
#MQL5 #MT5 #script
๐ Read | CodeBase | @mql5dev
#MQL5 #MT5 #script
โค23๐6๐จโ๐ป2๐1
Our latest exploration into statistical arbitrage reveals a pivotal shift in assessing portfolio weight stability by integrating the Rolling Windows Eigenvector Comparison (RWEC) with traditional IS/OOS ADF validation. This approach solves previously discussed issues of long out-of-sample periods and sensitivity in live trading. RWEC's sharp temporal resolution effectively pinpoints precise moments of cointegration breaks, offering better decision-making support and risk management for live trading. This dual approach not only enhances backtest reliability but also provides significant insights into real-time signal stability, making it invaluable for both traders and MetaTrader 5 developers focused on robust, adaptive algorithmic solutions.
๐ Read | Freelance | @mql5dev
#MQL5 #MT5 #StatArb
๐ Read | Freelance | @mql5dev
#MQL5 #MT5 #StatArb
โค33๐ฅ4โ3๐3๐จโ๐ป3
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
๐ 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
๐ Read | AppStore | @mql5dev
#MQL5 #MT5 #Forex
โค46๐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
๐ Read | Forum | @mql5dev
#MQL5 #MT5 #Indicator
โค60โ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
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
๐ Read | Forum | @mql5dev
#MQL4 #MT4 #EA
โค36๐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
๐ 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
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
โค33๐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
๐ 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
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
โค21๐5๐จโ๐ป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
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
โค20๐จโ๐ป7๐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
๐ Read | AlgoBook | @mql5dev
#MQL5 #MT5 #Library
โค18๐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
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๐1