MQL5 Algo Trading
388K subscribers
2.56K photos
2.56K 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 methods for integrating online data into MetaTrader 5 Expert Advisors. The article delves into overcoming challenges of server response delays by employing communication channels and threading systems. It provides insight into creating local communication channels using objects, then transitioning to more robust solutions like services, leveraging global terminal variables for data exchange. This ensures seamless client-server interaction within the platform, even through timeframe changes. Such implementation not only advances algorithmic trading capabilities but also enriches developers' understanding of MetaTrader 5 features. Engage with these strategies for improved data handling in trading systems.

πŸ‘‰ Read | Quotes | Share!

#MQL5 #MT5 #ExpertAdvisor
✍26πŸ‘26❀11πŸ‘¨β€πŸ’»5πŸ”₯4πŸ€”1
Developers handling Expert Advisors (EAs) can benefit from integrating a code snippet designed to track account withdrawals effectively. Tracking withdrawals is crucial for adapting the EA's strategy, as many EAs remain on virtual private servers (VPS) to maintain consistent settings across time frames or chart templates. A common issue arises when EAs increase lot sizes to recover losses but fail to adjust them post-withdrawal, mistaking them for losses. This oversight can lead to strategies that unnecessarily escalate risk. Implementing this code will allow the EA to discern between withdrawals and losses, enabling it to decrease lot size after a withdrawal, thereby aligning risk strategy with the new account balance. Consider modifying the existing framework to incorporate this functionality, optimizing the EA's performance by maintaining an appropriate l...

πŸ‘‰ Read | VPS | Share!

#MQL4 #MT4 #EA
πŸ‘34❀13✍2πŸ‘Œ2πŸ‘¨β€πŸ’»1
Enhanced functionality has been introduced to your existing Expert Advisor, enabling withdrawal tracking on accounts where it is deployed. This addition assists in monitoring account withdrawals efficiently. Expert Advisors often run on VPS setups to maintain stability across parameter resets and chart changes. A key issue arises when these systems react to losses by increasing lot sizes without recognizing withdrawal transactions, which can skew trading strategies.

Withdrawal recognition is crucial because traditional EAs do not adjust lot sizes for withdrawals, only for losses. This adaptation is essential so that the EA can optimize its trading approach, ensuring sustainability by recalibrating lot sizes based on the actual account balance after withdrawals. The code modification not only monitors withdrawals but also intelligently adjusts the lot size relativ...

πŸ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #EA
❀26πŸ‘13πŸ‘2😈2πŸ‘¨β€πŸ’»1
A new initiative is underway to develop an indicator for identifying ranging market periods using a standard object with a dynamic anchor point. This tool features a non-lagging mechanism with two operational modes; it determines ranges either through a set point threshold or dynamically using ATR with a multiplier. By default, ATR is utilized for its suitability in this function.

To enhance visibility, a pseudo chart distinct from the original is created, allowing for differential candle coloring within identified ranges. The logic behind range identification is straightforward, with customizable ATR period and multiplier inputs. These customizations allow users to define market ranges according to their personal trading strategy preferences, accommodating both long-term traders and scalpers in recognizing varying market activities.

πŸ‘‰ Read | Calendar | Share!

#MQL5 #MT5 #Indicator
❀24πŸ‘17✍2πŸ†1πŸ‘¨β€πŸ’»1
Explore a new mathematical model of price movement in financial markets, departing from experience-based assumptions to establish a rigorous theoretical foundation. This model highlights the market as a complex system influenced by external factors, providing a structured understanding of price dynamics through interconnected quotes and their velocities. The interactions and feedback from various market participants generate complex oscillations in prices, similar to quantum mechanics, introducing probabilistic price movements. This innovative approach employs nonlinear equations to capture market dynamics, offering developers and traders a refined tool for analyzing and predicting market behavior based on statistical patterns and fluctuations.

πŸ‘‰ Read | Calendar | Share!

#MQL5 #MT5 #PriceModel
❀42πŸ‘27🀯4πŸ”₯2πŸ‘Œ2✍1πŸ‘¨β€πŸ’»1
This MT5 Expert Advisor leverages a combination of multi-timeframe candlestick pattern analysis and fundamental event filtering to execute trades effectively. It utilizes price action as its core strategy, focusing on candlestick formations like pin bars, engulfing patterns, and hammers across M5, H1, and H4 timeframes. A key aspect is the requirement for alignment between 5-minute triggers and the overarching H1/H4 trend structure.

Risk management is emphasized with a 1.5:1 risk-reward ratio, automatically setting take-profit at 1.5 times the stop-loss distance. Margin safeguard features include limiting margin usage to under 30%, adjusting position sizes accordingly, and employing dynamic stops through ATR-based volatility scaling or fixed distances.

The news filter prevents trade execution during high-impact news events, closing positions two hours pr...

πŸ‘‰ Read | VPS | Share!

#MQL5 #MT5 #EA
πŸ‘34❀19🀨3πŸ‘¨β€πŸ’»2⚑1
This new indicator provides a significant shift from the traditional zigzag indicators commonly used in market analysis. Traditional zigzags focus on highlighting past market swings with an inherent delay to confirm new swings. They are based on price action and primarily used for analyzing historical pivot points rather than detecting real-time signals.

In contrast, this dynamic, trend-based zigzag operates without lag to the current bar by leveraging the SAR trendβ€”a non-lagging, trend-following algorithm. Unlike previous trend-following zigzags, such as those based on the PSAR, which suffered from delays and produced invalid legs, this new approach ensures zero lag throughout its execution.

Integral to this structure is the backstep function, crucial for maintaining valid legs. By utilizing a specified number of lookback bars, it finds the highe...

πŸ‘‰ Read | AlgoBook | Share!

#MQL5 #MT5 #Indicator
πŸ‘21❀18πŸ‘¨β€πŸ’»6
Implementing efficient memory management in MQL5 is crucial for optimizing trading systems. Understanding stack and heap memory allocations, identifying memory lifecycle stages, and recognizing common pitfalls like excessive object creation or improper resource management can significantly enhance performance.

To measure and profile memory usage, developers can build custom tools due to the lack of native MQL5 support. Simple techniques involve setting benchmarks to study memory operations' execution speed, while memory pools can minimize allocation and deallocation overhead. Whether deploying object pools or advanced variable-size pools, managing memory manually improves performance consistency.

For data handling, employing circular buffers for time series and using cache-friendly structures ensure quick data access without bottlenecks. Advanced...

πŸ‘‰ Read | Signals | Share!

#MQL5 #MT5 #AlgoTrading
πŸ‘27❀17πŸ‘¨β€πŸ’»2
Understanding the nuances of control flow in programming is crucial, especially with statements like RETURN, BREAK, and CONTINUE. These statements manipulate the natural flow of loops and are key for efficient coding. The RETURN statement is often tied to function control, returning execution to the caller. It can end an application if misused in procedures like OnStart or OnInit, integral in environments like MetaTrader 5. BREAK is pivotal in exiting loops prematurely under specific conditions but can complicate when used in nested structures. CONTINUE demands caution, frequently leading to infinite loops if not managed properly. Grasping these concepts aids in writing robust, efficient code.

πŸ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #loops
πŸ‘29❀11⚑2πŸ‘¨β€πŸ’»2
Deepening the understanding of DDPG is pivotal for those navigating reinforcement learning. The initialization of the DDPG-Agent class highlights essential components: dual network architecture, separate optimizers, and efficient experience management. Dual architecture facilitates stable learning through separate actor and critic networks, with target networks maintaining weight consistency. The experience management ensures memory efficiency via a fixed-size replay buffer for off-policy learning.

Incorporating key mechanisms such as state-processing, exploration strategies, and device-management in action selection enhances algorithm robustness. Learning updates demand sufficient experiences, allowing meaningful batch statistics; the critic networks update using stable Q-targets, while actor network updates focus on maximizing Q-values.

Target net...

πŸ‘‰ Read | Quotes | Share!

#MQL5 #MT5 #AITrading
πŸ‘50❀25✍4⚑4πŸ”₯4πŸ‘¨β€πŸ’»2
The concept involves enhancing the iSAR indicator with the DRAW_FILLING style. This style fills the area between the price and the Parabolic SAR indicator, providing a clear visual distinction in trend analysis. An additional feature is the drawing of a rectangle on the right side, mirroring the filled area. This approach can help in better visual detection of trends and fluctuations by highlighting the zones that require attention. It's a useful modification for traders looking to improve their chart analysis capabilities. The integration of these visual elements into the iSAR indicator could offer significant benefits in interpreting market movements effectively.

πŸ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #Indicator
πŸ‘26❀22πŸ‘¨β€πŸ’»2⚑1πŸ‘€1
The article details the progressive implementation of the Hierarchical Vector Transformer (HiVT) for multi-agent motion prediction, specifically optimized for algorithmic trading using MetaTrader 5. The HiVT algorithm decomposes the problem into local context extraction and global interaction modeling, effectively enhancing prediction accuracy by analyzing dependencies in stages. The described model, CNeuronHiVTOCL, integrates various sophisticated techniques such as attention mechanisms and convolutional layers to accurately predict future trajectories. The HiVT uniquely introduces functionality to predict several potential outcomes and uses probability measures to determine the most likely trajectory, offering a robust tool for both traders and developers in algorithmic forecasting.

πŸ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #Algorithm
πŸ‘28❀13😁2πŸ‘¨β€πŸ’»2⚑1πŸ‘Œ1
Explore the advancements in enhancing MetaTrader 5 with the Trade Management Panel class for efficient trading operations. This initiative highlights a modular approach, integrating features like quick trade execution, risk management, and advanced pending orders, all consolidated within the NewAdminPanel EA. The class structure divides complex UI tasks, ensuring clear separation of market, pending orders, and batch operations. Utilizing helper functions and a central event system enhances maintainability and usability. Discover how these improvements streamline algorithmic trading, providing valuable insights and practical applications for both seasoned developers and newcomers keen on mastering MQL5.

πŸ‘‰ Read | NeuroBook | Share!

#MQL5 #MT5 #TradePanel
❀44πŸ‘36πŸŽ‰4πŸ‘Œ3🀯2πŸ‘¨β€πŸ’»2⚑1
The Expert Advisor (EA) is designed to monitor market dynamics by assessing the average pip movement per tick and average spread over a customizable tick count (MAX_TICKS). Additionally, it computes the average pip movement and spread over a defined time span (CHECK_SECONDS). By continuously tracking these metrics, the EA provides real-time insights into price changes and spread variations. Output is delivered both in the terminal and visually on the chart using the Comment() function. This functionality assists traders in assessing real-time market volatility and spread fluctuations, supporting more informed trading decisions.

πŸ‘‰ Read | Calendar | Share!

#MQL4 #MT4 #EA
πŸ‘30❀16πŸ‘¨β€πŸ’»3✍2πŸ‘Œ1
The post delves into the development of a Price Action Analysis Toolkit featuring a pivotal tool called the ZigZag Analyzer. This innovative tool employs the ZigZag indicator to efficiently draw trend lines by identifying key swing points, a vital aspect of technical analysis across various markets. MetaTrader 5 developers will appreciate the flexibility of MQL5, allowing the creation of adaptive trading systems. The article provides detailed insights into the system’s algorithm, focusing on efficient resource handling, accurate trendline and support/resistance drawing, and real-time adaptability. This technical prowess leads to clear actionable market insights beneficial for traders aiming for precise analysis and decision-making.

πŸ‘‰ Read | NeuroBook | Share!

#MQL5 #MT5 #Trendline
❀29πŸ‘17πŸ‘€5πŸ€”3⚑2πŸ‘Œ2πŸ‘¨β€πŸ’»2
Value at Risk (VaR) is central to market risk management in algorithmic Forex trading. It provides quantifiable assessments of potential losses over time periods, key to navigating Forex's volatility. Development efforts in MetaTrader 5 emphasize transforming theoretical VaR concepts into practical tools, leveraging Python for efficient integration.

Controlling drawdowns and optimizing portfolio via VaR are integral parts of dynamic position management systems. Key challenges include balancing between minimizing risk and achieving target returns. Optimization involves adapting the system dynamically, accounting for market conditions and maximizing efficiency while ensuring capital protection.

VaR's flexibility extends to varied trading strategies, enhancing grid systems' performance. Improved by systematic modifications like local trend adjustments and gri...

πŸ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #VaR
πŸ‘17πŸ”₯12❀10⚑5πŸ‘¨β€πŸ’»3
Point clouds provide a flexible 3D data structure, bypassing the complexity of meshes. Typically, researchers convert point cloud data into 3D voxel grids for deep learning models, but this introduces artifacts and increased data size. PointNet offers a direct approach by utilizing raw point cloud data. This model leverages point data's permutation invariance via a symmetric MaxPooling function, enhancing efficiency. The architecture supports both classification and segmentation tasks, handling 3D transformations effectively.

Implementation in MQL5 involves a new PointNet class, leveraging convolutional layers for feature extraction. This facilitates efficient point cloud classification within trading algorithms, integrating environmental state analysis.

πŸ‘‰ Read | Docs | Share!

#MQL5 #MT5 #PointNet
πŸ‘45❀26πŸ”₯7✍3πŸ‘2πŸ€”2πŸ‘¨β€πŸ’»2
An emerging library now enables read/write access to ".tst" files, which adhere to the MT5-Tester single pass format. This development opens new potential for engaging with trading, automated systems, and strategy testing within the MetaTrader 5 platform, notably referenced since beta build 2155. The file format can transform Tester cache-folder data into market products like analyzers or correctors for Tester results. This approach allows the combination of single passes, showcasing combined statistics and cleaning cache data by eliminating unnecessary passes. Users can compute optimal portfolios with suitable weighting coefficients, determine best trading intervals, and utilize interactive statistical visualizations. Additional features include calculating optimal money management and evaluating hedge position efficiency based on historical data. Result...

πŸ‘‰ Read | Forum | Share!

#MQL5 #MT5 #MT5
πŸ‘20❀19πŸ‘¨β€πŸ’»4
MetaTrader 5 has been enhanced with a volumetric historical dataset of fundamental calendar events, available for programmatic access. This library streamlines data management, offering integration for both the Tester and live trading scenarios. Source code comments in example scripts demonstrate library functionality, aiding users in accessing historical data that parallels the native MT5 terminal display. Additionally, the library facilitates the acquisition of future event information, enriching Expert Advisors and indicators with timely updates on significant calendar events.

A featured Expert Advisor utilizes NonFarm Payroll data, analyzing present and forecast metrics for strategic trading. For historical data access, a single run in the MT5 terminal is required to download approximately 60MB, after which it's retrievable within the Tester. ...

πŸ‘‰ Read | Quotes | Share!

#MQL5 #MT5 #Calendar
❀17πŸ‘13πŸ‘¨β€πŸ’»5πŸ‘Œ3✍1
For Expert Advisor development within MetaTrader, handling the initiation of a new bar poses a unique challenge since there is no built-in OnNewBar() event. Instead, developers need to track the opening time of the most recent bar to identify changes that indicate a new bar has started. This approach is implemented by using a static variable within the OnTick() function to persist data about the bar's opening time across calls. This method ensures that even when OnTick() is exited, the variable retains its value, allowing the detection of a change in bar time. Special care should be taken when the EA is first attached to a chart, as the initial bar open detection will differ, needing adjusted logic. Code samples compatible with MQL4 and MQL5 are available in MetaEditor's "Public Projects" under "FMIC.

πŸ‘‰ Read | NeuroBook | Share!

#MQL5 #MT5 #EA
❀29πŸ‘14πŸ‘¨β€πŸ’»4✍1