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
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
Discover how to seamlessly integrate MetaTrader 5 with Discord using MQL5, enabling effortless communication between platforms. This article outlines the creation of a Discord Webhook, sending JSON-formatted messages, and using a custom class to simplify repetitive tasks. Learn how to include user and role mentions, utilize markdown for formatting, and manage bot identities for personalized messaging. Expand your trading toolkit by sending trade notifications from MetaTrader 5 directly to Discord, with options for embeds and image links. While webhooks have limitations, this integration provides a robust foundation for enhancing trader interactions and automated communications.

👉 Read | CodeBase | @mql5dev

#MQL5 #MT5 #API
27👍5👨‍💻21👌1
In the first article of a new series on MetaTrader 5, we delve into the "timestamp trap," a critical oversight in algorithmic trading that can lead to data leakage and unreliable models. We highlight how standard time-bars may inaccurately timestamp data, offering unfair advantages during model training. Instead, tick-bars, which form only after specific market activities, are recommended for data integrity. By using tick-bar construction, developers can ensure unbiased datasets, vital for accurate backtesting and trustworthy trading algorithms. The article provides practical code implementations for data extraction and cleaning, setting the stage for subsequent parts on feature engineering and model validation.

👉 Read | Freelance | @mql5dev

#MQL5 #MT5 #MachineLearning
27👍10👌4👨‍💻2
Efficient backtesting is essential for developing machine learning trading algorithms. Leveraging Python with Numba can substantially enhance a testing framework's performance, especially in high-frequency contexts. Numba, a Just-In-Time compiler, transforms Python code into fast machine code, rivaling C and FORTRAN speeds. Deploying Numba's decorators on Python functions significantly boosts Computational efficiency, particularly when handling loops and complex operations. This article illustrates optimizing a trading strategy tester, resulting in up to a 50x speed increase. Such enhancements enable rapid iteration and optimization of trading parameters, streamlining workflow for developers and traders focusing on algorithmic trading strategies.

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #AlgoTrading
25👍6👨‍💻2