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
Dive into the depths of MetaTrader 5 with this exploration into memory management, array manipulation, and advanced programming techniques like enumerations and variable arguments. Discover how to efficiently handle memory using the sizeof operator, and simplify code readability with enums. Learn the ingenious method of mimicking C/C++-like variable arguments in MQL5, enabling dynamic data transfer through string manipulations. This article not only paves the way for sophisticated MT5 applications but also provides fundamental lessons every algorithmic trader and developer should master. Unlock the true potential of MQL5 with these structured, step-by-step insights into advanced programming concepts.

👉 Read | Freelance | @mql5dev

#MQL5 #MT5 #Arrays
4812👍7👨‍💻2
This custom MQL5 indicator is designed to enhance trading strategies by detecting and visualizing divergences between price action and the Awesome Oscillator (AO). Divergences, often signaling potential market reversals or continuations, occur when price movements diverge from oscillator movements. This indicator incorporates several features to aid traders.

Key features include the detection of bullish and bearish divergences, identified by discrepancies between price and AO trends, such as price forming lower lows versus AO forming higher lows, or price achieving higher highs with AO forming lower highs. It visualizes these divergences on the chart using buy/sell arrows and trendlines, alongside a histogram displaying AO values.

The indicator utilizes buffers to store key data, ensuring that buy/sell signals, AO values, and aligned points for diver...

👉 Read | AppStore | @mql5dev

#MQL5 #MT5 #Indicator
36👍7👨‍💻52🔥1🤯1
The TuyulGAP.mq5 Expert Advisor for MetaTrader 5 targets gap trading strategies at the start of the week. It uses dynamic price action from the previous Friday to automate Buy Stop and Sell Stop orders. These orders rely on a range defined from the highest and lowest prices of a set number of past candles, positioned on Friday evening.

Critical features include automatic pending order placement, scheduled Friday execution, Monday pending order deletion, and a weekly restriction to one setup. Key input parameters like lot size, stop loss, and profit targets provide user configurability. The EA supports automated trading setups devoid of technical indicators, focusing instead on strategic end-of-week execution. This solution may appeal to traders seeking automated, rule-based weekend gap trading setups. The system aims for simplicity in configuration, alignin...

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #EA
27👍7👨‍💻4🔥1
The recent exploration of the SAR and RVI indicators in a trading context gained attention due to unique challenges and opportunities. Following rigorous backward testing, patterns indexed 1, 2, and 6 failed to perform well, prompting consideration of machine learning to enhance their predictive power. Implementation of SAR involves tracking trend reversals with precision, while RVI seeks to measure trend strength through momentum. Both indicators were developed in Python, leveraging pandas for data management and NumPy for computational efficiency. This dual-indicator approach emphasizes quantifying market signals to refine trading strategies, with emphasis on maintaining computational accuracy and signal validation.

👉 Read | VPS | @mql5dev

#MQL5 #MT5 #Indicator
22👍43🔥1👨‍💻1
Today, we address limitations of accessing News and Economic Calendar in MetaTrader 5 during active chart analysis. The current interface requires users to manually view separate tabs within the Toolbox, which can obstruct chart view when expanded.

To enhance trading efficiency, the proposed solution integrates news headlines and calendar events directly onto the chart. This approach leverages the MQL5 Standard Library and the CCanvas class to overlay dynamic content, maintaining full chart visibility. This method preserves space and delivers real-time economic updates without clutter, aiming to improve situational awareness and chart functionality.

Stay tuned for detailed implementation and testing outcomes.

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #EA
20👍5👨‍💻31
Logify's latest enhancement takes error handling in MetaTrader 5 to a new level of precision and accessibility. This update allows developers to access error descriptions directly from MQL5 documentation, effortlessly enriching logs with contextual information. Now, logs can include multilingual error messages, offering support in eleven languages from English to Korean. This provides comprehensive clarity across diverse teams without manual adjustments. Practical custom formatting for error severity further refines logging precision. By integrating a dynamic formatter that adapts by log level, Logify ensures concise, informative, and clear error reporting, replacing superficial codes with meaningful context. This evolution exemplifies meticulous, scalable logging solutions.

👉 Read | Forum | @mql5dev

#MQL5 #MT5 #EA
30👍8👨‍💻3👌2🏆1
Explore the innovative approach to minimizing lag in moving average crossovers for algorithmic trading in MetaTrader 5. By setting common periods for moving averages and forecasting crossovers, traders can achieve more responsive signals. This article demonstrates the application of data science principles, projecting datasets into higher dimensions to improve trading strategy accuracy. Practical steps include creating handcrafted, feature-rich datasets and using ONNX models for enhanced market predictions. This method offers potential improvements over traditional strategies, emphasizing the importance of creativity and critical thinking in overcoming technical indicator limitations. Discover how to elevate your trading strategies with these advanced techniques.

👉 Read | AppStore | @mql5dev

#MQL5 #MT5 #Indicator
26👨‍💻8👍5👀2
Directional Diffusion Models (DDMs) offer an innovative approach to graph representation learning by addressing the limitations of traditional diffusion models that rely on isotropic noise. DDMs incorporate data-dependent, directional noise, which slows down the signal-to-noise ratio decay, preserving crucial anisotropic structures. This leads to better feature extraction for downstream tasks like graph classification. The technique is particularly promising for financial market analysis, where asymmetric and directional patterns are prevalent. Implementing DDMs involves adding directional noise, using a novel kernel in OpenCL, and integrating it with MQL5 for practical application. The framework enhances MetaTrader 5 by facilitating the analysis of market trends and dependencies effectively.

👉 Read | CodeBase | @mql5dev

#MQL5 #MT5 #ML
18👍3👨‍💻1
Recent studies reveal a notable impact of weather on financial decisions. Research from Professor Edward Saykin indicates that rainy days lead to 27% more restrained trading behavior. High temperatures influence NYSE trading volumes, often reducing them by 15%. In Asia, low atmospheric pressure increases market volatility. By analyzing historical data from major financial hubs, the connection between weather and market dynamics is established. The methodology involves gathering data via the Meteostat API and synchronizing it with financial instruments using MetaTrader 5. Machine learning, particularly CatBoost, analyzes correlations, forecasting with significant accuracy, especially in agricultural regions. Weather factors notably affect currencies related to agricultural outputs. Regular updates and methodological refinements are essential for maintaining f...

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #Algorithm
51👍15🔥6🎉6🏆2👨‍💻2👀1
A new utility is available for developers requiring an effective method for converting Pine Script to MQL5. This solution is aimed at simplifying the conversion process while maintaining the core functionality of the script. For those in pursuit of streamlined and efficient conversion techniques, access to the compiled version is provided for practical use. Developers are encouraged to review the provided Pine Script code to understand the application and functionality that can be translated into MQL5. This approach supports the need for a seamless transition between scripting languages in trading and financial analysis environments.

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #PineScript
35👍7👨‍💻3
The library in question is designed for efficient decompression of GZIP archives, useful for both *.gz files and HTTP responses compressed using GZIP. Robustly tested on files containing up to 0.5 GB of text. It can automatically determine compression type by examining the fourth-byte flag, distinguishing between a compressed file and data from a site without filename metadata. Decompression expects data input in a char array format.

The primary function for decompression is CryptDecode(CRYPT_ARCH_ZIP, tmp, key, tx). It integrates a GZIP class for initial checks to confirm if data is GZIP compressed through its first three characters. Upon verification, one might choose from various unGZIP method overloads aimed at optimizing speed and memory usage. The decompressed data fills the char array tx, facilitating immediate processing by parsers like CSV o...

👉 Read | AppStore | @mql5dev

#MQL5 #MT5 #Decrypt
27👍7👌2👨‍💻2
Latent Gaussian Mixture Model (LGMM) offers a structured approach to uncover hidden patterns in financial data through a probabilistic generative model. By clustering data based on latent variables, LGMM enables traders to identify underlying trends and integrate these features into machine learning models. A key highlight of LGMM is its ability to handle data generated from multiple Gaussian distributions while revealing insights that improve model accuracy.

In a financial context, LGMM can be applied to the indicators data, assisting in the discovery of market patterns not visible at first glance. Using the Expectation-Maximization algorithm, LGMM estimates latent variables to optimize clustering. When combined with a classifier model, such as Random Forest, LGMM provides a robust foundation for developing predictive models and trading robots.

However, LGMM's...

👉 Read | Forum | @mql5dev

#MQL5 #MT5 #LGMM
23👍16👨‍💻3
The Levenberg-Marquardt algorithm, a Newtonian optimization method variant, is proficient for fast training of feed-forward neural networks. This algorithm excels in online training for neural networks adapting to dynamic trading conditions, minimizing the loss function in minimal training epochs. Although not currently implemented in MQL5, it stands as an efficient alternative to methods like L-BFGS.

The gradient descent variants, including momentum and stochastic gradient descent (SGD), demonstrate improved convergence for larger datasets. Gradient descent with momentum lessens parameter oscillations, enhancing convergence speed, while SGD remains efficient with vast datasets by updating weights for small data subsets.

Testing against algorithms from Python's scikit-learn highlights the competitive speed and precision of the Levenberg-Marquardt methodolo...

👉 Read | VPS | @mql5dev

#MQL5 #MT5 #AI
49👍135👨‍💻53👀3
The newly released Expert Advisor, EXSR version 1.0 for MetaTrader 5, offers a strategic approach to counter-trend trading by identifying market reversals at points of extreme price exhaustion. This EA employs a combination of a high-threshold RSI and Bollinger Bands to filter trading signals.

Key technical components include the RSI(14) to identify extreme overbought or oversold conditions, while the Bollinger Bands confirm price piercings at the outer band. Trade entries rely on subsequent reversal candlestick patterns: bullish closes following oversold breaks or bearish closes following overbought breaks.

EXSR incorporates a fixed Stop Loss of 150 pips and Take Profit of 300 pips, ensuring predefined risk management. The single-position logic prevents conflicting trades, while the clean OOP design utilizes CTrade for seamless order placement. This EA ...

👉 Read | Forum | @mql5dev

#MQL5 #MT5 #EA
29👍4👀42🏆2👨‍💻2👌1
Enhance your algorithmic trading with an innovative approach combining the MACD oscillator and OBV for strategic insights in the forex market. By leveraging these indicators, we can optimize pattern signals, trade entry gaps, and take-profit targets without relying on stop-losses. This methodology effectively enhances signal reliability by confirming trend reversals with volume pressure, using logical frameworks in MQL5 language. Ideal for detecting momentum and volume-confirmed setups in varying market conditions, each trading pattern is rigorously tested and refined. Suitable for developers and traders aiming to integrate refined strategies into their MetaTrader 5 systems.

👉 Read | AppStore | @mql5dev

#MQL5 #MT5 #Indicator
👍1812👨‍💻3🏆1
The integration of an external news API into the MetaTrader 5 platform significantly enhances the capabilities of the News Headline EA. This integration involves accessing financial market news through the Alpha Vantage API, retrieving concise headlines, and displaying them on the chart. This provides traders with real-time updates without switching platforms.

Key components include obtaining an API key, understanding the API documentation, and parsing JSON data. The WebRequest function in MQL5 is used to securely retrieve and integrate this data. The headlines are dynamically fetched and streamed across the trading chart in a scrolling ticker, adding valuable context for decision-making.

Testing is essential to ensure smooth API access and proper headline display. Proper setup includes enabling WebRequest for the Alpha Vantage URL in MetaTrader 5. Vali...

👉 Read | AlgoBook | @mql5dev

#MQL5 #MT5 #Integration
29👍6🎉2👨‍💻2
An Opening Range Breakout (ORB) strategy effectively manages early market volatility by establishing high and low thresholds in the initial moments of trading. Capturing this range is crucial for detecting genuine breakouts and mitigating false signals. Using a professional MQL5 Expert Advisor, this approach incorporates clear visual markers, retest confirmations, and volatility assessments. Core components include encapsulated range logic, ATR-based volatility filters, a retest confirmation mechanism, and a dynamic on-chart dashboard. The EA operates with a state machine design for structured execution. Employing modern MQL5 practices ensures robust, efficient performance, highlighting the flexibility and precision of automated trading systems.

👉 Read | Signals | @mql5dev

#MQL5 #MT5 #EA
40👍9👏2👌2👨‍💻2
The script is designed to handle transaction history export efficiently. It compiles data on all transactions for the past year for the current instrument. Key functionalities include support for both cryptocurrencies and traditional currencies with automatic commission calculations based on the instrument type. Numbers are formatted for readability, with totals for commissions, profit/loss, and trade counts appended at the file's end.

Usage instructions are straightforward: ensure trade history is loaded in your terminal, place the script on the desired instrument's chart, and execute it. This will generate a CSV file stored in the MQL5/Files directory, aptly named with trades_symbol_date_time.

The benefits are notable: ease of use, flexibility across various instruments, and transparency, with all data consolidated in one file. Remember to check t...

👉 Read | AlgoBook | @mql5dev

#MQL5 #MT5 #script
37👍743👨‍💻3
The article introduces the On-Balance Volume (OBV) indicator as a tool for analyzing volume trends in trading. It outlines the calculation method and emphasizes its applicability in algorithmic trading within MetaTrader 5 using MQL5. Detailed strategies, including OBV movement and strength, are provided, showcasing how to identify trend strength and direction. Practical code snippets show how to implement these strategies for automated trading, enhancing decision-making precision. This comprehensive guide equips traders with the expertise to leverage OBV for effective market analysis and strategy creation in MT5, combining technical knowledge with practical coding solutions.

👉 Read | CodeBase | @mql5dev

#MQL5 #MT5 #OBV
66👍19🤡6🏆6🎉5👨‍💻3
The indicator offers several customizable features for market analysis. It displays the moving Last Price directly on the Bid Line, providing real-time pricing data. Users can also monitor daily percentage changes for better market insights. Time display is flexible, with options to set it to Local, GMT, or the current time zone, suited for individual preferences. The visual representation is enhanced by allowing users to set distinct colors for Bear and Bull states, facilitating quicker trend recognition. Additionally, it includes a countdown timer showing the time left on the last closing candle, aiding in time-sensitive decisions. The ability to select the font enhances readability. This tool is designed for a tailored trading experience.

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #Indicator
39👍8👨‍💻4🤯1👌1