MQL5 Algo Trading
387K 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 article explores the implementation of a grid trading strategy using an Expert Advisor (EA) in MQL5 for futures contracts on MOEX via MetaTrader 5. The strategy automates order placements at specific intervals around a price range, capitalizing on market volatility through small price fluctuations. Key elements include the configuration of buy/sell limits, managing stop-loss and take-profit scenarios, and dynamically updating orders based on market movement. The approach emphasizes a balance between frequent trades for small gains and fewer trades for larger profits, making it suitable for both range and trend markets while ensuring risk management with clear stop-loss settings.

๐Ÿ‘‰ Read | Forum | Share!

#MQL5 #MT5 #GridTrading
๐Ÿ‘49โค44๐Ÿ‘จโ€๐Ÿ’ป5๐ŸŽ‰4๐Ÿ‘€2โœ1๐Ÿ”ฅ1
A trading strategy utilizing two custom "MA Other TimeFrame Correct" indicators can be a straightforward way to approach market analysis. In this setup, the Expert Advisor opens positions with a constant lot size, avoiding complexities such as Stop Loss, Take Profit, or Trailing mechanisms. Instead, trades close when an opposite signal emerges.

The process involves intersection checks, specifically comparing indicator values between bar #1 and bar #0 to generate trading signals. This method exclusively uses a 'Constant lot' approach for position size management.

Additional functionality includes an extended operation log via the 'Print log,' providing detailed insights into all trading activities. This supports systematic evaluation and refinement of trading tactics.

๐Ÿ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #Strategy
๐Ÿ‘40โค23๐Ÿ‘จโ€๐Ÿ’ป2๐ŸŽ‰1๐Ÿ‘€1
Explore the creation of custom indicators in MetaTrader 5 using chart objects, a step beyond traditional buffers and plots. This approach offers advanced flexibility, enabling the development of complex visual representations critical for identifying unique trading patterns and price levels. The technique allows dynamic illustration of Harmonic Patterns, fundamental in recognizing potential market reversals. By focusing on practical application, learn to pinpoint swing points, integrate Fibonacci levels for pattern validation, and label key chart areas. This methodology enhances precision in trade signal accuracy, providing valuable insights for both professional traders and developers seeking to create sophisticated MQL5 indicators.

๐Ÿ‘‰ Read | Calendar | Share!

#MQL5 #MT5 #Harmonic
๐Ÿ‘57โค21๐Ÿ‘จโ€๐Ÿ’ป8๐Ÿ‘Œ1
A new indicator has been developed for MT5, providing alerts for scenarios where Bollinger Bands and Envelopes converge on extreme values simultaneously. The system sends buy alerts for bullish candles opening and closing below both the lower Bollinger Band and the lower Envelope. Conversely, sell alerts occur with bearish candles that open and close above the upper Bollinger Band and the upper Envelope. Users have customizable input variables, including period and deviation settings for both Bollinger Bands and Envelopes. Alerts are available in various forms, such as push notifications, audible signals, and emails. The indicator features arrows for buy and sell signals on the chart and excludes drawing the Bollinger Bands and Envelopes directly onto the chart.

๐Ÿ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #Indicator
๐Ÿ‘46โค19โœ4๐Ÿ‘จโ€๐Ÿ’ป3โšก1
Explore how algorithmic trading leverages data clustering for practical use cases. Discover methods where clustering results are utilized independently or integrated as input to enhance trading strategies. Learn the theoretical foundations and practical implementations of clustering, with insights into using tools like OpenCL and KMeans. Delve into innovative approaches such as calculating statistics using labeled data and normalizing cluster distances for input into other models. Understand the value of probabilistic models in predicting market behavior, showcased by a practical downturn model giving insights into trading decisions, without the reliance on complex neural networks. An essential read for advancing your trading algorithm expertise.

๐Ÿ‘‰ Read | Freelance | Share!

#MQL5 #MT5 #Trading
๐Ÿ‘46โค37๐Ÿ‘€9๐Ÿ‘จโ€๐Ÿ’ป8๐Ÿคจ5โœ1๐Ÿ†1
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