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
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
An Expert Advisor (EA) in MetaTrader automates trading by executing trades based on pre-set conditions. To create a simple EA: open MetaEditor by clicking F4 in MetaTrader, navigate to "File/New/Expert Advisor (template)," name the template "SimpleExpertAdvisor," and finalize it. This generated EA is devoid of trading logic but can be enhanced as required.

Functions in MQL5 such as "OnInit," "OnDeinit," and "OnTick" manage EA lifecycle events. "OnInit" initializes the EA, "OnDeinit" handles cleanup, and "OnTick" executes code whenever the market price updates.

Strategy Tester in MetaTrader backtests EAs using historical data, assisting in the evaluation of EA profitability. Users select a currency pair, set up a test period, and check EA performance under different conditions.

Understanding data types ("string," "double," "datetime," "integer," "bool") ...

👉 Read | AppStore | @mql5dev

#MQL5 #MT5 #EA
83👍12👨‍💻9👌2
Enhancing trading strategies requires careful consideration of risk management tools like Trailing Stops, which secure profits during reverse market fluctuations. Setting a Trailing Stop prematurely can result in losses due to the spread. The Trailing Star tool addresses this by activating the Trailing Stop only when specific conditions are met. It triggers the Trailing Stop once a predefined price or point entry is reached, aligning with profitable market conditions. This approach allows traders to optimize their strategies without constant oversight, providing flexibility in dynamic environments. Further exploration of such tools is available for those seeking to refine their trading techniques.

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #TrailingStop
34👍93👨‍💻2👏1
Vector Autoregression (VAR) models are crucial for analyzing time series data involving multiple variables. Unlike ARIMA, which focuses on univariate series, VAR models capture the relationships among several time series by considering their interdependencies. These models were introduced by Clive Granger in the 1960s and have since become significant in econometrics.

The key feature of VAR is its ability to model each variable as a function of its lagged values and those of other variables. This multivariate approach is beneficial in systems where variables influence each other. Implementation in Python involves ensuring data meets assumptions like linearity, stationarity, and no multicollinearity.

When applying VAR to financial data, particularly OHLC values, ensuring data stationarity is paramount. This typically requires differencing to stabilize me...

👉 Read | AlgoBook | @mql5dev

#MQL5 #MT5 #VAR
5713👍9🤓5👨‍💻5🎉2
The indicator is compatible with all symbols, functioning effectively across multiple time frames. It utilizes color-coded signals to clearly represent the prevailing market trend, distinguishing upward from downward movements. Users can customize several settings including time-frame, moving average (MA) period, shift, method, and price type for tailored analysis.

An example demonstrates the application of three MA lines over 5, 10, and 15-minute intervals displayed on a 5-minute chart. It's important to note that while the indicator plots the MA line, it does not display Heiken-Ashi candles. However, it computes Heiken-Ashi candle data, and the CalculateHeikenAshi function can be modified for new OHLC calculations.

Heiken-Ashi smoothed calculations deliver a robust trend-following tool, advantageous for swing trading and entry filtering. Alternativ...

👉 Read | Signals | @mql5dev

#MQL5 #MT5 #Indicator
44👍6🤔2👨‍💻21
An advanced indicator offers key configuration features for precise candle analysis. Users can define the SelectedWeek parameter to specify which week's candles are numbered. When set to 0, all candles are included, while a non-zero value limits it to the chosen week. The NumberFirstCandle option dictates whether numbering begins at the day's first or last candle. Dynamic filtering ensures only candles from the designated week are evaluated.

Text positioning is adaptive, placing numbers above bullish candles and below bearish ones, with spacing adjusted via the PriceOffsetFactor. Visual elements like color, font, text size, and anchor type can be tailored for clarity. The indicator maintains efficiency by deleting obsolete chart objects before anything new is created, minimizing resource usage. Input parameters allow customization in text position,...

👉 Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
20👍7👨‍💻2🤯1
Dive into the intricacies of the Atomic Orbital Search (AOS) algorithm, inspired by quantum mechanics principles. This metaheuristic method models optimization processes akin to electron wave functions around atomic nuclei, offering dynamic adaptability to changing environments. With an innovative approach to probability distributions and interaction dynamics, AOS efficiently explores solution spaces. Developers can leverage AOS for both minimization and maximization problems. The algorithm, through structures and classes, simulates atoms as layers, and candidate solutions as electrons, setting a paradigm shift in algorithmic problem solving rooted in quantum theory. Ideal for traders and developers seeking robust, adaptable solutions.

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #Algorithm
22👍8👨‍💻2
Huawei users with HarmonyOS NEXT can utilize MetaTrader 5 and MetaTrader 4, courtesy of DroiTong, a compatibility tool found in Huawei AppGallery. DroiTong enables Android app functionality on HarmonyOS NEXT, streamlining the availability of essential MetaQuotes applications.

Step-by-step instructions detail the installation process: download DroiTong from the Huawei AppGallery, acquire the necessary APKs like MetaTrader or Tradays, and utilize DroiTong to execute the installation.

To update, download the latest APK and follow the same steps, ensuring settings and data remain intact. Note that Push Notifications aren't supported. DroiTong facilitates seamless integration of financial tools on HarmonyOS NEXT.

👉 Read | Calendar | @mql5dev

#MQL5 #MT5 #MetaQuotes
30👍53👨‍💻3
Developing an Order Block Indicator requires understanding Smart Money Concepts. Order Blocks are critical zones on a chart where large market orders are distributed to avoid significant price shifts. Key in interpreting these areas is identifying candlestick patterns indicating imbalances in supply and demand.

Start with understanding price action. Four consecutive bullish or bearish candlesticks set the stage: the first indicates imbalance, and subsequent ones confirm it. On the intermediate level, incorporate volume indicators. A significant volume increase over 2-3 candlesticks or a spike in a key candlestick can validate an Order Block.

Configure indicator inputs to customize colors, rectangle options, and order block search range. Implement structures in your code to manage order block data efficiently. Initialize variables to store candle t...

👉 Read | Freelance | @mql5dev

#MQL5 #MT5 #Indicator
74👍166👌5👏3👨‍💻3🤔2
A dynamic and colored histogram transforms market analysis by adjusting colors based on key market conditions: MACD crossing the signal line, zero line movements, and trend strength/direction. Customization is emphasized, offering real-time sound alerts for critical MACD events with flexible sound settings, repetition limits, and pause durations between alerts.

The tool employs an intuitive color palette, enhancing quick interpretation of MACD states. Customization extends to adjusting moving average periods and price inputs, tailoring the indicator to your needs. The user-friendly interface simplifies setup, making it accessible for beginners.

Functionality involves calculating MACD and signal line differences, with color-coded histograms indicating crossovers and momentum shifts. Alerts announce pivotal events like line crossings. Benefits include ...

👉 Read | Freelance | @mql5dev

#MQL5 #MT5 #Indicator
34👍12👨‍💻2🏆1👾1
Proper implementation of replay and simulator systems utilizing MQL5 requires understanding advanced concepts like dynamic handle management and inter-function dependencies. Previous articles outlined theoretical foundations and initial code structures, but practical application demands further insight into these mechanisms.

In control indicators, discrepancies arose due to the unexpected persistence of the _LastError variable despite efforts to reset it. This situation suggests possible inter-chart leakage of information or unanticipated behavior in the MetaTrader 5 environment. Such issues necessitate a refined error-handling approach, ensuring only specific user-defined errors lead to indicator removal.

Dynamic handle management in services differentiates them from Expert Advisors and indicators, as services do not attach to charts. Static handle...

👉 Read | Signals | @mql5dev

#MQL5 #MT5 #Algorithm
57👍20👌9🏆7👨‍💻73🎉3
Simple moving averages are traditionally calculated using loops to sum up prices over a set period before dividing by the number of periods. While efficient for single instances, loop-based calculations can cause performance bottlenecks when scaling up. This latency can affect algorithmic efficiency, particularly in systems requiring multiple calculations. An alternative method is proposed that eliminates the need for loops in calculating the simple moving average. By optimizing the calculation process, performance can be significantly improved, allowing for faster, more responsive applications. Exploring loop-less implementations can be a worthwhile consideration for enhancing algorithm efficiency.

👉 Read | Calendar | @mql5dev

#MQL5 #MT5 #SMA
44👨‍💻6🔥1