MQL5 Algo Trading
390K subscribers
2.58K photos
2.58K 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
In a recent release, a four-step process is outlined for developers to count "X" times and then pass in their code. The first two steps involve establishing a variable to set the count limit and recording the counted limit. The process continues with comparison of the counter and count limit, triggering the passage of a designated code block when equal. It concludes with resetting the counter to avoid an infinite count.

Another technique integrating wait times is also brought to light. This method alternates between passing and waiting intervals in the code. Counter and waiter variables are initially set, leading to pass or wait activities dictated by the count and wait limits. The final step is resetting both counter and waiter to maintain the function’s continuity. Users can implement filtering conditions to the counter and waiter blocks as per their requirements.

For scenarios wh...

Read more...
πŸ‘5πŸ‘1
In the ongoing development of an Expert Adviser, a base system for order processing has been implemented, utilizing MetaTrader 5 platform. The aim is to create a system that works seamlessly with a real trading server for both demo and real accounts.

Initial functions in this system are basic, enabling operations with the trading server and ensuring accurate communication between the EA and the platform. In order to avoid unnecessary complexities, the system is designed to take full advantage of MetaTrader 5's support for working with a trading server.

An issue with user interface on MetaTrader 5 has been addressed to improve ease-of-applications for users transitioning from other platforms. A code adjustment has been made to change selections in MetaTrader 5 to resemble other platforms and provision for notifications has been integrated to alert users about chart object creation ...

Read more...
πŸ‘2⚑1
Fellow developers and technologists, here's an illuminating breakthrough into the process of restoring a historical position from trading deals. A position essentially, is a result of an executed trading order. Whereas obtaining open positions are straightforward, the complexity lies in retrieving already closed positions due to the absence of conventional functions to handle that. Yet, there's a workaround - complementing the unique ID assigned to each position.

This ID is what gets registered in deals affecting the position, such as opening, modification, or closure. By assembling a list of deals, links to positions associated with certain deals can be discovered. This way, the entry and exit deals for a position can be identified along with other key elements like time, and lot among others.

Building on that foundation, a loop can be used to generate lists of historical deals. Fo...

Read more...
✍4πŸ‘2πŸ‘1
Latest developments in multi-symbol, multi-period indicators have uncovered a more streamlined way to process and display data. Drawing styles can now indicate whether a buffer is colour or not, providing a unique perspective to IT professionals examining the data. The capability to determine the source array for the class buffer, expedites the data copying process.

New indicator object creations now allow for an immediate setting of Digits and the initial "empty value" of data and colour buffer. Additionally, indicator levels and values can be set at creation. This feature simplifies buffer colour assignments and indicator properties.

However, the most significant development lies in the ability of multi-period indicators to use multiple arrays per plot buffer. This reduces the need to remember narrower specifics, such as the array assigned to the indicator buffer or indirect ind...

Read more...
πŸ‘5πŸ‘1
A new script is garnering attention in the tech community for its unique approach to data management. Requesting rate updates every 50ms, this innovative script captures data and stores it in an array with remarkable efficiency.

Subsequently, the script performs an operation to identify both the maximum and minimum values contained within the array. This practical application of data science may greatly benefit sectors that require constant monitoring of fluctuations such as finance, weather forecasting, and IoT technologies.

Emphasizing on performance, speed, and accuracy, this script might revolutionize how developers track and analyze real-time data. A tool showcasing the blend of programming ingenuity and technical knowledge, the implications for its future applications in data mining and analytics are worth observing.

Read more...
πŸ‘7πŸ‘3🀑2❀1
In the realm of system development, APIs propel efficient communication between various applications. A noteworthy subset is the RestAPI, which simplifies interaction between diverse internet systems. Driven by straightforward principles, RestAPIs employ resources and identifiers to orchestrate data management. Unlike the once-popular SOAP protocols, RestAPIs offer a more streamlined alternative for system communication. These APIs can be implemented in various programming languages, reinforcing their preference among developers worldwide.

In a digital sphere, the term "API" reigns supreme. An API is essentially rules and protocols that facilitate inter-software communication. Their function extends to consolidating real-time data from other services, abstracting system complexity, and providing a dedicated, secure channel for interaction between applications. However, due largely to...

Read more...
πŸ‘5πŸ‘1
Evolution Strategies algorithms are optimization methods that mimic natural selection. Used primarily in machine learning and AI, they have been adapted since their emergence in the 1960s, subsequently becoming critical in solving complex optimization problems. By utilizing real vectors to represent solutions and various algorithmic operators, a more accurate solution space is achieved. Variants differentiate through their operators and population processing methods.

The (1+1)-ES variant, though less effective with complex problems, is a simple method that creates one child per parent, with the best solution becoming the future parent. This approach uses a random vector, modified per generations, until optimization.

The (ΞΌ,Ξ»)-ES variant generates Ξ» children from a population of ΞΌ parents, with the best replacing the parents. Created in 1965, this algorithm promotes a competition mod...

Read more...
πŸ‘4❀1πŸ‘1
Technical strides continue to be made in the field of AI-based mql5 programs, with ONNX (Open Neural Network Exchange) serving as an innovative force in transitioning towards machine learning. However, this technology does not come without its complexities. With many real-life projects demanding in-depth tasks such as extracting time-series data and deployment of multiple models, working with ONNX can become challenging.

ONNX stores an AI model but does not include all the necessary components to run the trained model elsewhere, making it crucial for developers to have a well-rounded understanding of its deployment. This article aims to address three key challenges: scaling and normalizing the data, introducing dimension reduction to the model, and effectively deploying ONNX models for time-series predictions. Readers should already possess a foundational knowledge of machine learni...

Read more...
❀5πŸ‘2✍1πŸ‘1
The script discussed here is designed to refresh all open charts in MT5, catering specifically to the needs of custom symbols which occasionally require updating. This tool proves useful in scenarios where multiple charts require simultaneous refreshment. The application of this script extends beyond the boundaries of just chart refreshment, making it a versatile addition to any developer's toolkit. Please note that the script will also assist with updating all active charts in a single action. This not only conserves time but also increases efficiency and productivity by minimizing manual refreshing needs.

Read more...
πŸ‘10❀2πŸ‘1
Higher timeframe candlesticks can provide invaluable insight into market direction, offering traders a strategic advantage. By utilizing MQL5 code to identify current candles as bullish or bearish, traders can align buy/sell signals with the prevailing market trend. This formulates a sort of virtual barrier, confining the signal generator to produce signals that dovetail with the trend. Such selective filtration helps enhance signal accuracy and reliability.

A D1 candlestick and the M5 price action on the right bound between daily period separators clearly paints a downtrend supported by the bearish nature of the Daily candle, indicating a higher selling probability. Trading strategies that harmonize with this example emphasize trades in line with the daily candlestick.

To develop a successful trading strategy, anticipate consistent analysis, testing, and refinement. Backtesting dif...

Read more...
πŸ‘5πŸ‘2✍1πŸ‘Œ1
Market liquidity can be defined as the saturation of a market with currency in forms such as orders and positions - making it easy for traders to execute large trades. Slippage, or the event of transactions being executed at prices that widely differ from the expected outcome, is the most significant obstacle faced by major traders. Large positions, worth hundreds of millions, are harder to handle, and market liquidity plays a crucial role in these situations.

Market makers help maintain market liquidity. Rather than manipulating prices for their advantages, they ensure stability in trading conditionsβ€”without them; markets face the possibilities of sharp price swings, high asset volatility, and quote gaps.

The concept of Automated Market Making (AMM) came to view in the process of decentralizing exchanges. However, AMMs have not significantly reduced price slippages and neither have...

Read more...
πŸ‘7❀2
The art of IT problem-solving can be seen in the two phases of optimization problems: the problem formulation and solution. In the first phase, components include input variables, objective functions, and constraint functions. The second phase deals with the mathematical approach to find the solution using an optimization algorithm.

Input variables are the mutable components of the problem that can be adjusted for maximum efficiency. These can range from integer variables, real variables, and even Boolean variables. For instance, in expert advisors, variables could be the moving average period or the TP/SL ratio at entry.

Objective functions come into play when there are multiple goals for a given problem. The simplest method to combine these goals is by creating a weighted summation of each. In situations where there are multiple objective functions, it's important to normalize a...

Read more...
πŸ‘6πŸŽ‰1
In the realm of technical optimization, employing two separate algorithms can yield impressive efficacy and circumvent limitations. Scrutinizing the hybrid optimization algorithm BFO-GA offers profound insights. Here, the principles of foraging optimization (BFO), inspired by bacterial behaviors, coalesce with the genetic algorithm (GA), an echo of natural selection and genetics. BFO brings to the table swift convergence and effective local search capabilities, while GA handles global search competently. By unifying the two, BFO-GA aims to resolve certain limitations, with BFO undertaking global search and GA overseeing refinement of local optima.

BFO-GA successfully incorporates the selection, crossover, and mutation mechanisms of GA to extend its strikes, while leveraging bacterial swarming for optimal solution seeking. Utilization of the roulette method in the algorithm aids in p...

Read more...
πŸ‘5
Taking a deeper analysis into the order system construction from a technical lens. In continuation from the previous article, here's a closer look into the last method in the C_Manager class and the EA code for implementation perspectives. Understanding how a system works in the current scenario is key for future developments and adaptations.

The functionality of the class C_Manager's function DispatchMessage as a cornerstone in the class development process is discussed. Detailed insights into the coding and sequence structures are provided. Including attention on aspects to prevent coding errors and their impacts.

In the C_Manager class's DispatchMessage method, a detailed explanation is provided about recursion and its rightful and wrongful use. The significance of this method and its functionality is emphasised, providing informative insights for new developers.

The article th...

Read more...
πŸ‘9πŸ‘1
Unveiling the fundamental strategy behind the QAlpha StockTrend product. Interested parties are encouraged to adapt and enhance this customisable tool as per their own requirements. The foundational strategy involves purchasing/covering immediately when prices surge past an 'n' bar high, and selling/shorting instantly when prices plummet below an 'n' bar low. This strategy has been backtested in the context of USDJPY trends from 2013-2023. Looking forward to observing if the curated deciphering tools can enable users to enrich these outcomes further. The strategy can be accessed via this link: https://www.mql5.com/en/market/product/114875. Be proactive and dare to innovate.

Read more...
πŸ‘7πŸ‘1
A new article focusing on enhancing the market replay service was just released. The text presents solutions to an existing user interface problem, primarily involving the account types detected by the EA (Expert Advisor). However, issues still persist with the replay/simulation system, particularly the inability to accurately report the account type attached to an asset. Techniques to resolve this while also making use of the MetaTrader 5 platform functionalities are elaborated on.

Unanswered is the recurring question - how to transmit this account type information into the EA? A viable solution appears to be through the use of an 8-byte block enabled terminal global variable. This solution is reliant on the peculiarities of the MQL5 language, highlighting the challenge of programming within its constraints.

The article then proposes enriching the replay/simulation system function...

Read more...
πŸ‘6πŸ‘1
Trading volatility remains a critical aspect of successful financial market operations. Today, attention is focused on the Chaikin Volatility (CHV) technical indicator. This piece delves into understanding the application of the CHV.

CHV is instrumental in measuring market volatility and may signal possible reversals. Its effectiveness can be further enhanced when used with other technical tools.

Starting with understanding the CHV's calculation, the discussion progresses toward the creation of a custom CHV indicator using MQL5-- a requisite for optimizing trading system performance.

Following this, different trading strategies are examined, including the exclusive use of CHV and integrating with other indicators. Examples include CHV crossover and CHV and MA crossover strategies.

It is worth noting that tweaking the CHV indicator, incorporating it into tailored trading systems...

Read more...
πŸ‘5πŸ‘1
Unlocking the potential of the immune system as an optimization mechanism can solve complex problems. This is the principle behind the Artificial Immune System (AIS) optimization method. The approach employs concepts of antigens (inputs), antibodies (solutions), and killer cells (optimization processes). Devised in the 1990s, it has been subject to constant growth and development, enhanced by variations and alterations.

Micro-AIS, a recent modification, uses simplified models and processing operations of normal AIS. Its strength lies in bringing ease to implementation. However, more complex problems may require a comprehensive immune system model.

Micro-AIS measures affinity, the similarity between antibodies and antigens, which acts as an indication of suitability. Higher affinity antibodies are selected for new antibody creation, though experiments have shown using the fitness fun...

Read more...
πŸ‘7❀2πŸ‘1🀣1
Continuing the journey of debugging and rectifying a complex replay system in a development environment poses intricate challenges. A system replete with mysterious bugs has been put under scrutiny, with notable anomalies associated with pointer operations and recursion in the context of C and C++ languages.

Minor modifications yielded a solution for one fault, although it is deemed necessary to extend revisions to ensure smooth operation of the program. Failure diagnosis revealed that the errors are associated with newer additions to the program, with their effects becoming apparent with increased usage.

The 'Service Busy' indicator glitch was rectified by implementing minor changes, avoiding the approach of turning a blind eye by removing the indicator altogether. As an alternative, minor code changes yield the desired results, without creating substantial implications on the pr...

Read more...
πŸ‘6πŸ‘2πŸ‘Œ1
Running scripts regularly is part of the developer's life. Scripts executed on the W1 and D1 timeframes can offer unique insights. The result of these scripting processes should be noted not only on the D1 timeframe but also on the M15 interval. The multiple perspectives allow a more thorough survey of the data. It aids in cross-analyzing the accurate calibration and efficiency of the scripts. Keep tabs on the outcomes across distinct periods to fine-tune script performance, ensuring optimal results.

Read more...
πŸ‘5πŸ‘Œ4✍3πŸ‘2❀1
Understanding reinforcement learning is crucial to developing optimal behavior policies within an exploratory environment. A key challenge that lies within this approach is the creation of an appropriate reward function, which typically demands significant human effort. The authors of "Beyond Reward: Offline Preference-guided Policy Optimization" have proposed an innovative solution to this problem with the Offline Preference-guided Policy Optimization method or OPPO. The OPPO method eliminates the requirement of traditional rewards and replaces it with the preferences of a human annotator between two environment trajectories.

The OPPO algorithm is a one-step method that models offline preferences and learns optimal decision policy without requiring separate reward function training. This is achieved by using two key factors of capturing information during the absence of offline dat...

Read more...
πŸ‘8❀1πŸ‘1