MQL5 Algo Trading
388K 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
In the previous article, we examined merging MetaQuotes Language 5 (MQL5) with Telegram for signal generation and relay. This streamlined the sending of trading signals to Telegram. We now take a further step in integrating MQL5 with Telegram by sending a screenshot of the trading signal chart.

Instead of only the text portion, a visual representation, such as a chart screenshot, can add context and clarity to the signal. This article focuses on converting image data into a format compatible for embedding in HTTPS requests. This conversion is essential for including images in our Telegram bot.

The article is organized into four parts: overview of image encoding and transmission over HTTPS, implementation in MQL5, testing the integration, and conclusion. By the end, we will have developed an Expert Advisor (EA) that sends chart screenshots with trading i...
#MQL5 #MT5 #trading #finance

Read more...
πŸ‘30❀18πŸ‘¨β€πŸ’»6πŸ”₯1🀯1πŸ‘Œ1
MetaTrader 5 just leveled up algorithmic trading! Dive into how Restricted Boltzmann Machines (RBM), traditionally used with probability-based Energy-Based Models, are now optimized with Backpropagation thanks to GPU acceleration.

Explore how RBMs, acting as price-embedders, streamline price data complexities, providing a robust foundation for Multi-Layer Perceptrons (MLP). This approach facilitates dimension reduction and uncovers hidden data properties, empowering MLPs for better trade decisions.

Optimize your trading strategy with this innovative technique and see practical gains in trading stability during trend reversals. Learn how combining RBMs with MLPs can lead to diversification and a distinct trading edge.
#MQL5 #MT5 #TraderTips #RBMs

Read more...
πŸ‘55❀23⚑6πŸ‘5πŸ‘¨β€πŸ’»5✍3
Charts display trading activity using various visual indicators: Blue Zone as TP Zone, Red Zone as SL Zone, Blue Arrow for Buy signals, and Red Arrow for Sell signals. Blue Ticks represent Wins, while Red Crosses indicate Losses. To configure these on the desired chart, follow these steps:

1. Open the chart for the respective symbol.
2. Enter the magic number to filter trades by a specific identifier. A magic number of 0 will display all historical trades for the selected symbol.

This setup helps in tracking and analyzing trading performance visually, making historical trade review more efficient.
#MQL4 #MT4 #Forex #Trading

Read more...
❀25πŸ‘22πŸ‘¨β€πŸ’»4πŸ‘2
Applying mathematical theories can provide strategic advantages. One significant concept is Nash Equilibrium, formulated by John Forbes Nash Jr. Leveraging Nash's game theory in trading, especially through Python scripts and advanced statistics, can optimize strategies and decision-making.

Nash Equilibrium assumes each player knows the strategies of others, ensuring no unilateral gain from changing their strategy. This principle can guide trading in financial markets, albeit these markets are dynamic and rarely in perfect equilibrium.

Python scripts and a demo account with MetaTrader 5 can help identify negatively correlated symbols. By using the Hidden Markov Model (HMM) for predictive analytics, traders can refine strategies for better outcomes.

Integrate the HMM output with an Expert Advisor's (EA) strategy on MetaTrader 5. Key fu...
#MQL5 #MT5 #NashEquilibrium #AlgorithmicTrading

Read more...
πŸ‘14❀13πŸ‘¨β€πŸ’»7πŸ‘1
Artificial Intelligence and Neural Networks

Artificial intelligence and neural networks are often a subject of fascination. However, their core is not as mysterious as perceived. A neural network is a thoughtfully designed program that aims to achieve specific goals. Understanding this requires examining the algorithms and mathematical equations such as linear regression used in these networks.

Linear regression is an affine function, essential for neural network development. When constructing a neural network, it’s crucial to find values that best fit the data set, thus simplifying computation and optimizing performance.

In these articles, the focus will be on demonstrating these processes using MQL5 exclusively. This approach will illustrate that the right understanding and method can be applied across various programming languages, showcasing the c...
#MQL5 #MT5 #AI #NeuralNetwork

Read more...
πŸ‘27❀12πŸ‘¨β€πŸ’»5πŸ‘2
Algorithmic trading strategies enable quick, informed decisions, minimizing human error and emotional biases. Automated systems like MetaTrader 5 offer consistency by following predetermined parameters. Creating an Expert Advisor (EA) utilizing the Parabolic SAR indicator can successfully automate trade execution.

The Parabolic SAR tracks potential market trend reversals, using dots on a chart. Sensitivity is controlled by SAR Step and Maximum settings, aiding traders in identifying entry and exit points. This strategy excels in trending markets such as forex and commodities.

Implementation in MQL5 involves defining input parameters such as LotSize, SAR_Step, and SAR_Maximum, and handling trade operations through the Trade.mqh library. With properly tuned parameters, the strategy shows promise but requires continuous monitoring and optimization to ens...
#MQL5 #MT5 #AlgoTrading #Forex

Read more...
πŸ‘34❀17πŸ‘¨β€πŸ’»5✍1πŸ‘1
To analyze trading signal performance:

1. Access the provided URL.
2. Select a signal of interest.
3. Navigate to the Trading History tab.
4. Scroll to the bottom and select the History link.
5. Open your MT4 terminal and go to File > Open Data Folder.
6. Place the CSV file downloaded in step 4 into the MQL4\Files directory.
7. Input the file name (without the .csv extension) into the FILENAME field when loading the script.

This workflow enables efficient review and assessment of trading history, facilitating better decision-making based on historical data.
#MQL4 #MT4 #trading #forex

Read more...
πŸ‘34❀21πŸ‘¨β€πŸ’»4⚑3πŸŽ‰1
Markov chains are effective for modeling and forecasting time series data in finance. Their simplicity is a primary advantage, relying on probabilistic models without complex assumptions. They are beneficial for financial data, which often exhibit non-stationary behavior.

There are four main types of Markov chain models: discrete-time, continuous-time, Hidden Markov models, and Switching Markov models. The primary types are discrete-time, modeling a system over discrete steps, and continuous-time, modeling over an interval. Probability estimation, often via expectation maximisation, is key for using these models.

Markov chains predict future states based on current status and transition probabilities, making them suitable for various fields like finance, weather, and biology.
#MQL5 #MT5 #finance #forecasting

Read more...
❀37πŸ‘30πŸ”₯6πŸ‘¨β€πŸ’»6πŸŽ‰4
To use the script effectively on a Daily timeframe, review the results on both the D1 and M1 charts. Although the script wasn't initially designed to calculate support and resistance lines, it appears capable of doing so.

Key inputs:
- `Prediction_Bar >= -1`: 0 refers to the current bar, -1 to the next bar, +1 to the previous bar, and so on.
- `Win > 0`: Represents the length of the comparison window for stream similarity.
- `Num > 0`: Indicates the number of illustrated bars.

Color indicators:
- Aqua: The best match stream (shifted).
- DarkOrange: Bar close.
- Lime: Predicted bar.
- Red: Bar high.
- Blue: Bar low.
- Yellow: Predicted area.

Bar text indicates the similarity error for further analysis. The script's flexibility provides potential additional applications beyond its original scope.
#MQL5 #MT5 #trading #forex

Read more...
❀28πŸ‘18⚑6πŸ‘¨β€πŸ’»4😁1
Enhancing Tooltip and ProgressBar Controls in MQL5

Concept:
The aim is to refine the ToolTip control to function more like MS Visual Studio by introducing smooth appearance and disappearance behaviors. This requires implementing timers for graphical elements, using a list of active objects to track items needing timer processing. This approach supports animated interfaces with interactive visual effects. For this work, a timer event handler will be created for ToolTip and later for ProgressBar control.

Improvements:
1. Adding timer parameters for graphical elements on canvas.
2. Default values for ProgressBar control; adding progress line glare effect similar to Windows.
3. Describing control states and animation sequences for ToolTip.
4. Updated object property lists for enhanced sorting and selection.
5. Improved pointer handling and pause countdown meth...
#MQL5 #MT5 #Code #Library

Read more...
πŸ‘43❀30⚑5πŸ‘€5🀑4✍1πŸ‘1
Introducing a comprehensive indicator for plotting key Pivot Points: "Classic," "Camarilla," "Woodie," "Floor," "Fibonacci," and "Fibonacci Retracement." Users can select various timeframes for pivot calculation, offering flexibility in analysis. The tool allows for customization in width, color, and style, enhancing visual clarity. Additionally, the indicator supports multiple pivots with different timeframes on a single chart, providing a layered view of market levels. This all-inclusive approach aids in more robust technical analysis and decision-making processes.
#MQL5 #MT5 #PivotPoints #TradingIndicator

Read more...
πŸ‘33❀11πŸ‘¨β€πŸ’»5πŸ‘Œ1
Discover the power of alternative data with our latest analysis, focusing on VISA's Spending Momentum Index (SMI) as a predictor for EURUSD price movements. Delve into the utilization of a deep neural network to process intricate datasets and unlock potential market insights. Our robust methodology includes leveraging the FRED API for diverse economic data, optimizing neural network parameters, and employing feature selection to enhance model reliability. We highlight practical steps for integrating this approach within MetaTrader 5 using MQL5, and ensuring scalable implementation via ONNX format for seamless machine learning deployment. A must-read for enhancing your trading strategies!
#MQL5 #MT5 #AlternativeData #TradingAI

Read more...
πŸ‘28❀8πŸ”₯5πŸ‘¨β€πŸ’»3😱1πŸŽ‰1
Explore the fundamentals of matrix calculations in programming and enhance your coding expertise with MQL5. Understanding the power of matrices can simplify complex computations, especially useful in 3D transformations and graphical applications. This article breaks down matrix implementation in code versus traditional scalar methods, empowering developers to handle large data efficiently. Learn how to rotate and manipulate objects through concise matrix operations, providing a streamlined approach to algorithmic trading and beyond. Enhance your programming skillset, making your code faster, simpler, and more efficient with practical matrix applications. Dive into the detailed guide for hands-on learning.
#MQL5 #MT5 #programming #matrices

Read more...
πŸ‘42❀23πŸ‘¨β€πŸ’»7πŸ‘5πŸ‘Œ2πŸ†1
To acquire historical data in MetaTrader 5, the typical procedure involves using the "View > Symbols > Request" tool. However, this method occasionally omits certain data points that are present on the chart. An alternative solution is provided by a script that exports all available historical data to a CSV file. This file is located within the "Files" folder inside the "Common Data Path" directory. It is crucial to ensure that "Max bars in chart" is set to "Unlimited" under 'Tools > Options > Charts' to capture comprehensive data. This adjustment is necessary for the script to function effectively.
#MQL5 #MT5 #historicaldata #tradingtips

Read more...
πŸ‘23❀8⚑4πŸ‘Œ4πŸ€”3πŸ‘¨β€πŸ’»1
Brain Storm Optimization (BSO) is a population optimization algorithm inspired by brainstorming. It leverages collective intelligence to solve complex problems, making it suitable for multimodal optimization.

BSO addresses limitations of existing methods like niching and clustering, which require pre-determining the number of subpopulations. Instead, BSO dynamically transforms and clusters the search space, seeking multiple meaningful solutions.

BSO was developed by Shi et al. in 2015, with various versions like Hypo Variance and Global-best. Clustering, convergence, divergence, selection, and mutation steps are integral parts of BSO. The algorithm simulates brainstorming, generating new solutions by combining and modifying existing ones.

K-means clustering is used to group solutions, optimizing the search efficiency. This structured approach o...
#MQL5 #MT5 #algorithm #optimization

Read more...
πŸ‘23❀11πŸ‘¨β€πŸ’»2⚑1πŸ‘1
Discover the advancements in our replay system for MetaTrader 5. In this article, we delve into the creation of a new class, C_AdjustTemplate, to improve data modeling efficiency and streamline code execution.

We tackle the issues from the previous iteration by reducing repetitive setup calls and optimizing template manipulation. The C_AdjustTemplate class simplifies data handling by acting as a template file, making it easier to adjust and customize chart trades.

By reworking the C_ChartFloatingRAD class, we’ve enhanced functionality without increasing complexity. Perfect for traders and developers, this update ensures a more robust and efficient trading experience. Explore how these improvements can optimize your algorithmic trading strategies.
#MQL5 #MT5 #MetaTrader #CodingTips

Read more...
πŸ‘50❀27πŸ‘¨β€πŸ’»6πŸ‘3
This code offers a custom order panel compatible with both MT5 and MT4 platforms. Although the provided source is tailored for MT5, it can be adapted for MT4 with minimal changes. It's recommended to compile the MT4 version using the Controls library from MT5 for better efficiency.

Some issues related to template handling will necessitate minor adjustments in the standard Controls library, which are not included in this package. Additionally, note that the original program icon is missing.

For developers seeking to tailor the order panel to specific needs, this source code provides a flexible foundation. Adjust the Controls library as required to optimize template handling and enhance functionality on either platform.
#MQL5 #MT5 #trading #forex

Read more...
πŸ‘36❀10πŸ‘¨β€πŸ’»3πŸ‘2
Support Vector Regression (SVR) is a type of regression derived from Support Vector Machines. It utilizes kernel methods to map input data into higher-dimensional spaces, capturing complex relationships, unlike dimensionality reduction.

When applied to multi-layer perceptrons, SVR's loss function is pivotal. Differences between SVR and Gaussian Process Regression (GPR) are crucial. GPR projects mean with confidence intervals, suitable for uncertain or luxury product forecasts. SVR, robust to noise, works best with stable, everyday consumer goods as it minimizes the influence of outliers.

Class implementation for SVR in MQL5 involves the loss function focused on training rather than projections with kernels. Key parameters include the L2-Norm of weight matrices, regularization parameter, and epsilon margin.

Applications extend to custom signal and trailing stop c...
#MQL5 #MT5 #ML #AI

Read more...
❀50πŸ‘29😁5πŸ†4⚑2πŸ‘2πŸ‘¨β€πŸ’»1
The MCDx Smart Money indicator is essentially an advanced application of the Relative Strength Index (RSI). Here's a concise breakdown of its functionality:

1. The indicator starts by obtaining the RSI value for the specified period.
2. This RSI value is then adjusted by subtracting a predefined base value.
3. The result is further calibrated by multiplying it with a sensitivity factor.
4. The final value is constrained within a range of 0 to 20. Any result above 20 is capped at 20, while any result below 0 is set to 0.

This approach simplifies interpretations by providing a controlled range of values, enhancing the precision of signals.
#MQL4 #MT4 #trading #indicator

Read more...
❀30πŸ‘19⚑2πŸ‘¨β€πŸ’»2🀯1
Testing and optimizing a trading algorithm requires using MQL5's Strategy Tester to backtest the Expert Advisor (EA) against historical data. This article provides insights into interpreting various performance metrics such as profit factor, drawdown, win rate, etc., which indicate the algorithm's reliability and profitability.

A rapid-fire trading strategy profits from quick market movements by executing multiple trades in a short time frame. This approach contrasts with traditional strategies targeting longer-term trends. Automated systems like Expert Advisors are crucial for executing these trades efficiently.

Essential technical indicators for this strategy include the Parabolic SAR and Simple Moving Average (SMA). The Parabolic SAR identifies potential reversals, while the SMA smooths out price data and highlights trend directions.

Implementation in ...
#MQL5 #MT5 #trading #algo

Read more...
πŸ‘16❀11πŸ‘¨β€πŸ’»7⚑1πŸ”₯1πŸ‘Œ1