MQL5 Algo Trading
388K subscribers
2.57K photos
2.57K 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
Implementing a Relative Strength Index (RSI) bot offers a systematic approach to trading by issuing buy and sell alerts based on specific RSI thresholds. This bot is programmed to send a buy alert when the RSI falls to 20 or lower and a sell alert when it reaches 80 or higher.

Key parameters include:
- RSI averaging period set at 30 days.
- Calculation based on the weighted price.
- Alert thresholds configured at RSI levels 80 (sell) and 20 (buy).

This setup helps in identifying potential overbought and oversold market conditions, enabling traders to potentially capitalize on market reversals. It is essential for users to test these settings against historical data to ensure strategy effectiveness under various market conditions.

Read more...
❀43πŸ‘20✍2πŸ‘€2πŸ‘1πŸ€”1πŸŽ‰1
In the rapidly evolving domain of algorithmic trading, the ability to discern effective expert advisors for a portfolio is crucial. An expert advisor must be chosen based on its performance qualifications rather than potential promises. Here are pivotal exclusion scenarios when selecting or dismissing a trading bot.

Firstly, reject any expert advisor that relies on the developer's intervention post-purchase, as it raises questions about its autonomy. The same principle applies to bots requiring frequent manual inputs or adjustments, indicating a dependency that could hamper operations. Secondly, those bots exhibiting errors in initialization or throughout regular operations should be avoided, as these could indicate deeper issues in programming and reliability. Additionally, bots conditioned to perform under specific and often unrealistic market criteria or those that perform only u...

Read more...
πŸ‘23❀7✍4πŸ€”3πŸ‘1
A new tool is now available for efficiently capturing widescreen screenshots directly from your chart interface. By simply pressing the 'S' key on your keyboard, this functionality allows users to instantly take screenshots. Each captured image is conveniently named with the date of capture appended automatically, enhancing file management and retrieval. This feature aims to streamline documentation and analysis processes for users, offering a quick and organized method to record visual data.

Read more...
❀28πŸ‘23πŸ‘3πŸ‘Œ2πŸ€“2⚑1
In the evolving realm of computational optimization, the inheritance from a base class for population algorithms presents promising avenues for the development and enhancement of hybrid optimization methods. This technique facilitates the integration of various computational strategies such as genetic algorithms, particle swarm optimization, and others into a unified framework, advancing the efficiency of solving complex problems.

Utilizing a single base class streamlines the process of algorithm development by enabling the use of common interfaces and testing environments. This structured approach not only speeds up the evaluation of different optimization strategies but also simplifies the customization of algorithms to suit specific needs.

The creation of hybrid algorithms through this methodology allows for the amalgamation of the distinct advantages of various optimization te...

Read more...
πŸ‘16❀3⚑1πŸ‘1πŸ€”1
In the realm of trading automation, upholding strategic control while adapting parameters dynamically enhances outcomes. A sophisticated trading algorithm includes multiple key functions to regulate its operations efficiently:

- **SetParameters Function**: Adjusts essential variables including target profit, starting lot size, gain per lot, and ordering levels.
- **TargetProfit and GainPerLot Functions**: These methods allow for the setting and querying of profit objectives and gains expected per trading lot.
- **SqueezeDistance and SetHardSL**: Determine the strategic placement of orders relative to current prices and set a hard stop loss to manage risks.
- **Volume and Trade Count Functions**: Provide insights into active and pending trade volumes, crucial for assessing the strategy's market engagement.
- **Run, Stop, and Running Functions**: Control the operational state of the tr...

Read more...
πŸ‘23❀13πŸ‘4✍3πŸ”₯2πŸŽ‰2πŸ‘€2
In the realm of artificial intelligence, configuring powerful GPU environments is crucial for accelerating model training. This article highlights the process of configuring AMD graphics cards for training large financial language models, complemented by solutions to common challenges encountered with these setups.

Setting up an AMD environment involves multiple steps that differ from NVIDIA configurations. Ubuntu is recommended as the operating system, due to its current support frameworks. Hardware configurations require careful attention to detail, such as ensuring an adequate power supply is available and tweaking driver settings to optimize performance.

For training adjustments, using ROCm and the ROCm-SMI tool proves effective. These tools offer a multitude of commands for fine-tuning hardware settings, like adjusting clock speeds, setting the power limit, and configuring fan...

Read more...
πŸ‘12❀7πŸ”₯2😎1
Exploring the Multi-layered Utilization of Moving Averages in Trading Solutions

The Moving Average (MA) holds versatile applications in the trading domain, extending beyond the traditional time-series visualization on charts. This versatility includes its use as an oscillator and, intriguingly, as part of the envelopes' indicator framework. A distinctive configuration under investigation involves the 'Pythagorean Means'β€”namely, the Arithmetic Mean (AM), Geometric Mean (GM), and Harmonic Mean (HM).

The arithmetic mean, typically the first approach to calculating MA, is straightforwardβ€”the average of values within a set. In comparison, the geometric mean emphasizes smaller values more significantly, which is demonstrated through its mathematical formula. It maintains positivity across computations, ensuring representational accuracy regardless of negative inputs.

Harmonic Mean (HM), ...

Read more...
πŸ‘16❀12πŸ‘4🀯2
This enhanced version of the Time Segmented Volume (TSV) indicator, originally developed by Worden Brothers, Inc., offers customizable options for deeper data analysis. Users now have the flexibility to select the price type applicable to the formula, which deviates from just the default close price set in the original version. Additionally, this version introduces various volume weightings, including an option based on the true range, or even to operate without any volume weighting.

The indicator now features two types of moving averages: the traditional simple moving average as found in the original, alongside an exponential moving average for quicker responsiveness to price changes. The implementation is versatile, supporting both MQL4 and MQL5 environments through conditional compilation. For developers interested in customization or integration, the source code of this and other...

Read more...
❀31πŸ‘21πŸ”₯3🀝1
In the ongoing development of multi-currency Expert Advisors (EA) with multiple strategies, significant enhancements have been implemented to streamline and expand functionality without extensive code modification. The EA architecture now supports virtual pending orders including Buy Stop, Sell Stop, Buy Limit, and Sell Limit, alongside mechanisms for visualizing these orders to ensure the correct execution during testing phases.

Further improvements focus on the EA's ability to save its state, enabling it to resume operations seamlessly after a system restart or transfer between terminals. This is achieved by saving data concerning virtual orders and positions, ensuring continuity and stability across sessions.

Development efforts also led to simplifications in handling virtual pending orders by consolidating similar functionalities into a unified class to reduce redundancy. This a...

Read more...
❀12πŸ‘7πŸ‘3πŸ€“2⚑1
Understanding the integration of the Telegram Bot API with MetaTrader 5 can significantly enhance trading efficiency by enabling real-time notification and messaging capability directly from the trading platform. This setup facilitates immediate updates from trading indicators without necessitating the switch between different applications.

This integration uses a combination of Python scripts and MetaTrader's MQL5 programming language. The process involves configuring the Trend Constraint Indicator to send trading alerts to a Telegram bot, created via Telegram's BotFather. This allows users to receive instant indicator-based notifications on Telegram.

Key components for the integration include the Telegram Bot API, Python scripts hosted on a server to handle requests, and the MQL5 program customized to trigger alerts. While Telegram is the current focus, this methodology can be ada...

Read more...
πŸ‘12πŸ”₯7❀2πŸ‘¨β€πŸ’»2πŸ‘1😁1
Understanding the nuances of the Quadratic Mean (also recognized as the Root Mean Square) in financial analysis is pivotal for developers implementing it as a moving-average indicator. The Quadratic Mean is accurately applied only to datasets where all values are zero or positive. This entirely computational function yields congruent results to the Simple Moving Average (SMA) under this restriction.

However, the instant a dataset includes even one negative value, the Quadratic Mean no longer provides valid outputs, deviating substantially from what traditional moving averages would indicate. This limitation is critical to consider in practical applications, making it unsuitable for generalized use across typical financial datasets that might incorporate negative figures.

For developers and analysts, acknowledging these constraints is crucial when integrating or modifying indicators ...

Read more...
πŸ‘18❀15πŸ”₯2πŸ€”2πŸ‘1
Auto-optimization is crucial in trading strategies for maintaining reliability and consistent performance in the dynamic financial markets. Optimization of trading bots can prevent losses due to irrelevant data response and poor adaptation to market changes, thereby increasing overall efficiency and stability. Readers can expect to learn about various optimization techniques and algorithms, including brute-force, grid search, and random search, each offering a balance of thoroughness and efficiency based on the resources and time available.

For technical implementation, Python serves as a versatile tool allowing rapid development and testing of trading models with the capability of integrating historical data for strategy validation. For developers focusing on algorithmic trading, understanding and applying these optimization techniques are essential. Furthermore, detailed examples i...

Read more...
πŸ‘11❀3πŸ‘2πŸ‘Œ2✍1⚑1
The Zone Recovery Martingale Strategy is a sophisticated approach in forex trading designed to mitigate losses by initiating countertrades that leverage market reversals. This strategy, when automated via an Expert Advisor (EA) in MQL5 for MetaTrader 5, dynamically manages trades within specified price boundaries without requiring predictions of market direction.

The EA utilizes market analysis to establish initial and countertrades. If a trade goes against initial expectations, the system activates a countertrade of increased volume to potentially balance or profit from the situation. The coding process involves defining zone recovery levels and using the RSI indicator for trade signals. Assets are managed to ensure that each trade adheres to a precise hedging and averaging methodology, requiring a solid grasp of risk management.

Implementation requires imprinting detailed steps wi...

Read more...
πŸ‘9❀5✍5πŸ‘€2🀯1
In this discussion, the focus is on the Support and Resistance forex trading strategies utilizing MetaQuotes Language 5 (MQL5) for creating an Expert Advisor (EA) in MetaTrader 5 (MT5). Key areas covered include strategy definition, types, and the technical aspects of implementation in MQL5. The strategy revolves around the analysis and identification of key price levels that typically reflect pause or reversal trends, termed as support and resistance levels.

The article elaborates on different types of support and resistance such as round numbers, trendline channels, Fibonacci levels, and indicator-based levels. Each type serves distinct functions in trading, with implications for both strategy formulation and execution. Emphasis is placed on horizontal round numbers for practical illustration.

The practical section details the development of an EA in MQL5, highlighting steps from ...

Read more...
πŸ‘11❀2πŸ‘2πŸ‘€1
Exploring the utilization of Long Short-Term Memory (LSTM) networks for price prediction in financial markets reveals promising strategies for handling time series data. LSTMs are beneficial due to their ability to remember long-term dependencies, dealing with one of the key challenges in traditional Recurrent Neural Networks (RNNs). This capacity is crucial for modeling sequences where context from much earlier inputs (such as past price movements) significantly influences current outputs.

The practical application involves normalizing price data on a daily rolling basis, recognizing the importance of adapting to intraday volatility and ensuring the model isn't biased by significant singular movements. This normalization strategy uses the highest and lowest prices within a day to scale price action between 0 and 1, refining how the model views price relationships.

Methodologically,...

Read more...
πŸ‘11❀5πŸ‘1😎1
In the latest discussion on improving data communication between Expert Advisors (EAs) and indicators in MetaTrader 5, we focus on refining the process of reading data from an indicator, a vital step for developing robust trading strategies. The new approach involves creating a clear channel for indicators to send meaningful data back to the EA, enhancing the interaction and integration of the two.

In our proposed method, a header file `Defines.mqh` is used to streamline the naming convention across the EA and the indicator, which helps in avoiding any discrepancies during the development process. This setup facilitates a smoother workflow by ensuring consistent references in both the EA and indicator codes.

The core of this system relies on the indicator having the capability to write data to a buffer, which the EA can then read from. By implementing this model, it ensures that the...

Read more...
❀8πŸ‘6πŸ’―3πŸ”₯2πŸ‘2
Exploring a new approach to algorithmic optimization, researchers have developed an innovative experiment to investigate how algorithms handle scenarios with minimal initial diversity. The test involves initializing all agents at the global minimum instead of distributing them randomly, creating a challenging environment termed a 'degenerate population'. This setup aims to test the algorithms' abilities to escape local extrema and achieve a global maximum, a significant challenge in optimization tasks.

This approach is particularly insightful for studying the impact of diversity on the efficiency of optimization algorithms. By forcing all agents to start from a single point, the experiment allows researchers to explore strategies to maintain diversity and enhance algorithm performance under constrained conditions.

The findings from this experiment could lead to better strategies in ...

Read more...
πŸ‘8πŸ†3πŸ”₯2❀1😁1πŸŽ‰1
Understanding the intricacies of automated trading can significantly enhance strategy implementation and effectiveness. Key functionality includes the ability to adjust parameters such as target profit, starting lot size, and gain per lot through methods like SetParameters. This flexibility ensures that traders can tailor strategies to fit market conditions and personal risk tolerance.

Accurately setting and retrieving target profits is crucial, manageable via the TargetProfit methods. Adjusting for gain per lot with GainPerLot, and controlling order placement through dynamic adjustment of order distance with SqueezeDistance, allow for optimized entry and exit points.

For managing risk, methods like SetHard-ST allow for precise stop loss settings, safeguarding investments against market volatility. Analyzing trading volumes through LongVolume and ShortVolume functions offers insight...

Read more...
❀6πŸ‘4πŸ‘2πŸ€”1
The scrollbar's functionality in UI design is critical for effective user navigation through content-heavy applications. Addressing user needs for clear and functional interfaces, this article outlines the development of an enhanced scrollbar that dynamically adjusts its slider based on the content's visibility within a container. By improving the responsiveness of horizontal and vertical scrollbars, users can accurately gauge the relative position and amount of the unseen content.

To boost the application's performance and scalability, modifications are introduced in the MQL5 library classes. These include setting a minimum slider size to prevent it from being too small to manipulate and customizing the step size for shifting container contents, ensuring more precision and smoother scrolling experience. Additionally, crucial modifications ensure that graphical elements accurately up...

Read more...
πŸ‘10✍3πŸ‘3πŸ€“1
Introducing an advanced technical tool, the Adaptive R207;SI indicator, which calculates using tick data to provide a detailed analysis of market dynamics. Separate from standard tools, this version enhances its utility by incorporating both fast and slow moving averages displayed in an additional analysis window. It permits users to adjust calculation periods, choose from different moving average types, and alter visual settings for optimized clarity and usability.

Originally converted from a 2008 MT4 Rosh-developed indicator at Trend Laboratory, the upgraded version now seamlessly integrates with MT5, replacing the default RSI indicator to offer a more robust and precise market evaluation. The Adaptive RSI's key features include a green tick price plot alongside a blue fast RSI line and a red slow RSI line, collectively providing comparative insights against MT5's default RSI, thus...

Read more...
❀7πŸ‘6πŸ‘2