MQL5 Algo Trading
387K 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
Deep Q-Networks (DQNs) leverage neural networks to improve reinforcement learning for trading, enhancing traditional Q-Learning by predicting future actions and rewards in complex, high-dimensional markets. Key advancements include using a neural network for mapping Q-values, enabling DQNs to handle dynamic environments and adapt to new data. The target network offers stability, reducing oscillations by periodically syncing with the main network. Experience Replay is employed to train DQNs with diverse, randomized environment samples, thus mitigating overfitting. These techniques help traders develop robust algorithmic strategies and adapt to the fast-changing financial market landscape.


#MQL5 #MT5 #ReinforcementLearning #DQN

Read more...
πŸ‘19❀6πŸ‘4πŸ‘Œ3πŸ‘¨β€πŸ’»3
Debugging is an integral part of software development, and its importance is magnified in MQL5 programming. Debugging involves identifying and fixing errors to ensure code executes correctly across various conditions. Common bug types in MQL5 include syntax, logical, and runtime errors. Syntax errors hinder compilation, logical errors produce incorrect outputs, and runtime errors occur during execution.

Key tools for debugging in MQL5 are MetaEditor, print statements, and error logs. MetaEditor provides syntax highlighting and error indication. Print statements are helpful for tracing variable values, and logs can provide execution insights.

Effective debugging strategies include revisiting documentation for error clarification and using MetaEditor’s debugger for step-through execution. These processes enhance code reliability and performance, fostering ...
#MQL5 #MT5 #Debugging #MQL5

Read more...
πŸ‘27❀23πŸ”₯5πŸ‘¨β€πŸ’»5✍3πŸ†3🀯2
With the native Python integration, you can apply the full range of mathematical and statistical libraries from this language to analyze market data within MetaTrader 5.

For those interested in Python, we have collected over 200 useful videos, including:

βœ“ Installing Python and creating your first script
βœ“ Developing useful scripts for automating manual tasks
βœ“ Collecting and analyzing price data
βœ“ Building trading robots
βœ“ Integrating with AI, including ChatGPT

You can discuss your ideas or ask questions in a dedicated forum thread with other Python developers.

Share your experiences and expand your knowledge
❀43πŸ‘30πŸ”₯8πŸ‘¨β€πŸ’»7⚑6
An advanced indicator is now available that calculates and plots the exponential moving average (EMA) of the true range. Additionally, it computes an offset of the EMA of its deviation. This tool is compatible with both MQL4 and MQL5 due to its use of conditional compilation. Developers can find the source code for this indicator, along with others, in the "Public Projects" section of MetaEditor under the name "FMIC". This resource provides an opportunity to enhance programming skills and indicator comprehension in both MQL4 and MQL5 environments.
#MQL5 #MT5 #Indicator #EMA

Read more...
❀22πŸ‘19πŸ‘¨β€πŸ’»3πŸ”₯2✍1
Code locks, also known as digital or combination locks, are keyless security mechanisms used for access control across various sectors, including residential and commercial buildings. They enable users to program unique codes and offer the flexibility of multiple user access. Key benefits include high security, given regular code changes and user convenience, eliminating the need for keys.

Incorporating code lock principles into optimization algorithms presents novel approaches to solving complex problems, such as machine learning and trading systems development. This involves representing optimized parameters as numerical combinations and iteratively evaluating them to identify optimal solutions. Understanding and implementing these principles can significantly enhance algorithm efficiency and application scope.
#MQL5 #MT5 #Algorithm #EA

Read more...
πŸ‘34❀24πŸ‘¨β€πŸ’»5πŸ‘Œ4⚑3πŸ€”1
A tool has been developed to calculate lot size based on risk percentage and stop-loss level. Users can set a virtual stop loss by clicking on the chart, which will calculate the lot size corresponding to the applied risk percentage. In the input section, users need to specify whether the calculation should be for a buy or sell position, determining if the risk is calculated from the ask or bid price. Longer stop-loss distances on higher timeframes carry more risk due to the larger scale of price points. This tool functions with all types of securities and directly calculates the lot size from the risk percentage and stop-loss distance. Note, it does not account for the maximum tradeable lots allowed by account size and leverage. For that, use the max trade volume script.
#MQL5 #MT5 #LotSize #RiskMgmt

Read more...
πŸ‘33❀12πŸ‘Œ5🀣3πŸ‘¨β€πŸ’»2
In a recent update on trading EA development, significant changes were made focusing on performance and reliability. The Chart Trade feature was removed from the EA, leaving a basic order system. Quick trading options are now available via MetaTrader 5, though they lack integration with the cross order system, underscoring the need for Chart Trade as an independent indicator rather than as part of the EA code.

To maintain system cohesion, Chart Trade is being developed as a separate indicator, enhancing order and position management without burdening the EA. This transition aims to streamline operations while retaining core functionalities. Modifications are underway to ensure compatibility, simplifying the system architecture while retaining essential capabilities.
#MQL5 #MT5 #EA #Indicator

Read more...
πŸ‘37❀25πŸ‘¨β€πŸ’»9⚑1
An indicator is available that computes and displays the exponential moving average (EMA) of the true range, along with an offset of the EMA of its deviation. The implementation utilizes conditional compilation, ensuring compatibility with both MQL4 and MQL5 environments. Additionally, all source codes from previous CodeBase publications are now accessible in the "Public Projects" section of MetaEditor, identified by the name "FMIC". This resource offers developers a streamlined way to access, examine, and integrate advanced coding solutions into their projects, reinforcing efficiency in trading strategies.
#MQL4 #MT4 #Indicator #EMA

Read more...
πŸ‘30❀13πŸ‘¨β€πŸ’»7πŸ‘3🀣3πŸ‘Œ1
Explore the use of evolutionary optimization methods in MetaTrader 5 for trading model development. Unlike gradient-descent, these methods don't require differentiable model functions. They are inspired by Darwin's evolution theory, utilizing concepts like heredity and natural selection. The genetic optimization algorithm is particularly effective for non-differentiable functions or those with explosive gradients. Practically, the MQL5 implementation allows for parallel model operations, enhancing resource management and optimization speed. This approach optimizes trading strategies by selecting top models and introducing probabilistic mutations, ensuring adaptability and innovation in algorithmic trading environments. Embrace advanced strategies for efficient, adaptive trading systems.
#MQL5 #MT5 #algorithm #AI

Read more...
πŸ‘61❀26⚑10πŸ”₯3😁3πŸ‘Œ2πŸ‘€1
The Super Trend - Simple custom indicator has been enhanced to include multiple types of signal notifications. When the line color changes, users can now receive a sound alert, an email, or a push notification. This addition allows for timely updates and improved monitoring of market conditions. The ability to choose from various signal types offers flexibility in responding to market movements. This feature broadens the usability of the indicator by informing traders immediately of trend changes, thereby facilitating better decision-making and strategy adjustments. Adjust the notification settings according to personal preferences to optimize trading workflow.
#MQL5 #MT5 #Indicator #Alerts

Read more...
πŸ‘33❀19✍9πŸ‘¨β€πŸ’»5πŸ‘€3πŸ‘Œ2πŸ”₯1
The article presents a streamlined method for traders to automate their trading journal using Google Sheets, reducing errors and saving time. It outlines the creation of a Google Apps Script to facilitate data entry via HTTP POST, allowing real-time updates without manual inputs. The system leverages Google Sheets' collaborative features, making it easily accessible for analysis and feedback among traders. Additionally, it covers reading data from Google Sheets using HTTP, with practical applications in the MetaTrader platform. This setup helps traders focus on improving strategies by automating data handling, providing a robust tool for performance evaluation and enhancement.
#MQL5 #MT5 #Algorithm #Trading

Read more...
πŸ‘42❀20πŸ”₯9✍5πŸ†3πŸ‘¨β€πŸ’»2
An innovative approach involves displaying a candlestick chart without shadows in a subwindow. This unique representation provides a streamlined view, focusing solely on the body of the candles. Accompanying this, the 'Custom Moving Average' indicator is applied both to the main window and the subwindow, showcasing consistent analytical metrics across different chart views. This setup assists in simplifying analysis by emphasizing price movement within the candlestick bodies rather than fluctuations suggested by shadows. It can be useful for those looking to minimize noise and focus on primary price trends.
#MQL5 #MT5 #Indicator #Candlestick

Read more...
πŸ‘29❀13πŸ‘¨β€πŸ’»5🀣3πŸ”₯2πŸŽ‰2
Explore the cutting-edge methodologies in algorithmic trading using Python and MetaTrader 5 tools. This article delves into constructing a machine learning model crafted to refine price forecasting and trading efficiency. The cornerstone lies in feature engineering, from clustering via Gaussian Mixture Models to leveraging XGBoost classifiers for superior accuracy. GridSearchCV optimizes hyperparameters, while model ensembling amplifies classification precision to 73%. A custom Python tester evaluates profitability, accounting for spreads and commissions, ensuring expected market outcomes. This technical exposition provides traders and developers with actionable insights on creating robust, profitable trading models using advanced machine learning techniques.
#MQL5 #MT5 #AITrading #Python

Read more...
πŸ‘18❀9πŸ‘¨β€πŸ’»5πŸ†1
Discover how to leverage Markov Chains to optimize RSI-based trading strategies in MetaTrader 5. This article explores transforming state definitions from moving averages to Relative Strength Indicator (RSI) values, showing how to build custom Markov Chains for adaptive trading rules. Learn how this statistical approach dynamically adjusts based on your market data, offering tailored insights for different assets. By employing a transition matrix, gain a sophisticated understanding of market trends, enhancing decision-making accuracy. Follow along to see the practical development of an MQL5 Expert Advisor and the testing of this probabilistic model against deep learning methods. Ideal for traders and developers seeking advanced algorithmic solutions.
#MQL5 #MT5 #MarkovChain #Algorithm

Read more...
πŸ‘43❀21πŸŽ‰9πŸ‘¨β€πŸ’»5
Auto Profit Closer is an Expert Advisor that automates the process of closing open trades upon reaching a set profit target. It features the parameter "TargetProfit," enabling users to specify the desired profit level. This tool is well-suited for traders aiming to lock in profits without the need for continuous market supervision. It provides greater control over one's trading strategy by ensuring gains are secured effectively. The application is structured to enhance trading efficiency, helping to reduce the emotional stress often associated with manual trading. It streamlines decision-making, offering traders a practical solution for managing trading objectives more effectively.
#MQL4 #MT4 #EA #Trading

Read more...
❀24πŸ‘22πŸ‘¨β€πŸ’»3
The recent discussion illustrates modifications to MQL5 library classes for theme management, enhancing GUI components like CDialog, CEdit, and CButton. Modifying built-in libraries can both improve and negatively impact platform features, so proceed with caution. The integration revolves around theme-switching methods to adjust text, button skin, and background colors.

Incorporating methods into CDialog, CEdit, and CButton facilitates theme adaptability through color definitions and dynamic updates, promoting visually appealing design. The Admin Panel's algorithm was adjusted for seamless theme switching, maintaining efficient functionality.

This exploration serves educational purposes, emphasizing careful execution and testing of modifications to prevent potential issues in trading applications.
#MQL5 #MT5 #ThemeMgmt #MQL5

Read more...
πŸ‘30❀15πŸ‘¨β€πŸ’»3
Exploring optimal time frames for EURUSD prediction, the study assesses model error across 11 frames, revealing minimal error on monthly and hourly frames. An intriguing find is Granger causality between hourly and monthly returns, harnessing a VAR model for prediction. Using MetaTrader 5, the data is fetched and analyzed, focusing on the correlation and error distribution. Advanced techniques like Time Series Warping align time series data, and parameter tuning enhances model accuracy. Implementation in MQL5 allows flexible trading strategies through ONNX-exported AI models, adapting to technical analysis indicators for trade execution on the MetaTrader 5 platform.
#MQL5 #MT5 #AITrading #TimeFrames

Read more...
❀41πŸ‘32⚑6πŸ‘¨β€πŸ’»6πŸŽ‰4πŸ‘2
The Perfect Seconds chart indicator offers a practical solution for transforming live minute candle data into second-based charts. It permits the selection of various seconds durations to close bars precisely, providing live OHLC data that operates seamlessly without the necessity of tick availability. The code is fast and optimized, requiring no external DLLs, making it suitable for VPS environments.

This indicator supports cryptocurrency pairs like Binance and Kucoin, as well as futures and traditional financial instruments including gold and forex pairs. It includes functionalities to manage symbols and rates efficiently. Removal of a specific line of code from OnInit and OnCalculate may be necessary to address operational issues.
#MQL5 #MT5 #Indicator #AlgoTrading

Read more...
πŸ‘29❀7πŸ‘¨β€πŸ’»2
Explore the world of HTTP headers and their crucial role in client-server communication. This article focuses on understanding and implementing headers in HTTP requests and responses. Learn the essential functions of headers like Authentication, Cache Control, and Content-Type specification for secure and efficient data exchange. Discover how MetaTrader 5 automatically manages certain headers and how to customize them. This deep dive includes practical coding examples in MetaTrader 5 for adjusting headers and introduces the development of a class for managing HTTP headers. Enhance your understanding of protocol nuances to optimize algorithmic trading operations.
#MQL5 #MT5 #HTTP #Coding

Read more...
πŸ‘28❀16πŸ‘4πŸ‘¨β€πŸ’»2
Developing a risk manager class involves setting parameters to control trading losses on a daily and total basis. The implementation starts with defining balance-related metrics such as base balance, daily base balance, and daily level. Trading should be suspended when exceeding predefined loss limits, with parameters set as fixed values or percentages. The CVirtualRiskManager class manages this process, handling maximum daily and total loss calculations, and providing methods to update profits and positions safely.

The class ensures that the risk manager's state adjusts to trading conditions and supports programmatic implementation for both manual and algorithmic trading. Additional modifications to existing systems integrate these risk management functions, enhancing overall trading strategy resilience. Testing with model strategy parame...
#MQL5 #MT5 #RiskManagement #TradingStrategy

Read more...
πŸ‘23πŸ‘Œ11⚑6✍2πŸ‘2😁2πŸŽ‰2