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
Explore the innovative approach to algorithmic trading with our automated Order Block Detection System, crafted in MetaQuotes Language 5 (MQL5). This system leverages smart money concepts by identifying key institutional order blocks directly on trading charts, a shift from traditional indicators. Traders can now visually assess zones of potential market reversal or trend continuation, thanks to a structured methodology that emphasizes price structure over arbitrary indicators. The comprehensive guide outlines the system's development, including price action analysis, MQL5 implementation, and robust backtesting, providing a valuable resource for developing advanced trading algorithms aligned with market dynamics.
#MQL5 #MT5 #AlgoTrading #Strategy

Read more...
πŸ‘37❀23πŸŽ‰7✍5πŸ‘¨β€πŸ’»5πŸ‘4πŸ‘€1
In the absence of a default event handling function for new bar openings in MetaTrader, developers must implement their own detection logic. By monitoring the opening time of the current bar, it becomes possible to react to a new bar formation when this time changes. The sample code provided for both MQL4 and MQL5 illustrates how to implement such a mechanism. It leverages a static variable to retain the bar’s opening time across multiple OnTick() events, distinct from regular local variables which lose their state upon exiting the function. This is crucial for accurately detecting when a new bar begins. Additionally, care must be taken when initially deploying the Expert Advisor, as it will interpret the first run as detecting a new bar. Special handling may be required for this scenario based on specific needs. Access to the full source code of this functi...
#MQL5 #MT5 #EA #Algorithm

Read more...
❀24πŸ‘18πŸ†1πŸ‘¨β€πŸ’»1
In the series on mastering log records in MQL5, the focus has been on developing a custom log library to surpass the limitations of MetaTrader 5's native logs. Key aspects covered include creating a robust structure using the Singleton pattern, implementing advanced persistence for audit trails, and classifying logs by levels. Flexibility in log output formats allows developers to cater to specific project needs.

The latest development introduces caching and file rotation to enhance file-based log storage. By caching log messages, the library reduces disk I/O operations, boosting performance. File rotation, based on size or date, ensures logs are manageable by archiving older logs and preventing excessive accumulation.

Real-world applications have shown significant performance improvements with these enhancements. Performance tests revealed substantial r...
#MQL5 #MT5 #EA #AlgoTrading

Read more...
πŸ‘23❀8πŸ‘¨β€πŸ’»1
The article highlights key insights for developing effective trading strategies in MetaTrader 5. It advises on spotting unreliable Expert Advisors (EAs) by examining claims about AI integrations and mentions the pitfalls of look-ahead bias and misrepresented AI usage. To avoid overfitting, it suggests utilizing longer data periods and limiting tunable parameters during optimization. The piece stresses the importance of considering commission and spread impacts in backtesting, especially for high-frequency strategies. It also recommends in-sample and out-of-sample testing to ensure model robustness, focusing on maintaining a consistent profit factor and keeping drawdown within acceptable limits.
#MQL5 #MT5 #Strategy #AITrading

Read more...
πŸ‘22❀8πŸ‘¨β€πŸ’»1
Recent research has highlighted limitations in deep learning-based time series modeling, noting that shallow networks or linear models often outperform them on certain benchmarks. As foundational models in NLP and CV advance, their adaptation to time series data remains a challenge. TEMPO is introduced as a generative pre-trained transformer model focused on time series forecasting. It uses GPT and a two-component analytical framework to address specific temporal patterns like trends and seasonality. TEMPO enhances prediction accuracy by decomposing time series data into components, enriching model performance through an innovative prompt-based approach. This approach combines trend, seasonality, and residuals for a cohesive forecasting solution.
#MQL5 #MT5 #TimeSeries #AITrading

Read more...
πŸ‘35❀33πŸ‘¨β€πŸ’»2
The code framework consists of three main components for handling economic news data in MetaTrader 5.

1. CalendarRetriever.mq5 (Script): This script fetches historical economic news events and stores them in the "Common" folder of the terminal. It outputs files such as `Countries.txt`, `Events.txt`, and `News.bin`, which are crucial for backtesting. Input parameters include a start date and an end date.

2. CalendarFile.mq (Include File): This file structures news data management within an expert advisor. It features classes like `CalendarFileWriter` for data storage and `CalendarFileReader` for data retrieval and processing during trading.

3. NewsBacktest.mq5 (Expert Advisor): This component leverages the stored news data to simulate real-time conditions in the strategy tester. It uses functions like `LoadEvents()`, `LoadCountries()`, and `LoadValues(...
#MQL5 #MT5 #Script #Strategy

Read more...
❀25πŸ‘13⚑2🀯1πŸ‘¨β€πŸ’»1
Discover how to master JSON parsing in MQL5 without a built-in library. This article guides you through creating a flexible JSON reader for MetaTrader 5, ideal for integrating web API data and local configurations. It covers parsing essential JSON elementsβ€”strings, numbers, arrays, and objectsβ€”and discusses converting MQL5 data structures into JSON. Practical use cases include fetching market data and transmitting trade logs. Learn to address challenges like special characters and whitespace handling. By the article’s end, you’ll craft a custom, robust JSON parser, enhancing your algorithmic trading strategies with dynamic configuration capabilities. Explore JSON integration seamlessly in your trading programs.
#MQL5 #MT5 #MQL5 #JSONParser

Read more...
πŸ‘17❀14πŸ‘¨β€πŸ’»3✍1πŸ”₯1
The construction of a custom Keltner Channel indicator in MQL5 requires an understanding of both its theoretical framework and practical implementation. This volatility-based indicator functions by using a Moving Average for centerline smoothing and an Average True Range (ATR) for the upper and lower bands, adjusting for dynamic support and resistance levels.

The development process involves decomposing the indicator architecture into core elements like input parameters, indicator buffers, and graphical properties. Buffers are utilized for storing the computed channel values, linked to graphical display components via MQL5 functions, ensuring adaptability to market volatility.

For visualization, custom canvas graphics enhance the indicator's output, providing a clearer, more informative trading tool. The modular design emphasizes separability of data...
#MQL5 #MT5 #Indicator #Strategy

Read more...
❀14πŸ‘12πŸ‘¨β€πŸ’»2πŸ†1
Soft Actor-Critic (SAC) is a powerful reinforcement learning algorithm known for its balance between exploration and exploitation. Central to SAC is the replay buffer, which stores diverse experiences for improved learning stability and efficiency. While simple implementations using Python lists or NumPy are effective for small problems, leveraging PyTorch or TensorFlow offers scalability and GPU acceleration.

The algorithm employs two critic networks to reduce bias and uses target networks for stability. Critic networks estimate Q-values crucial for policy updates, while the optional value network provides smoother targets. The actor network calculates action distributions aiding in exploration in continuous action spaces. For large-scale implementations, tensor-based approaches are superior in performance.
#MQL5 #MT5 #ReinforcementLearning #AlgoTrading

Read more...
❀15πŸ‘10πŸ‘¨β€πŸ’»4πŸ‘€2πŸ†1
Dive into the intricacies of MetaTrader 5's new Free Robots, offering a comprehensive suite of 28 Expert Advisors (EAs) designed around candlestick patterns and supported by technical indicators like CCI, MFI, RSI, and Stochastic Oscillator. These EAs provide traders with a dynamic approach to identify potential market reversals through tested patterns such as BlackCrows WhiteSoldiers, BullishBearish Engulfing, and more. Learn how each EA integrates a systematic logic flow β€” from pattern detection to trade execution and closure based on indicator signals β€” enabling developers to enhance their algorithmic trading strategies with precision and efficiency.
#MQL5 #MT5 #EA #Trading

Read more...
πŸ‘28❀15πŸ‘¨β€πŸ’»5πŸ‘Œ2
Exploring the intricacies of variables and functions, the article delves into how static variables help avoid unnecessary global variables, highlighting the role of functions as special types of variables that can return data types, unlike procedures. It explains the nuances of handling functions as constant variables across different programming languagesβ€”JavaScript, Python, C, C++, and MQL5. The text further clarifies the distinction and application of predefined variables in MQL5, which, while appearing as constants, can be modifiable under specific conditions using certain functions. This approach enhances code readability, maintainability, and security, crucial for developers working with algorithmic trading.
#MQL5 #MT5 #programming #variables

Read more...
πŸ‘28❀22πŸ‘¨β€πŸ’»11
A script has been developed to output a CSV file containing all Signal properties from the MQL4 Trade Signals functionality. This tool allows users to organize and analyze signals by their preferred metrics using spreadsheet software, such as Excel. Note that it only applies to MT4 signals and is limited to 1000 entries. To ensure accurate data extraction, make sure to activate the "Signals" tab in MetaTrader, so the platform downloads the necessary data.

The CSV will be stored in the terminal's "MQL4\Files" directory. Navigate to this folder through MetaTrader by selecting File, then Open Data Folder, and proceed to "MQL4\Files". Additionally, the source code for all CodeBase publications is accessible in MetaEditor's "Public Projects" section under "FMIC".
#MQL4 #MT4 #script #CSV

Read more...
πŸ‘27❀3πŸ‘¨β€πŸ’»1
Analyzing asynchronous operations in MetaTrader 5 reveals why templates close charts prematurely. Applying a template triggers a Deinit event due to the control indicator being removed from the chart. The template processing asynchronously ensures performance, but creates challenges for programmers unfamiliar with execution sequences.

Recent updates to the replay/simulation service involve crucial changes in the control and mouse modules. Modifications include new blocking mechanisms and improved object handling within different subwindows. A key aspect is handling synchronous vs. asynchronous operations efficiently to avoid execution errors and maintain chart stability. Adjustments like the addition of unique naming conventions for objects and new variables enhance flexibility and prevent conflicts.
#MQL5 #MT5 #MetaTrader #Algorithm

Read more...
πŸ‘24❀8πŸ‘¨β€πŸ’»1
Modularizing code enhances maintainability and development efficiency, especially for an Admin Panel in MQL5. This approach breaks monolithic code into independent reusable components like Authentication.mqh for security and AdminHomeDialog.mqh for the interface. Each module is encapsulated with specific functionality, reducing complexities in the main codebase.

The modular system allows seamless integration and updates of individual components without affecting the overall structure. Custom classes define key functionalities, ensuring scalability and collaboration across projects. Authentication and two-factor verification are managed for secure access, while the Admin Panel's modular nature simplifies future enhancements.

This strategy enhances readability, avoids errors, and facilitates collaborative development, crucial for efficient proje...
#MQL5 #MT5 #AdminPanel #Modularization

Read more...
πŸ‘34❀10πŸ‘¨β€πŸ’»4
Introducing BB-Xtreme EA, a sophisticated tool engineered for Bollinger Bands breakout strategies. It incorporates dynamic risk management features critical for effective trading.

Traders can tailor their initial lot size to match their account capabilities, ensuring adaptability. Stop loss and take profit are set in pips, offering traders control to safeguard gains and mitigate potential losses. Slippage control is essential for accurate order execution, especially in volatile markets. The EA includes an on/off switch for manual control over trading operations.

With customizable Bollinger Bands settings, traders can refine their breakout strategies. Capital protection is paramount; thus, a maximum drawdown limit feature is integrated to halt trading when thresholds are reached, preserving investment security. This comprehensive EA delivers a robust fou...
#MQL4 #MT4 #EA #AlgoTrading

Read more...
πŸ‘30❀17πŸ€”3πŸ‘¨β€πŸ’»3⚑1
Explore the power of association rule mining in algorithmic trading through algorithms like Apriori and FP-Growth. Learn how these techniques derive valuable insights by identifying frequent patterns and constructing meaningful trading rules. While the Apriori algorithm iteratively finds frequent item sets, FP-Growth optimizes the process by dramatically reducing database scans, making it ideal for larger datasets. These methods help develop trading strategies by interpreting complex data, reducing noise, and ensuring efficient computation. Discover how these innovative approaches are transforming trading algorithms by offering data-driven insights and enhancing decision-making processes for traders and developers alike.
#MQL5 #MT5 #ML #DataMining

Read more...
πŸ‘38❀11✍5πŸ‘¨β€πŸ’»5⚑2πŸ‘Œ2
Introducing a technical tool designed to aid in trend determination: the Visual assistant indicator. This indicator evaluates trend direction by comparing current and previous price actions. It presents changes visually, providing a straightforward method for analyzing market trends. Utilizing a dual-line approach, it assists in observing price movement dynamics. This can be an effective resource in assessing whether an asset is experiencing an upward or downward trajectory. Such tools can enhance analytical accuracy in decision-making processes. The indicator aims to streamline trend analysis, offering clear visual insight into market conditions, enabling more informed trading strategies.
#MQL5 #MT5 #Indicator #Trend

Read more...
πŸ‘31❀19⚑3✍2πŸ”₯2πŸ‘¨β€πŸ’»2
Harness the power of dynamic neural network design in MQL5. Delve into the transition from manual feature design to flexible architecture development. Embrace matrix operations to streamline weight and bias calculations, essential for building adaptable models. Learn how to implement a multi-layer perceptron (MLP) with changeable nodes, ensuring an optimal configuration for your data. Discover the importance of epochs and activation functions in training networks effectively. Utilize binary files for parameter storage, enabling easy access across programs. This approach fosters innovation in algorithmic trading, offering a robust foundation for developing custom AI solutions in MetaTrader 5.
#MQL5 #MT5 #Algorithm #ML

Read more...
πŸ‘36❀13πŸ”₯4πŸ‘¨β€πŸ’»4⚑2πŸ‘Œ2✍1
The latest version of MetaTrader 4 provides important security improvements, error fixes, and platform stability enhancements.

Read more...
πŸ”₯36πŸ‘28❀21πŸ‘¨β€πŸ’»5⚑4πŸ‘Œ2✍1
A script is available to generate a CSV file containing all MQL5 Trade Signals' properties. This CSV can be opened with spreadsheet software like Excel for sorting and analysis to facilitate copy trading decisions. The script covers MT5 signals and includes up to 1000 entries. For comprehensive data, ensure the Signals tab is open in the terminal, enabling data download. The generated file is located in the terminal's MQL5\Files folder. To access, navigate via MetaTrader's File menu to Open Data Folder. Note, code publications are accessible in the Public Projects tab of MetaEditor under FMIC.
#MQL5 #MT5 #script #CSVfile

Read more...
πŸ‘35❀15πŸ‘¨β€πŸ’»3πŸ‘Œ1πŸ†1