MQL5 Algo Trading
388K subscribers
2.56K 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
Matrix factorization offers powerful tools for building numerically driven trading applications. Progressing from regression tasks, focus now shifts to classification problems. Developing a market classifier that distinguishes market movements involves learning from past market data to guide trading decisions.

The classifier anticipates market trends based on moving average behaviors. For sell positions, both price and moving average should fall. For buy positions, both should rise. The model predicts two separate binary outcomes.

System definitions, user inputs, and global variables are essential for functionality. Important methods include setup and findSetup, handling data inputs and predictions. Employing Singular Value Decomposition (SVD) allows optimal coefficient determination.

Developing a classification model involves standardizing inpu...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀73πŸ‘Œ6πŸ‘4πŸ”₯3πŸ‘¨β€πŸ’»3🀑2πŸ‘€1
Control theory's feedback mechanism offers a promising upgrade for algorithmic trading, particularly in dynamic markets. By integrating a feedback controller with a trading strategyβ€”initially utilizing two moving averages to define trading signalsβ€”we can enhance system adaptability. The controller monitors and adjusts the strategy based on market conditions and past performance, thereby learning to improve profitability and reduce risk. This novel approach shows significant profit and Sharpe ratio increases, with fewer trades and heightened efficiency. Developers leveraging this framework can optimize trading strategies, aligning them closer with market realities and minimizing repetitive mistakes, all through intelligent system adjustments.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀34πŸ‘4πŸ‘¨β€πŸ’»2
The previous article detailed the Crab Pattern system in MQL5, focusing on high-probability reversal points using harmonic patterns. Part 28 covers the Bat Pattern system, which identifies bullish and bearish Bat harmonic patterns. This system employs pivot points and Fibonacci retracements to automate trades with defined entry, stop-loss, and take-profit points, visually aided by chart elements like triangles and trendlines.

Understanding the Bat Harmonic Pattern involves recognizing a geometric formation signifying market reversals with swing points (X, A, B, C, D). The article explains the pattern framework through systematic geometric and Fibonacci requirements to identify valid Bat patterns, ensuring precise trade execution points.

Implementation in MQL5 involves using the MetaEditor to create a file, include the Trade library, managing trade ...

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀36πŸ‘Œ9πŸ†4πŸ‘¨β€πŸ’»4πŸ‘2😁2⚑1
In advanced programming and IT systems, designing a stable communication protocol is essential. In a previous update, code adjustments were made to stabilize interactions between the mouse indicator and Chart Trade systems. A critical flaw required moving certain code lines to ensure proper response to user actions.

When planning a message protocol, converting numeric values to strings ensures clarity, prioritized over efficiency. Fixed-length arrays simplify indexing but waste memory if fields are underutilized. Alternatively, variable-length arrays avoid wasted space but add complexity and potential data loss when limits are exceeded.

In protocol design, variable-length blocks offer flexibility, but delimiters must be used for accurate data separation. The approach chosen combines alphanumeric strings with delimiters, allowing clarity and indexi...

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀46πŸ‘8πŸ‘Œ4πŸ‘¨β€πŸ’»3⚑2
Implementing code to draw triangles on a chart assists in detecting harmonic patterns and visually plotting them. This technique can be extended to include the plotting of rhombuses and parallelograms, providing additional flexibility in geometric representation. Utilizing these shapes enhances the ability to clearly display detected patterns on charts, aiding in pattern analysis and verification processes. By adapting this approach, developers can accurately reflect complex structures, which can be crucial for detailed analytical frameworks and systems. Efficient code execution ensures reliable visualization of both triangular and quadrilateral figures, supporting advanced pattern detection methodologies in technical analysis.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL4 #MT4 #AlgoTrading
❀42πŸ‘5πŸ‘¨β€πŸ’»2🀯1
Discover how a new 5 Drives pattern system in MQL5 leverages harmonic trading strategies using precise Fibonacci ratios and pivot points. This advanced setup automates trade executions with flexible entry, stop-loss, and multi-level take-profit options, all visualized through detailed chart objects like triangles, trendlines, and labels. The framework identifies bullish and bearish reversals with specific retracement sequences, ensuring accuracy in trade decisions. Ideal for developers seeking robust, customizable algorithmic trading strategies, this system provides clarity and efficiency in detecting and trading harmonic patterns, backed by thorough backtesting results for effective deployment.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀68✍8πŸ‘Œ3πŸ‘¨β€πŸ’»1πŸ‘€1
In our latest technical assessment, we explored integrating third-party libraries with MQL5 Algo Forge, focusing on the SmartATR library. Initially, manual cloning via Git worked to integrate the library, revealing MetaEditor's current limitations when handling external repositories. We found console commands a requirement for external code integration, as MetaEditor didn't fully support repository cloning without pre-existing correct permissions or context operations.

We explored an alternate approach: forking external repositories via the MQL5 Algo Forge web interface. Forking provides an independent copy where developers can make modifications, which is then visible in MetaEditor for streamlined repository management. This supports the open-source model, allowing for potential code contributions and efficient project backups.

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀67πŸ‘5πŸ‘5πŸ‘Œ2✍1🀯1πŸ‘¨β€πŸ’»1
Developing advanced trading systems involves understanding classical patterns and programming skills. A recent implementation in MQL5 focuses on the Shark Pattern system, a harmonic pattern based on pivot points and Fibonacci retracements/extensions. The system automates trade execution upon detecting a valid pattern, offering flexible entry, stop-loss, and take-profit options. The use of chart objects enhances pattern visualization, aiding in clarity and decision-making.

For implementation, key steps involve defining structures for swing pivots, employing logic to detect pattern criteria, and visual aesthetics for chart depiction. Testing through historical data ensures efficacy and reliability, while careful risk management remains essential.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀60πŸ‘¨β€πŸ’»5⚑4πŸ€”4πŸ‘Œ3πŸ†2πŸ‘€2
A custom optimization function crafted for the MetaTrader 5 Strategy Tester, this script assists in analyzing test results beyond the typical use of Expert Advisors, indicators, or scripts. The code begins by collecting trade history from the tester, ensuring a minimum of 50 trades, and recognizing the initial deposit and testing periods. Trades are divided into In-Sample (IS) and Out-of-Sample (OOS) periods, facilitating a more robust analysis.

Thereafter, it calculates a series of metrics, covering factors like profitability, drawdown, Sharpe and Sortino ratios, and profit factor. Statistical analysis is conducted using Kolmogorov-Smirnov and Jarque-Bera tests. Strategy evaluation incorporates multiple dimensions: profitability, consistency, risk-adjusted performance, and statistical quality.

This code is applicable in various scenarios: strategy...

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀17πŸ‘3πŸŽ‰2πŸ’”1πŸ‘¨β€πŸ’»1
In the ongoing development of our market simulation system, key challenges arise from ensuring system security, reliability, and performance. An essential step in this process is to address information leakage through proper encapsulation. Within the C_Mouse class, we identified a flaw in the SetBuffer function's accessibility, which was rectified by relocating it, thereby enhancing system integrity.

Further, system performance issues became apparent during extensive feature use, traced back primarily to the mouse indicator's intensive buffer reading. This was mitigated by isolating buffer accesses and optimizing class variable storage versus repetitive function calls.

The system's updated architecture now reflects a more robust class hierarchy aimed at maintaining performance levels while allowing for scalability and adaptability in future developme...

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀21πŸ‘¨β€πŸ’»2
The transition to MQL5 Algo Forge emphasizes leveraging community-contributed code. A crucial step involves integrating third-party libraries while ensuring code remains modifiable through personal forks. In Part 3, SmartATR was integrated into the SimpleCandles Expert Advisor, highlighting challenges in direct cloning. A structured workflow using forks resolved these issues, with changes proposed to original repositories via Pull Requests.

Publishing modifications involves committing or releasing new versions. For efficient version control, obsolete branches should be managed to prevent repository clutter. A branch is essentially a sequence of commits, which remain intact post-deletion. Locating prior branch states involves identifying specific commits and understanding Git concepts like tags and the HEAD pointer. Tags, especially lightweight ones, ...

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀29πŸ‘Œ4πŸ‘2πŸ‘¨β€πŸ’»2
Dive into advanced techniques for improving MetaTrader 5 libraries with this insightful article focusing on graphical object events. Discover how you can define precise changes in properties and track the history of modifications, enabling enhanced analytical tools with memory capabilities. Learn about handling complex scenarios, such as multiple object additions and chart-linked object restoration. Benefit from structured methods for capturing object renaming sequences and managing removed graphical objects efficiently. Perfect for developers seeking to refine trading tools, this article offers detailed, practical approaches for leveraging the full power of MQL5's dynamic arrays and chart management classes.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀63πŸ‘13πŸ‘Œ6✍2πŸ†2πŸ‘¨β€πŸ’»2πŸŽ‰1
Explore an innovative approach to volatility prediction using MetaTrader 5 and Python integration for algorithmic trading. Discover a three-tier architecture where MetaTrader 5 efficiently streams market data, while Python employs libraries like Sklearn and XGBoost to identify volatility patterns, thanks to the property of stationarity. The Data Pipeline processes data for noise removal and metric calculation, ensuring optimized performance. The Analytics Core leverages machine learning for accurate volatility forecasts, outperforming complex models with simplicity. The Risk Advisor uses these forecasts for dynamic risk management adjustments. This system offers robust, adaptable trading strategy enhancements, bridging traditional indicators and modern analytics.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀48πŸ‘9πŸ‘Œ6🀯3πŸŽ‰3πŸ‘¨β€πŸ’»2⚑1
The FinMem framework, based on large language models, presents a novel approach to trading through its unique layered memory system. This system is divided into Working and Long-Term Memory components, managing short-term data and long-lasting information, respectively. The profiling module adjusts the agent's behavior based on user preferences and market conditions, while the decision-making module combines real-time data with stored memories to craft strategies that consider both short-term trends and long-term patterns. This is key to enhancing the accuracy and efficiency of investment decisions.

The FinMem framework's implementation in MQL5 introduces the CNeuronFinMem object, which reproduces the stratified data processing approach. The integrated algorithm manages data by processing an environment-state tensor and comparing it with a trading ...

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀21πŸ‘¨β€πŸ’»1
Part 25 of the MQL5 series introduces the development of an Expert Advisor (EA) to automate trading by identifying trend lines for signals. Unlike the previous focus on support and resistance zones, trend lines are used to assess market direction and breakout points.

The EA requires the user to manually draw two trend lines and name them appropriately. It can handle both breakout and reversal trades, setting stop-loss and take-profit levels based on the latest candle's data. By processing the last five candles, the EA detects if a price breaks or reverses from a trend line, ensuring relevant market moves. The use of trend line names and chart IDs enhances precise monitoring and engagement, avoiding unnecessary trades.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀72πŸ‘Œ9πŸ”₯4πŸ‘3🀝3πŸ‘¨β€πŸ’»2⚑1
Explore a revolutionary approach to cross-validation for time series in MetaTrader 5. Moving beyond classical methods, this article demonstrates how optimizing models with domain-specific validation techniques can effectively reduce overfitting. By training models on the most recent, relevant data rather than the full dataset, developers can enhance accuracy and reduce computational costs. Through empirical testing, it was found that using only 80% of the latest data yields the best results, challenging the traditional "more data is better" philosophy. This innovative strategy streamlines model training, ultimately benefiting developers with shorter development cycles and efficient resource utilization.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀42πŸ‘2πŸ‘¨β€πŸ’»1
This article discusses the creation of an on-chart control panel for MetaTrader 5, targeting traders and developers interested in algorithmic trading. The focus is on building a user-friendly interface using MQL5 to automate lot size calculations and orders, enhancing speed and reliability. Readers learn how to assemble a static GUI layout, addressing key parameters such as order types, entry price, stop-loss, and risk per trade. The article details how to structure an Expert Advisor with essential functions like OnInit and OnTick. By following the guide, developers gain insights into crafting professional interfaces, improving both trading precision and interface usability.

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀30✍2πŸ‘Œ2πŸ‘¨β€πŸ’»2