MQL5 Algo Trading
393K subscribers
2.59K photos
2.59K 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 the pursuit for an even more authentic market simulator, leveraging random number generation can enhance unpredictability, hence rendering the simulation more intriguing. By following given coding tips, the generation of pseudorandom numbers is possible with minimal complexity. The inception of this is in tweaking the pivot point, which is still created the same, however, the changes will make it unclear whether the bar is ascending due to an already reached minimum or descending due to an already reached maximum.

Moreover, a change in quantity of segments between the opening and closing of the bar is achievable with a small piece of code, turning usual 9 segments into 11 segments. Although it appears simple, this alteration greatly diversifies the complexity we introduce in forming a bar. One should tacitly note that the definition should not be set to zero lest a division by zer...

Read more...
πŸ‘1
In elaborate programming procedures, numeric values often need to be input into an array. Today, we take a look at how a string array can be employed to streamline this process. The focus will be on a 2-dimensional array, yet the measures shared can be extended to an array of any dimension. It offers an elegant solution for managing numeric values and potentially simplifies more complex coding structures. Join the discussion on array manipulation and gain some new insights to enhance the development process.

Read more...
πŸ™4πŸ‘2❀1
A cohesive analysis has been developed covering the interpreting price dynamics and their direct application in trading. This analysis extrapolates a new engineering discipline and outlines its utility in deriving practical conclusions from observed price dynamics. The engineering approaches and algorithms utilized herein are aimed at providing sustainable profits.

Focusing on factors such as the moving average change rate, the normalized price speed, and the probabilities of upward and downward price movement, the analysis draws a comprehensive examination of how price dynamics are calculated and manipulated for trading.

Insights provided aim for the creation of a solid foundation for understanding the intrinsic mechanics of price dynamics and the determination of optimal take profit and stop loss values. The outlined method assists in the prediction of price probability distribut...

Read more...
πŸ‘4
Presenting the 'wd.Range_MACD' indicator, sourced predominantly from the original in-built 'MACD.mq5' in the MT5 terminal, with its copyright belonging to MetaQuotes Ltd. This distinctive tool calculates both the range difference between 'Signal lines and MACD' and the range of 'the last two MACD bars.' Offering additional array of information, it can accurately measure price cross-points, resistance/support levels, and trend transitions.

A quick glance into its mechanism: the direction of the 'MACD bar' (either upward or downward) indicates the trend of the current timeframe. A no difference scenario in the current 'MACD bar' compared to the prior one delineates a new resistance/support level. For example, a difference in range of 'Signal-MACD' of 12 pips and a range of the 'last two MACD bars' of 0 pips imply a resistance/support level based on the 'last two MACD bars' put at a pr...

Read more...
πŸ‘5
Analysis of the healthcare ETF (Exchange Traded Fund) XLV reveals varying factors possibly influencing its momentum and direction. A detailed scrutiny of related datasets, utilized via a multi-layer perceptron model, intends to predict some potential dynamics in the upcoming quarters.

Two noteworthy factors contributing to recent XLV performance include the conclusion of the COVID-19 health crisis, and the Federal Reserve's increasingly bearish stance, both inducing a sell-off pressure across market sectors. As these factors waned, a resulting impact on the healthcare sector and in turn XLV's performance was evident.

Diverse datasets are considered, including U.S. government websites, government agency websites, and third-party research data. Timeframes vary from daily to annual and weekly based on the source.

Examples of data sets under consideration include historical XLV perfo...

Read more...
❀3πŸ‘2
An insightful look at the many paths towards profitable algorithmic trading. Detailed exploration of strategies from head-on approaches to team work, along with an emphasis on knowledge acquisition, provides an enlightening perspective. Finding harmony amidst system development, error fixing and improvizations feed into obtaining a stable income from automated trading systems.

Possible challenges are addressed in the form of labor-intensive points such as EA selection, preliminary testing and real trading. Implementing a universal receiver is viewed as an essential component in managing these challenges efficiently.

The article further delves into EA and pattern work, emphasizing the necessity of optimization skills. The concept of inverted trade is discussed as a noteworthy feature in any EA, crucial for pattern understanding.

In conclusion, leveraging internal algorithms and set...

Read more...
πŸ‘3
The core functionalities of this Expert Advisor (EA) for automated trading are built around a simple moving average. A crossover strategy with the market conditions helps identify possible points of entry for both buy and sell orders.

Formulate the conduct of this EA via a diverse range of customizable parameters. The moving period, lot size, stop loss point, take profit margin, breakeven levels, desired breakeven distances, and pertinent trading hours allow accurate adjustments to suit various trading styles and classes of assets.

The incorporation of two breakeven levels enhances the EA's profitability. Following a profitable trade, the stop loss can shift to the breakeven point, thus safeguarding potential gains. Desired breakeven distances can be amended to fit trader preferences.

The trailing stop feature is instrumental in securing profits amid strong trends. As trades move f...

Read more...
πŸ‘3
The incorrect Actor policy and the lack of connection between the sampled action and the distribution learned by the Soft Actor-Critic model uncovered a potential issue. The model's policy likely depended on a randomly selected learning starting point, and the misaligned action sampling distorted the true value of actions. The optimal solution involves a stochastic model of the actor and sampling actions from the learned distribution. A buffer of random values was implemented to adapt the model's flexibility to complex, noisy data.

Updating was refined by harnessing the Adam method in the Soft-Actor Critic algorithm, allowing the model to adjust the ratios for individual trained parameters. This encourages fast parameters update in one direction and reducing copying speed in multidirectional oscillations, minimizing noise. Although it carries the risk of models imbalance at the trai...

Read more...
πŸ‘4
In the rapidly advancing world of software development, ease of use and efficiency are highly valued. A clear demonstration of this can be seen with the adaptation of drag-and-drop script functionalities. Now, setting a TakeProfit can be accomplished with simple point and click methods on the desired price level. This integration allows developers to streamline their workflow, minimize delays, and increase productivity, opening up new avenues for innovation within the field of programming. Embracing these advancements is the cornerstone for progress in this dynamic, fast-paced industry.

Read more...
πŸ‘4
Delving into the technical nuances of category theory’s influence on MQL5 for traders, this article takes a system-wide approach to unpack morphisms and how they can be utilized to forecast and classify financial data. Conceptually, a natural transformation, central in category theory, can be mistakenly viewed as a simple map between functors.

In this article, the real-world application of these theories becomes the focal point. The categories to be utilized in illustrating natural transformations will be two, the minimum number for a pair of functors to define a natural transformation. The indicator values category aims to clarify these concepts, playing a minimal role in the actual forecast.

Understanding how to normalize indicator values such as ATR and Bollinger Band values is the first step. These values are normalized with a fixed cardinality, and the changes to these values ...

Read more...
πŸ‘3
Introducing a streamlined way of setting StopLoss in trading systems. Now, traders can strategically plan their risk controls by simply dragging and dropping a script onto the desired price level. This innovative technology improves the efficiency of setting StopLoss orders, making the task straightforward and easy to perform. This handy feature is designed considering convenience and speed, promoting seamless and effective risk management. Assure the optimisation of trading decisions with the next-level convenience this tool provides.

Read more...
πŸ‘7
In the article "Applying Monte Carlo method for optimizing trading strategies," there's a discussion about permutation testing and how it can be used to optimize EA with MetaTrader 5. Unfortunately, the article doesn't take advantage of the full potential of this strategy as it suggests that there's no way to conduct such a test on arbitrary EAs within the platform.

To understand the essence of permutation testing, consider it as a scenario where we select a price data sample, conduct a test and record the performance criteria. This sequence is done repeatedly with various permutations of the original price series. This method is more robust the more times we permute and test, and can yield valuable insights into the performance of EAs.

This article aims to present a permutation method involving randomly permuted price data using MetaTrader 5, and we'll also go over how to prepare a...

Read more...
πŸ‘4
Experiencing difficulties using the iMomentum() function to get a valid Momentum in coding processes? Assistance is at hand with an easy-to-comprehend code, inclusive of basic principles, minimal functional elements and sound learning practices. This can be used as a foundation, alterable according to specific needs.

Increased understanding can be attained by establishing direct contact, for a detailed explanation of this code at https://www.mql5.com/fr/users/william210. One can also provide input on fresh ideas for development on the post at https://www.mql5.com/en/forum/453288.

There are additional free indicator codes available to aid in initial steps of Mql5 development β€” Bands Bollinger for beginners by William210 at https://www.mql5.com/en/code/46194, Ichimoku for beginners by William210 at https://www.mql5.com/en/code/46250, MACDr for beginners by William210 at https://www....

Read more...
πŸ‘6
In a recent shift from the Soft Actor-Critic algorithm, we now spotlight the Behavior-Guided Actor-Critic (BAC) technique since its introduction in April 2021. BAC distinguishes itself with an alternative approach allowing for a balance between environmental exploration and model operation, which the Soft Actor-Critic algorithm also aimed to achieve but had its limitations due to imposing restrictions on the trained models.

The unique trade-off of BAC lies in the introduction of an entropy component within the reward function, enabling us to maneuver the balance. However, it is crucial to note that this approach inevitably poses some constraints on the trained models. It demands a conceptual understanding of the probability of incorporating actions, a task somewhat tricky to execute for a continuous action space.

To conquer these challenges, the BAC algorithm swaps the entropy comp...

Read more...
πŸ‘4
A comprehensive algorithm, devised for trading strategy, roots its foundation in intricate technical indicators and detailed trend analysis. Illustrating its application is an MQL include file and an Expert Advisor, thus providing a hands-on understanding of the underlying mechanisms.

The crux of the script revolves around three custom classes - each with a distinct role in the schematic configuration. The Trend Class is the cornerstone that marks out the long-term trends, leveraging a spectrum of techniques including moving averages and price changes, to name a few.

At the heart of different types of trading signals resides the Signal Class. It is armed with universally-shared methods and attributes such as trend-related settings, take profit, and stop loss provisions.

Rounding off the trio is the Probability Class. This component meticulously computes statistics and probabilities...

Read more...
πŸ‘5πŸ€”3
In developing an automated strategy, refining our selection of indicators through progressive testing remains an essential technique. However, this introduces an optimistic bias due to the inherent noise of financial time series, leading to overfitting. One must gauge the degree of overfitting to mitigate its repercussions. David H. Bailey et al.'s academic paper "The Probability of Backtest Overfitting" introduces a method called Combinatorially Symmetrical Cross Validation (CSCV), aimed at estimating overfitting in strategy optimization.

CSCV is a step-by-step process that begins with the collection of necessary data for chosen performance criteria. It provides flexibility in selecting any performance metric, ranging from simple profit to ratio-based metrics. Ensuring consistent data collection for each test run guarantees a dependable valuation for all test runs.

CSCV then proce...

Read more...
πŸ‘4❀1
In today's article, gradual improvements are being introduced to the simulation system to achieve greater data consistency and processing efficiency. The need for a consistent behavior in the system is emphasized; a system that performs differently and unpredictably at various times cannot be utilized efficiently.

Addressing the issues of the existing system, the article explains the challenges in situations of high volatility - inefficient creation and presentation of 1-minute bars and synchronization issues. The solution demands a change in the system construction, which requires careful modeling and understanding.

The article proceeds to detail the process of introducing a new system for constructing 1-minute bars with the market replay service. Modifications are made to the service file and a new variable is added to help identify the time spent or required to create 1-minute b...

Read more...
πŸ‘5
Unveiling a highly functional MQL include file and an Expert Advisor, showcasing operative functionality of classes. This combination imparts a trading strategy founded on numerous technical indicators in conjunction with trend analysis.

The script features custom classes delineated to create and manage trading signals emerged from variegated technical circumstances. Taking a closer look, we find:

1. The Trend Class - Tasked with the responsibility of discerning the long-term trend using an assortment of trend-evaluation methodologies, including moving averages, price fluctuation, and composite analysis.

2. Signal Class - Serves as the foundational class for diverse types of trading signals and comes equipped with methods and attributes that are common to all signal types, such as designated take profit, stop loss, and trend-related configurations.

3. Probability Class - Dedicate...

Read more...
❀5πŸ‘4
Multi-Currency trading robots, offering the ability to trade, manage orders, and implement stop loss and profit strategies for more than one symbol pair from only one symbol chart, contribute significantly to efficient and effective trading. Triangular moving average indicator facilities their application, calculated in multi-timeframe or single-timeframe mode. The Multi-Currency Expert Advisor TriangularMA_MTF_MCEA, thereby, caters to traders' essential needs by leveraging the capabilities of MQL5.

Trading for 30 pairs, including EURUSD, GBPUSD, AUDUSD, among others, is possible. For brokers with special pair names with prefixes or suffixes, it offers input properties for pair name prefix and pair name suffix. Handling of prefix and/or suffix pair names is simplified. An option for Trading Session enables correspondence with trading time.

Signal calculation in this expert advisor...

Read more...
πŸ‘7
Continuing Design Patterns in Software Development: Presenting Structural Design Patterns. They're essential for understanding how classes form larger structures - a valuable tool for advancing software development skills.

Key subjects in this article encompass various Structural Patterns such as Adapter, Bridge, Composite, Decorator, Facade, Flyweight, and Proxy. Gain insights into their practical applications in the world of software development and their use in the MQL5 programming language for designing solutions within the MetaTrader 5 trading terminal.

Moreover, understand the role of Object Oriented Programming (OOP) in comprehending Design Patterns.

Concluding with Disclaimers: All information provided for educational purposes and is not prepared for trading or advice. Results are not guaranteed. Use this information at a personal risk.

A must-read for professionals aim...

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