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
The EA employs a custom indicator, RSI_MAonRSI_Dual, which triggers signals based on two lines intersecting. Signal interpretation is straightforward: below the 50.0 line suggests a BUY, above indicates a SELL. The system adapts to the selected 'Working timeframe' for detecting new bars and handles trading parameters like trailing on a bar or tick basis.

Market entries are controlled such that only one deal is executed per bar. In terms of direction, trades can be restricted to BUY only, SELL only, or both. Time control offers flexibility, allowing trade signal searches within specified hourly ranges, even crossing from one day to the next.

Critical trading settings include stop-loss and take-profit levels defined in points, with the option to disable them by setting values to zero. The EA supports dynamic lot size calculation based on constant value or pe...

πŸ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #EA
πŸ‘79❀43πŸ‘10πŸ‘¨β€πŸ’»9πŸ‘€6πŸŽ‰4✍3
The challenge of implementing multiple dynamic logistic regression functions has been addressed in a recent article. The primary issue is avoiding hardcoding when managing multiple data columns, adhering to clean code principles and DRY. The article critiques the traditional approach of creating multiple functions with static numbers of independent variables. In contrast, Python's flexibility with *args and kwargs allows dynamic handling, a feature less straightforward in MQL5. Nonetheless, a workaround can be achieved using strings and efficiently managing data within arrays.

One proposed solution is to consolidate data into a single array, allowing for dynamic manipulation within loops. This approach circumvents the limitations of dynamically creating arrays in MQL5, although challenges remain in resource management and processing speed. Storing...

πŸ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #Regression
❀31πŸ‘24πŸ‘¨β€πŸ’»3πŸ‘Œ2
In recent tests, 10 signal patterns using MA and Stochastic Oscillator were examined. Seven patterns were practicable over a one-year period, with two successfully using both long and short trades. The thesis behind the tests involves combining machine learning modes: supervised-learning (SL), reinforcement-learning (RL), and inference-learning (IL). In previous analysis, SL and RL integration showed how the RL model refines trading decisions beyond price changes, acting as a layer on SL decisions.

Deep Deterministic Policy Gradient (DDPG) is explored, applied for continuous action spaces. DDPG uses two neural networksβ€”actor and critic networksβ€”to estimate actions and evaluate their rewards, reducing noise impact and stabilizing training. The replay buffer aids in learning stability, using random sampling to prevent temporal correlations. The critic network esti...

πŸ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #RL
πŸ‘34❀16πŸ‘¨β€πŸ’»4πŸ†3
Explore the power of Larry Connors' RSI2 strategies in algorithmic trading with MetaTrader 5. Dive into three expertly coded intraday strategies for the S&P 500 index. Discover how the RSI2 framework leverages short-term mean-reversion, offering quick market insights beyond traditional tools like Bollinger Bands. Each strategy has been rigorously backtested on a 30-minute timeframe to strike a balance between noise and trading activity. Learn how to apply model systems for adaptable strategy development across various markets. Build your strategy mastery by blending proven techniques with innovative enhancements for optimized trading efficiency.

πŸ‘‰ Read | Freelance | Share!

#MQL5 #MT5 #Trading
πŸ‘17❀13πŸ‘¨β€πŸ’»5πŸ‘Œ4
We have implemented the Mitigation Order Blocks (MOB) Strategy using MetaQuotes Language 5 (MQL5) for trading institutional price zones. Transitioning to Part 13, the focus is on constructing a Head and Shoulders trading algorithm. The goal is to automate this classic pattern for market reversals, ensuring precise turn captures.

The Head and Shoulders pattern is recognized in technical analysis for trend reversals, appearing in both standard and inverse forms. Architecture of the pattern involves defining key peaks and troughs with specific breakout points for trading entries.

In MQL5, starting with including necessary trade management files, defining global variables, and setting up structures for pattern detection is crucial. Visualization requires accurate chart architecture, employing functions for graphical representation to ensure precise patter...

πŸ‘‰ Read | VPS | Share!

#MQL5 #MT5 #Algorithm
πŸ‘28❀17πŸ†3πŸ‘¨β€πŸ’»3πŸ”₯2
Technical traders rely heavily on indicators within their platforms, often combining multiple ones into a cohesive system. Streamlining the setup process for these indicators is crucial. For those interested in MQL5, crafting a panel directly on the chart to adjust settings can enhance usability. While ready-made panel codes exist, custom solutions may balance flexibility and ease of use. By organizing panel components into a structured layout with adjustable cell dimensions based on text size, traders can optimize their interface. Employing a class-based approach in code aids in managing objects efficiently, maintaining clarity across trading tools. Detailed implementations can be studied in various resources for further customization.

πŸ‘‰ Read | Freelance | Share!

#MQL5 #MT5 #Panel
πŸ‘39❀29⚑4😎3πŸ‘¨β€πŸ’»2πŸŽ‰1
The efficient management of computational resources is crucial when processing data across multiple lookback bars. Instead of recalculating values every time a new bar closes, it's advisable to utilize phval, phloc, plval, and plloc as buffers. These buffers can streamline data management and enhance performance. However, be aware that handling buffers requires manual management, as the terminal lacks native support for complex data structures as buffers. Ensuring optimal performance and accuracy involves maintaining these buffers yourself, which adds a layer of responsibility. This approach can lead to efficient and effective data processing in technical environments.

πŸ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #Algorithm
πŸ‘26❀18πŸ‘¨β€πŸ’»3🀯2
Dive into the innovative Archery Algorithm (AA) that reshapes optimization problem-solving by emulating an archer's precision. Developed by Fatemeh Ahmadi Zeidabadi, this stochastic approach enhances trading strategies using randomness and probability mechanisms. AA's population of agents, akin to archers, explores solution spaces through strategic position updates based on a target member's performance. The algorithm employs Gaussian distribution for randomness and memory features for retaining effective solutions. By introducing a modification allowing direct feature exchange among agents, performance surged over 13%. For traders and developers, AA offers adaptable models minimizing risks in volatile markets, elevating the precision of forecasts and investment strategies.

πŸ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #Algorithm
πŸ‘26❀8πŸ’―3πŸ‘¨β€πŸ’»2
Neural networks often intimidate newcomers due to complex terminology. Yet, foundational concepts remain straightforward. In linear equations, "weights" align with slopes, and "bias" with intercepts. Earlier, we explored constructing a neuron capable of learning through trial and error. Adjustments in slope and intercept were key to improving accuracy. Further, handling multiple inputs transforms the neuron into a versatile tool. Beyond foundations, the sigmoid function introduces non-linearity, enhancing learning capability. Each step solidifies understanding, paving the way for more advanced neural structures. Although theory can appear daunting, practical application simplifies these principles, making the study of neural networks an engaging endeavor.

πŸ‘‰ Read | Forum | Share!

#MQL5 #MT5 #NeuralNetworks
πŸ‘40❀21πŸ”₯2πŸ‘¨β€πŸ’»2⚑1😎1
Review of the Two Lines Indicator with RSI Fast and RSI Slow provides insights into combining momentum analysis with trend smoothing. By integrating the Moving Average, this indicator allows enhanced precision in detecting market trends. The intersection of the RSI Fast and RSI Slow lines can indicate potential signals for entry or exit. The concept leverages the strength of relative momentum provided by RSI and smoothens it with moving averages to reduce market noise. This method aids in clearer visualization of trend shifts, assisting in more informed decision-making. Careful analysis of these intersections could improve the effectiveness of trading strategies.

πŸ‘‰ Read | Forum | Share!

#MQL5 #MT5 #Indicator
πŸ‘30❀23😎5πŸ”₯3πŸ‘¨β€πŸ’»3πŸ’”2
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