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
β€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
π 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
β€19π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
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
β€17π¨βπ»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
π Read | AlgoBook | @mql5dev
#MQL5 #MT5 #Library
β€15π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
β€15π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
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
β€20β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
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
β€19π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
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
β€14π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
π Read | Freelance | @mql5dev
#MQL5 #MT5 #Strategy
β€18β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
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
β€23π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
π Read | Signals | @mql5dev
#MQL5 #MT5 #EA
β€32π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
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
β€53β‘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
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
β€29π4
Automating trading processes is instrumental in addressing prop firm challenges. These firms impose strict rules that differ from personal trading, requiring adherence to drawdown and risk limits. Traders often excel in strategy but struggle with emotional discipline and manual risk monitoring.
The designed Expert Advisor (EA) offers a solution by automating trade execution with built-in risk management. It evaluates trade setups based on strict criteria, preventing rule breaches with a 2% risk cap per trade. Utilizing ATR for stop-loss levels, it avoids risks during volatile news periods.
The EA's robust logic handles gold's volatility specifically. It dynamically adjusts position sizing and employs precise trade management. This includes trailing stops and profit-taking mechanisms to optimize reward-to-risk ratios. Key features include drawdown protect...
π Read | AlgoBook | @mql5dev
#MQL5 #MT5 #EA
The designed Expert Advisor (EA) offers a solution by automating trade execution with built-in risk management. It evaluates trade setups based on strict criteria, preventing rule breaches with a 2% risk cap per trade. Utilizing ATR for stop-loss levels, it avoids risks during volatile news periods.
The EA's robust logic handles gold's volatility specifically. It dynamically adjusts position sizing and employs precise trade management. This includes trailing stops and profit-taking mechanisms to optimize reward-to-risk ratios. Key features include drawdown protect...
π Read | AlgoBook | @mql5dev
#MQL5 #MT5 #EA
β€62β5π―4π4π3
Currently drafting a series of articles on developing a multicurrency Expert Advisor (EA) with multiple trading strategies. Code from these articles will be available in a library, and it's advised to review it sequentially to understand progressive improvements.
Part 1 focuses on integrating multiple strategies within a single EA, enhancing risk diversification and trading stability without managing them separately. Part 2 progresses by shifting market position handling to the EA level, enabling strategies to function virtually. Part 3 involves revisiting and optimizing the architecture based on initial development experiences.
Part 4 adds functionalities for handling pending orders and ensuring state persistence after system restarts. Part 5 introduces variable position sizing, moving beyond fixed sizes for live trading.
Part 6 aims to aut...
π Read | VPS | @mql5dev
#MQL5 #MT5 #ExpertAdvisor
Part 1 focuses on integrating multiple strategies within a single EA, enhancing risk diversification and trading stability without managing them separately. Part 2 progresses by shifting market position handling to the EA level, enabling strategies to function virtually. Part 3 involves revisiting and optimizing the architecture based on initial development experiences.
Part 4 adds functionalities for handling pending orders and ensuring state persistence after system restarts. Part 5 introduces variable position sizing, moving beyond fixed sizes for live trading.
Part 6 aims to aut...
π Read | VPS | @mql5dev
#MQL5 #MT5 #ExpertAdvisor
β€17
Recent evaluations have highlighted performance and accuracy issues with the standard API functions ChartXYToTimePrice and ChartTimePriceToXY. ChartXYToTimePrice fails to function correctly when X and Y parameters fall outside the visible chart window, defaulting to zero values. Additionally, ChartTimePriceToXY experiences inaccuracies in certain scenarios. Both functions exhibit slow performance.
To address these issues, a revised script demonstrates improved accuracy across all parameter ranges. It utilizes a method where X and Y coordinates are translated to time and price and then reverted back. Accuracy is validated if input coordinates match the output. A discrepancy indicates functional errors, notating the issue during execution. The script concludes by reporting the final outcome, remaining silent if functionality is assured.
π Read | AppStore | @mql5dev
#MQL5 #MT5 #script
To address these issues, a revised script demonstrates improved accuracy across all parameter ranges. It utilizes a method where X and Y coordinates are translated to time and price and then reverted back. Accuracy is validated if input coordinates match the output. A discrepancy indicates functional errors, notating the issue during execution. The script concludes by reporting the final outcome, remaining silent if functionality is assured.
π Read | AppStore | @mql5dev
#MQL5 #MT5 #script
β€21
Introducing a tool designed for technical traders focusing on delta metrics: Cumulative Delta, Net Delta, and their divergences. Key features include tracking aggregated buy and sell volumes through Cumulative Delta and analyzing the difference in buying and selling pressure via Net Delta for each bar. The tool also offers a session reset for tailored intraday analysis and includes EMA smoothing for more refined and legible delta curves.
Engineered to meet the needs of traders monitoring order flow dynamics and volume imbalances, these features allow detection of pivotal divergences. Such divergences include bullish and bearish indicators, where potential market reversals are highlighted. Additionally, hidden and exhaustion divergences provide insights into trend confirmations and possible corrections. This solution remains lightweight and fast, focusi...
π Read | Calendar | @mql5dev
#MQL5 #MT5 #OrderFlow
Engineered to meet the needs of traders monitoring order flow dynamics and volume imbalances, these features allow detection of pivotal divergences. Such divergences include bullish and bearish indicators, where potential market reversals are highlighted. Additionally, hidden and exhaustion divergences provide insights into trend confirmations and possible corrections. This solution remains lightweight and fast, focusi...
π Read | Calendar | @mql5dev
#MQL5 #MT5 #OrderFlow
β€20π4π₯2
The Liquidity Sweep on Break of Structure (BoS) system builds upon the inverse fair value gap concepts developed in previous articles, leveraging MetaQuotes Language 5 (MQL5) for enhanced functionality. The BoS strategy combines swing point identification with liquidity sweeps for detecting trend changes.
The system identifies swing highs and lows over a defined length, differentiating between higher highs (HH) and lower lows (LL) to set the BoS trend. A liquidity sweep is marked when prices wick beyond a swing but close inside on a directional candle, prompting potential reversals. The strategy executes trades on detected sweeps in accordance with the trend, with dynamic stop levels, trade limits, and pattern visualization.
Implementation in MQL5 involves creating a comprehensive program with dynamic inputs, ensuring readability, and implementing ...
π Read | Forum | @mql5dev
#MQL5 #MT5 #Strategy
The system identifies swing highs and lows over a defined length, differentiating between higher highs (HH) and lower lows (LL) to set the BoS trend. A liquidity sweep is marked when prices wick beyond a swing but close inside on a directional candle, prompting potential reversals. The strategy executes trades on detected sweeps in accordance with the trend, with dynamic stop levels, trade limits, and pattern visualization.
Implementation in MQL5 involves creating a comprehensive program with dynamic inputs, ensuring readability, and implementing ...
π Read | Forum | @mql5dev
#MQL5 #MT5 #Strategy
β€13π7π4β2
In the latest installment of the MQL5 series, the focus shifts towards developing a more advanced project involving the Binance API and MetaTrader 5. Having previously covered the basics such as retrieving 5 daily BTCUSDT candle data, this segment will focus on extracting and processing data from the last 10 thirty-minute candles.
Initially, MQL5 scripts will leverage the OnTick event to efficiently request new data without exceeding API limits. Data from server responses will be parsed into structured arrays categorizing open, high, low, and close prices. Following extraction, string data undergoes conversion into appropriate datetime and double formats.
This structured approach ensures precision in data handling, facilitating the development of custom indicators capable of visualizing real-time market data efficiently.
π Read | Signals | @mql5dev
#MQL5 #MT5 #MQL5
Initially, MQL5 scripts will leverage the OnTick event to efficiently request new data without exceeding API limits. Data from server responses will be parsed into structured arrays categorizing open, high, low, and close prices. Following extraction, string data undergoes conversion into appropriate datetime and double formats.
This structured approach ensures precision in data handling, facilitating the development of custom indicators capable of visualizing real-time market data efficiently.
π Read | Signals | @mql5dev
#MQL5 #MT5 #MQL5
β€23π3