MQL5 Algo Trading
389K 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
The concept of the weighted deviation is an extension of the simple linear weighted deviation model. With linear weighting incorporated into every calculation step, the result is an indicator that functions differently than the standard deviation when a linear weighted moving average is operative. Its responsiveness surpasses that of the standard deviation, reinforcing its utility in a variety of scenarios. This deviation indicator can be employed in the same way as any other deviation indicator for nuanced technical analysis. It offers a more refined data interpretation, thereby enhancing the overall efficiency of the trending strategy.

Read more...
πŸ‘5❀1πŸ‘1πŸ‘Œ1
Principal Component Analysis (PCA) is a widely utilized technique across various fields such as image processing, finance, and machine learning. PCA helps in reducing the dimensions of large data sets by transforming a set of variables into a smaller one that still encapsulates the majority of the information from the larger set. This process not only simplifies the data, allowing for easier visualization and analysis, but also enhances the efficiency of machine learning algorithms.

Key steps in the PCA algorithm include standardizing the data, finding the covariance matrix, eigenvectors, eigenvalues, PCA scores, and finally, obtaining the principal components. Standardization is crucial as it normalizes the data, ensuring that each variable contributes equally to the analysis and preventing bias due to varying scales or units.

Understanding PCA and its implementation can significa...

Read more...
πŸ‘8❀2πŸ‘2
Automated trading strategies continue to be integral in financial markets, aiding in the execution of complex trades with efficiency and precision. In the realm of algorithmic trading, the development of such strategies can be observed through various materials including code files. One example includes code files in the .mq4 format, designed for MetaTrader 4, which encompasses about 525 lines. This illustrates a standard scope for scripting comprehensible yet substantial automated trading algorithms. These strategies are not just about facilitating trades but also about enhancing performance by refining accuracy and decreasing time latency. Professionals interested in automated trading will find studying these strategies beneficial for understanding both the technical aspects and practical implementation in trading platforms.

Read more...
πŸ‘5❀2πŸ‘1
In continuing the discussion on automated EA (Expert Advisor) management for MetaTrader platforms, attention turns to interaction restrictions between the EA and the C_Orders class to prevent unauthorized transactions. Key enhancements include conditions that block the creation of new orders when specific limitations are detected, such as already having an open position on HEDGING accounts or a pending order ticket already in place.

Further exploration is given to NETTING accounts where automated EAs pose unique risks. Specifically, problems arise when the trading server on a NETTING account automatically adjusts the average position price, potentially causing significant financial loss if not correctly monitored and controlled.

To address potential volume control issues in automated trading scenarios, a trading volume limit is introduced. This involves implementing a static, global...

Read more...
❀11πŸ‘2πŸ‘2
In the realm of financial trading, analyzing market trends through bullish or bearish bars can be vital for strategy development. The provided sample code is designed to count the number of consecutive bullish or bearish bars in a trading data set. This functionality assists traders in quantifying momentum and potentially forecasting future market movements.

Developers and traders can utilize this code as a foundational tool, with the ability to modify or enhance it to better align with specific trading strategies or analytical frameworks. It stands as a practical example of applying programming skills to financial markets, offering both insight and utility for technical analysis purposes.

Read more...
πŸ‘6❀2πŸ‘1
Statistical arbitrage employs advanced mathematical models to exploit pricing inefficiencies among closely related financial instruments. Using methodologies such as correlation, cointegration, and the Pearson coefficient, this trading strategy enables the identification of paired assets with significant predictive price relationships.

Correlation in quantitative finance quantifies how two securities mirror each other's price movements. A positive correlation implies synchronized movement direction, whereas a negative correlation suggests opposite movements. Traders exploit these correlations to forecast future price behaviors.

Cointegration extends correlation by measuring the stability of the linear combination of two or more variables over time, suggesting a long-term equilibrium despite short-term individual variance. This forms the basis for pairs trading strategies, focusing ...

Read more...
❀4⚑1πŸ‘1πŸ‘1
In the rapidly evolving field of algorithmic trading, the integration of machine learning and data mining techniques has become essential for uncovering hidden patterns in financial data. Yun Li, Jennie Si, Guojing Zhou, Shasha Huang, and Songcan Chen have introduced a notable contribution, the "FREL: A Stable Feature Selection Algorithm." This research leverages the algorithm Feature Weighting as Regularized Energy-Based Learning (FREL) to enhance feature selection.

FREL is based on weighted nearest-neighbour classification, refining prediction accuracy by assigning appropriate weights to each feature. This method is differentiated from the standard k-nearest neighbor (k-NN) algorithm by utilizing weights based on the proximity of the data points, typically calculated using metrics such as the Manhattan distance.

The conceptual foundation of FREL lies within energy-based models, wh...

Read more...
πŸ‘4πŸ”₯2πŸ‘1
The new Expert Advisor (EA) tool focuses on trading signal efficiency by utilizing specific technical indicators across multiple timeframes. This EA initiates buy orders based on MACD divergence on the 5-minute chart, combined with conditions where the stochastic main line on the 1-hour timeframe surpasses its signal line within the 0-40 range. Additionally, a daily EMAs crossover where the 9-period EMA exceeds the 20-period EMA supports the buy signal, further validated if the 5-minute price bar closes beneath the 9 EMA of the daily chart.

Sell orders are executed under the inverse conditions. The EA's strategy includes precise entry points and exits based either on predefined stops and targets or when the 7-period RSI on any given chart exceeds the 77 mark, indicating an overbought scenario.

Optimized for minimal trading frequency, this EA requires extensive backtesting, ideally ...

Read more...
πŸ‘7πŸ”₯3❀1πŸ‘1
Continuing the examination of MQL5 wizard capabilities, Bayesian inference emerges as a significant statistical tool for updating probabilities with new data. This method remains particularly useful in forecasting time series, critical in financial markets where traders primarily analyze security prices and trade histories. The premise of Bayesian inference is to increase the adaptability of trading systems by continuously updating hypotheses, which potentially reduces curve-fitting errors during historical data tests and future applications.

Bayesian Inference operates on the formula P(H|E) = [P(E|H) * P(H)] / P(E), where H symbolizes the hypothesis and E stands for evidence. This formula facilitates recalibrations based on new data, though challenges remain in determining P(E|H) effectively.

Practical applications in trading using Bayesian inference can be typified through signal,...

Read more...
❀6πŸ‘2πŸ‘1
The updated "Simple Yet Effective Breakout Strategy" now incorporates additional functionalities tailored for proprietary trading firm challenges. Given the essential criteria for such challengesβ€”achieving target profits, adhering to maximum daily loss limits, and maintaining overall loss thresholdsβ€”the script now includes two key functions.

These functions are designed to automatically close all positions and cancel pending orders if the target profit is achieved or if the trades are nearing the maximum daily loss limit. It is important to note that the handling of the maximum loss criterion is dependent on individual trading strategies and risk management practices, and as such, is not integrated into this script.

The updated script requires users to configure specific parameters, enhancing its utility and adaptability in meeting the rigorous demands of prop firm trading challenge...

Read more...
πŸ‘5πŸ‘3
Introducing a versatile trading tool that enhances the functionality of your trading platform by alerting you when the market price crosses a specified value. This tool is designed for traders looking to monitor specific price thresholds that have not yet been reached, aiding in the validation of trading theories or alerting key price levels in real-time.

Users can configure the indicator to create bearish or bullish alerts and adjust the default time zone from GMT+3 to GMT, GMT+1, or GMT+2 according to their geographical or trading preferences. The interface allows for easy setup where users can simply click on the chart to set an alert at a desired price point. Once set, the alert locks in place, but can be adjusted with a simple keyboard command to change or reset the alert's position.

The indicator supports notifications through several channels, including basic on-screen alerts...

Read more...
πŸ‘7πŸ‘1
Understanding the core functionalities of a trading algorithm is essential for implementing effective strategies. Key elements include:

1. Verifying conditions for trade entry is crucial. This ensures trades are only executed when certain predefined conditions are satisfied, reducing unnecessary risk.
2. It is advisable to initiate buy or sell orders only at the start of a new candle to capitalize on fresh market conditions.
3. Automatically managing the count of open positions and applying trailing stops can help secure profits and limit losses.
4. Setting a fixed lot size in the input parameters helps maintain consistency in trade volume, crucial for risk management.

Each component plays a vital role in the architecture of a trading system, enhancing its operational efficiency and effectiveness.

Read more...
πŸ‘6πŸ‘3
In current algorithmic trading strategies, ensuring precise execution and management of trades is paramount. A sophisticated script often includes various key functionalities like condition verification upon entry, initiating trades only at the commencement of a new candle, automatic trailing stops, and fixed lot sizes defined in the initial parameters.

By integrating these features, traders can automate their processes, which helps in maintaining consistency and reducing human errors in trading activities. These capabilities are critical, especially in fast-moving markets, as they aid in risk management and can enhance overall trading performance. This approach emphasizes a structured trading strategy that brings both discipline and efficiency to algorithmic trading systems.

Read more...
πŸ‘5πŸ‘1
Understanding the implementation of trading algorithms is crucial for automating buy and sell orders on financial markets. This guide focuses on a systematic approach to trading functions:

1. Confirmation of condition entry is essential. This involves validating specific market conditions or trading signals before executing trades.
2. It's advisable to execute buy or sell orders only at the start of a new candle to capture the most recent market movements accurately.
3. An automatic trailing stop is useful for managing risk and securing profits as it adjusts the stop loss level according to the market's movements.
4. Setting a fixed lot size in the input parameters helps in maintaining consistency in the trade volume, reducing the impact of emotion-driven decisions on trading performance.

This structured approach aids in enhancing the precision and effectiveness of trading algorithms.

Read more...
πŸ‘6πŸ‘1
Understanding the core functionality of trading algorithms is crucial for developers involved in financial technology. This brief guide outlines the main functions necessary for implementing specific trading strategies:

1. Creating conditions for recognizing bullish and bearish patterns in market data is essential for initiating trades.
2. Ensuring that the algorithm only executes buy or sell orders at the opening of a new candle can prevent slippage and improve order execution.
3. Implementing a method to count positions and automatically apply a trailing stop ensures that gains are secured and losses are minimized as market conditions change.
4. Setting a fixed lot size in the input parameters helps maintain consistency in trade volume and risk management.

This framework assists in building robust trading algorithms capable of performing under various market conditions.

Read more...
πŸ‘8πŸ‘3❀1
Quantile Regression and Its Implementation in MQL5 for Enhanced Reward Prediction in Distributed Q-learning

Quantile regression significantly advances distributed Q-learning by modeling the probabilistic distributions of expected rewards which, unlike traditional methods, does not break the range of reward values into discrete sections, but rather divides the set of received rewards into several equally likely quantiles. This approach eliminates zero-probability rewards typically seen in sparse reward distributions and provides a more accurate depiction of possible outcomes at different quantile levels.

This article introduces the implementation of the quantile regression algorithm through MQL5, aiming to optimize expert advisors by integrating a robust framework for predicting median rewards values across various action outcomes. The unique method divides a dataset into equal proba...

Read more...
πŸ‘6⚑2πŸ‘€2❀1πŸ‘1
A new library is available that simplifies the creation and plotting of Volume Profiles in trading software. One of the key functionalities includes the `GetHVPrice` method, which identifies the price point associated with the highest volume within a specified range. This allows for a quick visual representation and analysis of market activity, crucial for data-driven trading strategies.

For developers interested in integrating this functionality, the library offers straightforward methods to instantiate and plot the required Volume Profile. This tool is designed to enhance analytical capabilities without complicated procedures, making it an efficient addition to any trading system development toolkit.

Read more...
πŸ‘11πŸ‘3
In the field of programming and data management, the utilization of SQLite within MQL5 has revolutionized the approach to handling macroeconomic calendar data. As of build 2265, direct SQLite support enables developers to manage databases without the need for external connectors. This advancement simplifies procedures like opening, closing, importing, exporting, and executing databases, enhancing the efficiency of data operations.

The article underlines the creation and manipulation of databases using a structured CDatabase class. This class facilitates various database interactions such as table management, data requests, and views handling, tailored suitably through native SQLite functions provided by MQL5. The class allows developers to handle complex queries and operations on data tables efficiently, demonstrated through comprehensive examples ranging from creating and updating t...

Read more...
πŸ‘5❀2πŸ‘1πŸ€”1πŸ‘Œ1
Discover an advanced trading algorithm that enhances decision-making in the forex markets. This expert advisor utilizes MACD divergence to identify potential buy signals when the stochastic main line surpasses the signal line and remains within specified oversold levels. Tailor your strategy with adjustable settings including control over the duration the stochastic indicator sustains within these levels, along with selectable candle periods.

The tool efficiently manages open trades, implementing closure based on the upper Bollinger band level at the trade initiation time. Stops are strategically set to match 100% of the target, enhancing risk management. Its multi-timeframe capability allows for the integration of signals from different timelines: detect divergence on a 4-hour chart, verify stochastic confluence on a 30-minute chart, and set targets and stops using 5-minute Bollinge...

Read more...
πŸ‘3⚑2πŸ‘1
This article delves into the integration and practical application of REST APIs in systems, focusing on the development of an advanced tic-tac-toe game using MQL5 functions and Python, facilitated by FastAPI. The primary enhancement discussed involves automating game moves to elevate the challenge and interactive aspect of the game. Additionally, considerable emphasis is placed on developing MQL5 test scripts to validate the interaction reliability and efficiency between the integrated systems.

For a seamless installation and execution, detailed instructions, particularly for Windows users encountering scripting restrictions, are provided. By constructing a comprehensive step-by-step guide, users can overcome potential installation and setup hurdles.

Key enhancements aim to make the tic-tac-toe game more autonomous through smart algorithmic decisions and to strengthen testing protoc...

Read more...
πŸ‘3πŸ”₯2πŸ‘1