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
Position sizing remains a crucial factor in effective trading, significantly impacting a strategy's overall success and emotional toll on traders. In risk management, conventional wisdom advises risking 1%-2% of an account balance on individual trades, a guideline primarily aimed at preserving capital and minimizing emotional distress during losing streaks.

For traders, especially those handling smaller accounts, the temptation to exceed these recommendations for rapid growth is ever-present. Yet, the risk of substantial loss calls for a cautious approach. Monte Carlo simulations provide insight, quantifying how varying risk levels affect trading outcomes, drawdowns, and the probability of an account blowout.

In experimenting with different position sizing models, traders must remain aware of their emotional resilience and financial goals. A...

๐Ÿ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #RiskManagement
โค27๐Ÿ‘จโ€๐Ÿ’ป3๐Ÿ‘2๐Ÿ‘Œ1
The MetaTrader5-Python package allows Python developers to create trading applications for MT5, offering data access and trade monitoring, independent from MQL5. However, it lacks a Strategy Tester for Python-developed trading bots. Addressing this, the article outlines the construction of a Python trading simulator akin to MT5's Strategy Tester. It involves tracking trades, validating trade criteria, and simulating market conditions. This simulator class manages positions, orders, and deals, vital for testing trading strategies with Python. Beyond simulating positions, features include order modification, profit/loss calculation, and real-time market price monitoring, emulating the decision-making traders encounter in a live market environment.

๐Ÿ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Trading
โค36๐Ÿ”ฅ6๐Ÿ‘5๐Ÿ‘จโ€๐Ÿ’ป5โœ3๐Ÿ†2
Implementing new features into existing systems often involves enhancing user interaction and improving usability. In Part 8, the focus was on making a multi-symbol dashboard in MQL5 more user-friendly by integrating draggable and minimizable features, along with interactive and hover-responsive buttons. These updates are crucial for providing flexibility in interface layout and quick access to dashboard functions.

Incorporating draggable functionality requires considering mouse event handling, which enables positioning adjustments without losing core real-time data tracking. Interactive button design for actions like close, toggle, and export, combined with hover effects, ensures improved user navigation and visual feedback during trading activities.

The upgraded structure demands organized naming for UI components and optimized event handling st...

๐Ÿ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Dashboard
โค46๐Ÿ‘จโ€๐Ÿ’ป6โšก3
Introducing a versatile multi-timeframe dashboard scanner for RSI and Stochastic analysis. This tool displays both the main and signal lines of the Stochastic indicator. With integrated input elements directly on the chart, users can conveniently specify the desired RSI period and Stochastic settings. By clicking the update option, users can refresh the indicators to reflect the values set on the chart input efficiently. This ensures accurate and customized technical analysis based on user preferences, providing a streamlined experience for monitoring market conditions across multiple timeframes. The self-contained input functionality simplifies adjustments without leaving the chart interface.

๐Ÿ‘‰ Read | CodeBase | @mql5dev

#MQL4 #MT4 #RSI
โค38๐Ÿ‘พ7๐Ÿ‘6๐Ÿ‘จโ€๐Ÿ’ป5๐Ÿค”1
Dive into the latest advancements in MetaTrader 5 development with improvements in handling form object movement. The article introduces a refined approach for interacting with forms, creating a flag system to distinguish active forms on charts, enhancing mouse interaction capabilities. Discover how the addition of trade server error codes and properties like "StopLoss" and "TakeProfit" informs deal objects, boosting error handling and property management accuracy. Explore practical implementations of graphical object handling, focusing on precise mouse-event tracking and interaction. These updates streamline the user experience for developers, offering more robust and intuitive tools for algorithmic trading environments.

๐Ÿ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #AlgoTrading
โค69๐Ÿ‘10๐Ÿ‘จโ€๐Ÿ’ป6โœ4
The tool efficiently identifies and plots Fibonacci levels using ZigZag-based price cycles. It offers customizable parameters, including timeframe, number of bars, and Fibonacci line colors. Users can adjust label visibility and line styles to fit their needs. Multiple Fibonacci levels, such as 23.6%, 38.2%, 61.8%, and 161.8%, are supported, allowing users to set a minimum display level. The option to toggle ZigZag visibility and switch between body-to-body and wick-to-wick drawing modes adds flexibility. The tool is lightweight, providing optimized real-time chart analysis. Input parameters include timeframe and number of bars for calculation, as well as ZigZag tuning settings.

To use, simply add the indicator to your chart, customize parameters according to your trading style, and utilize Fibonacci levels to identify support or resistance zones. ...

๐Ÿ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
โค23๐Ÿ‘5๐ŸŽ‰2๐Ÿ‘จโ€๐Ÿ’ป2โšก1๐Ÿ”ฅ1๐Ÿ‘Œ1
A new library offers efficient handling of tick storage formats, optimized for size and speed. It retains essential MqlTick fields and can be integrated into your workflow using MetaEditor shortcuts. The library facilitates writing to and reading from files, demonstrating impressive compression capabilities with a 10:1 ratio that preserves data integrity.

An accompanying script benchmarks this process, achieving over 40 million ticks per second. The modular nature of this library supports flexibility and maintains original tick data during conversions, making it a robust solution for developers requiring high-performance data handling. Explore further solutions to enhance your technical projects with innovative alternatives provided in the source.

๐Ÿ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Algorithm
โค32๐Ÿ‘จโ€๐Ÿ’ป3๐Ÿ‘2
The VAR Volume Indicator for MT5 is a technical instrument designed to assess price movements within the Value Area, typically representing 70% of the Market Profile's volume range. It focuses on crucial price zones and major profile extremes. The Volume-at-Price feature aligns price levels with associated volume data on the X-axis, revealing liquidity clusters. The Retracement Logic identifies possible pullbacks into high-volume nodes within the Value Area, signaling potential market reversals or continuations.

This tool combines Market Profile elements, like brackets and profile highs, with volume profiling to detect institutional activity and significant retracement zones. Alphanumeric sequences within the indicator may offer time-price-volume mappings for algorithmic testing. Traders, including scalpers and swing traders, utilize the VAR Indicator...

๐Ÿ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #Indicator
โค19๐Ÿ‘8๐Ÿ‘จโ€๐Ÿ’ป6๐Ÿ‘Œ1
Explore the key technical aspects of leveraging DirectX within MQL5 for algorithmic trading applications. This involves understanding the Direct3D device framework, input layouts, and primitive topology for rendering graphics. The discussion highlights the integration process of HLSL shaders to optimize graphics rendering pipelines. By comprehending these structures, traders and developers can utilize GPU resources efficiently, enhancing visual data interpretation in trading platforms. The step-by-step guide demystifies DirectX's complexity while maintaining robust control over graphic components. This article serves as a practical resource for implementing advanced graphical features, crucial for developing sophisticated trading bots and enhancing user interface visuals.

๐Ÿ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #DirectX
โค72๐Ÿ‘8๐Ÿ‘€8โœ6๐Ÿ†5๐ŸŽ‰4๐Ÿ‘จโ€๐Ÿ’ป1
Introducing a grid-based system designed for traders seeking to effectively manage order placement. This expert advisor facilitates the creation of an order grid without relying on martingale strategies, offering flexibility with standard, lite, or full martingale options. Users are encouraged to conduct tests to identify optimal settings, as default configurations serve merely as a foundational guide to the system's operations.

The expert supports both aligned and opposing order grid configurations. When facing significant losses, the hedge mode option is available for added control. Given the inherent high-risk nature of this strategy, it is advisable to perform initial tests in a demo trading environment to evaluate performance and stability.

๐Ÿ‘‰ Read | VPS | @mql5dev

#MQL4 #MT4 #EA
โค36๐Ÿ‘€4โšก2๐Ÿ‘1๐Ÿ‘จโ€๐Ÿ’ป1
A new expert advisor has been developed to assist traders in creating an order grid. The system avoids martingale, lite martingale, and full martingale methods, offering straightforward operation. Users are encouraged to conduct their tests to determine optimal settings. Default settings serve as an initial guide for comprehension. The expert allows configuration to build either conforming or opposing order grids. Additionally, a hedge mode is available to manage significant losses. The strategy is noted for its high-risk potential. It is advisable to first evaluate its performance on a demo account to ensure thorough understanding before full deployment.

๐Ÿ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #EA
โค30๐Ÿ‘Œ5๐Ÿ‘จโ€๐Ÿ’ป3
Navigating multi-pair trading can be challenging due to varying volatility. This article addresses these issues by leveraging a dynamic Expert Advisor (EA) that incorporates volatility-based risk management. By using tools like Average True Range (ATR) and dynamic risk-based sizing, the EA adjusts trade parameters according to market conditions. This ensures consistent risk management and improved performance across diverse currency pairs. Key features include multi-symbol handling, volatility-driven risk tiers, and real-time adaptability to market shifts. Practical for both traders and developers, this EA mitigates risk in volatile markets while optimizing opportunities in stable environments, providing a comprehensive strategy for more predictable outcomes.

๐Ÿ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #EA
โค35๐Ÿ†4๐Ÿ‘จโ€๐Ÿ’ป4
Discover the SAMformer framework, an innovative approach to overcoming traditional Transformer limitations in long-term multivariate time series forecasting. By leveraging a shallow architecture, SAMformer reduces computational complexity and addresses overfitting. The core feature, Sharpness-Aware Minimization (SAM), enhances model robustness against parameter variations, significantly improving prediction quality. SAMformer's high accuracy with fewer parameters supports efficient deployment in resource-limited environments, finding applications in finance, healthcare, and more. Recently, SAM optimization was integrated into the convolutional layer, simplifying implementation while retaining functionality. This progress marks a significant step toward advanced, scalable Transformer models.

๐Ÿ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #AITrading
โค62๐Ÿ‘7๐Ÿ‘จโ€๐Ÿ’ป7๐Ÿ˜ˆ2
An Expert Advisor (EA) is designed to operate on the principles of Bollinger Bands price crossings. It monitors the market for instances where the price interacts with the lower and upper bands. This functionality allows the EA to make informed decisions on potential trade entries and exits. Additionally, it automates the setting of Stop Loss (SL) and Take Profit (TP) levels. The integration of Bollinger Bands with automatic SL and TP options supports potential risk management and trading strategy execution. This EA may be utilized to efficiently manage trades by leveraging technical analysis indicators endemic to the financial markets.

๐Ÿ‘‰ Read | Quotes | @mql5dev

#MQL4 #MT4 #EA
โค27๐Ÿ‘4๐Ÿ‘Œ3โœ1๐ŸŽ‰1
Algorithmic traders often encounter issues with static rule-based systems that struggle with dynamic markets. Most Expert Advisors (EAs) lack adaptability to volatility and unforeseen patterns. By utilizing adaptive learning and Python, reinforcement learning models can evolve with market conditions. Python libraries such as PyTorch and Gym enable advanced processing and environment simulations. A trained model can be exported to ONNX for MQL5 deployment.

Initiate by connecting Python to MetaTrader 5 for historical data retrieval. Define your date range and use `mt5.copy_rates_range()` for data extraction. Ensure data consistency across time zones with UTC. Analyzing and cleaning data ensures accuracy for algorithmic processing and includes using tools like StandardScaler.

Develop a custom OpenAI Gym and Dueling DQN for reinforcement learning. Use bu...

๐Ÿ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
โค36๐Ÿ‘3๐Ÿ‘จโ€๐Ÿ’ป3โšก1
The development of a trendline trading system using MQL5 introduces an advanced mechanism for automated trading based on technical trendline analysis. Building on previously implemented systems, this iteration employs a least squares fit to establish support and resistance trendlines. These lines trigger buy and sell signals when prices intersect them, enhanced with visual indicators and adjustable trade parameters for clarity and efficiency.

Implementing this system involves designing a framework for trendline detection and management within MQL5, requiring the setup of input parameters and structures to enhance the dynamism of the trading program. This setup enables precise execution of trades while adhering to robust risk management protocols.

Through comprehensive backtesting processes, this strategy ensures reliable performance under various mark...

๐Ÿ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Algorithm
โค67๐Ÿ‘11๐Ÿ”ฅ8๐ŸŽ‰2๐Ÿ†2๐Ÿ‘จโ€๐Ÿ’ป2๐Ÿ‘€1
The ATR% is a volatility indicator expressed as a percentage, showing the average true price range over a specific period. Unlike basic measures that only consider daily highs and lows, ATR% includes price gaps for a more comprehensive analysis. A reading of 100% represents the maximum potential volatility of the asset. In lower timeframes, ATR% typically remains below 3%, whereas higher timeframes can yield larger values. The calculation uses the formula: ATRP = ATR / close * 100. Here, ATR represents the average largest price spread over a given period, and close stands for the current asset price.

๐Ÿ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Indicator
โค48๐Ÿ‘3๐Ÿ‘จโ€๐Ÿ’ป3
Multivariate time series forecasting is critical in fields such as meteorology, energy, anomaly detection, and financial analysis. Recent advancements in artificial intelligence have yielded sophisticated models to enhance forecasting accuracy. Transformer-based architectures, known for effectiveness in NLP and computer vision, are valuable in time series forecasting. These models, when pre-trained on large datasets, significantly boost predictive performance.

Despite their complexity, simple linear models effectively compete with their Transformer-based counterparts, often preferred due to lower complexity and reduced overfitting risk. They efficiently capture stable patterns with even limited data. The PatchTST approach introduces patching techniques for local semantics extraction, highlighting scope for efficiency improvements with channel-ind...

๐Ÿ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #DeepLearning
โค70๐Ÿ‘จโ€๐Ÿ’ป7๐Ÿ‘6๐ŸŽ‰3
The described indicator allows for customization in defining fractals, where users specify the number of bars forming the structure. In this setup, using 5 bars to the left and 2 bars to the right constructs a fractal pattern representing a top or a bottom. This approach provides flexibility in identifying key price reversal points effectively within market analysis. Adjusting the count of bars tailors the sensitivity and frequency of fractal signals. Implementing such a tool can enhance analysis precision, especially in recognizing pivotal market movements. Users can adapt settings based on their specific trading strategies and market conditions.

๐Ÿ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #Indicator
โค35๐Ÿ‘จโ€๐Ÿ’ป6๐Ÿ‘2โœ1๐ŸŽ‰1๐Ÿคจ1
Sorting a list of structures by a specific field is a fundamental task in programming. Different algorithms can accomplish this, each with unique characteristics. Quick Sort and Merge Sort are efficient algorithms commonly used for this purpose. Quick Sort works by partitioning the data and sorting the partitions independently. Merge Sort divides the list into smaller sublists, sorts them, and then merges them back together. Both offer reliable performance in various scenarios.

Customization may be required based on specific use cases. The sort can be tailored to accommodate different data types and sorting criteria. Understanding the mechanisms of these algorithms can aid in effectively organizing data structures. Implementing these algorithms requires a clear grasp of their operation and adaptability for specific sorting needs.

๐Ÿ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #algorithm
โค33๐Ÿ‘4๐Ÿ‘จโ€๐Ÿ’ป2โœ1
New Indicator Overview: Introducing an advanced custom indicator combining Bollinger Bands with actionable Buy/Sell arrows. This tool automatically tracks market movements, signaling potential reversal points when prices interact with the bands' thresholds. Calculations are done using the iBands function.

Operational Details: The indicator provides a Buy signal when a blue arrow appears after a candle closes below the lower band and then above it. A Sell signal is marked by a red arrow following a candle closure above the upper band and then below it. Arrows are only displayed once per signal direction until reversed, avoiding excessive signals.

Indicator Options: Users can customize the display of the Bollinger Bands and adjust parameters such as period, deviation, and price type. It is compatible across symbols and timeframes, employing non-repaint...

๐Ÿ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #Indicator
โค26๐Ÿ‘€9๐Ÿ‘3โšก1๐Ÿ‘จโ€๐Ÿ’ป1