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
A spread monitoring Expert Advisor (EA) provides critical insights for traders dealing with varied broker spread rules, including fixed, ECN, and standard accounts. This tool is instrumental for those wishing to gauge spread fluctuations and optimize EA performance accordingly. It continuously tracks and records the minimum and maximum spread values per day, resetting at midnight based on the broker's terminal time.

For flexibility, users can toggle between pips and points in the settings and choose to sort instruments by the highest spread. The EA is assigned to a chart that isn't involved in real trading, displaying data for all instruments visible in the Market Watch. By utilizing a unique labeling system, it minimizes traditional comment formatting issues, allowing clean presentation without the influence of chart backgrounds or grids.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #EA
❀34πŸ‘3✍2πŸ‘Œ2πŸ‘¨β€πŸ’»1
Delving into the complex world of templates in MQL5, this article demystifies the challenge of type overloading, offering clarity to both novices and seasoned developers. It highlights the intricacies of template applications, emphasizing precise data type determination for seamless compiler execution. Common pitfalls such as incorrect variable declaration and type specification are addressed, illustrating how to enable seamless overloading in both procedures and functions. With practical examples and step-by-step solutions, it underscores the importance of understanding fundamental concepts, like the role of the typename, ensuring accurate code compilation and execution, ultimately aiding developers in crafting efficient algorithmic trading strategies.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #Programming
❀20πŸ‘2πŸ‘Œ2πŸ‘¨β€πŸ’»2πŸ‘€2✍1
Machine learning models often make assumptions about data that may not hold true in real-world trading. Traditional statistical learning offers limited guidance on these relationships. Human traders, influenced by years of market experience, develop intuition-based strategies. These discretionary rules may provide a useful framework for machine learning applications.

A breakout trading strategy highlights the value of market logic. By observing price levels from previous days, this basic strategy reflects similar accuracy to complex deep neural networks. However, the strategy's volatility and aggressive nature necessitate adjustments for better control.

Testing and improving the strategy showed increased profits and reduced trading activity. Yet, it resulted in lower trading accuracy. Human intuition alone doesn't guarantee improvement, emphasizing the need...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #ML
❀27πŸ‘8⚑2πŸ‘1🀯1πŸ‘¨β€πŸ’»1
Traders face difficulties trading multiple symbols during high-volatility events using MetaTrader 5's default setup, which supports only one Expert Advisor (EA) per chart. We've devised a solution that integrates a multi-symbol trading feature within the News Headline EA.

This enhancement enables managing multiple pairs from a single chart, using intuitive trading buttons built upon the MQL5 Standard Library and custom trading classes. This sophisticated EA can handle multiple symbols seamlessly, crucial for quick reactions to market changes during news releases.

The integration involves modifying the CTradingButtons class to support multi-symbol trading and adapting the News Headline EA to include this new functionality, offering traders significant efficiency and control.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #Trading
❀31πŸ‘3πŸ‘¨β€πŸ’»3⚑2πŸ‘€1
The previous segment of this series discussed a backtested statistical arbitrage strategy involving cointegrated microprocessor sector stocks. It highlighted the volatility in cointegration due to external factors like company dynamics or economic shifts. The need for dynamic portfolio weight adjustments was also emphasized. The discussion moved towards the necessity of a persistent database setup to handle real-time updates efficiently, utilizing Metatrader 5 and Python integration.

For implementing a robust system, setting up a time-series specialized database, such as SQLite within Metatrader 5, is suggested. The database schema should include key structures like "symbol" and "market_data" tables. This system aims to enable seamless model and portfolio updates to adapt to market conditions continually. Adequate setup of this database infrastructure ...

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #Algorithm
❀69πŸ‘12✍4πŸ‘Œ4πŸ‘¨β€πŸ’»2πŸ€“1
The Cincin EA (v2.24) for MetaTrader 5 is an automated trading tool designed for conservative trading strategies on a specific symbol like EURUSD. It features basket management, hedging, and position control, integrating random trade execution within user-defined risk constraints. The EA respects stop-loss and take-profit settings determined through ATR or fixed pip values while adhering to a daily trade cap. It focuses on overall profit/loss management, utilizing breakeven and hedging techniques to manage risk exposure.

Key safeguards include margin checks, market status validations, and enforced time/pip intervals between trades. It's crucial to note that this EA is unsuitable for live trading and is best used for demo and strategy testing purposes. The use of martingale or similar strategies risks a total balance loss. It remains a work in progress requir...

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #EA
❀41πŸ‘¨β€πŸ’»6πŸ€”2πŸ’―2⚑1πŸ‘1
Part 20 of the MQL5 series focuses on harmonic patterns, crucial tools in technical analysis. These patterns use precise Fibonacci ratios to predict reversal zones. Key patterns include Gartley, Bat, Butterfly, and Crab, each with distinct Fibonacci measurements integral for pattern validation.

Understanding Fibonacci retracement and extension is vital for harmonic patterns. Retracement measures market pullbacks, while extensions project potential price movements. In MQL5, these ratios aid in programming pattern detection effectively. The importance of precise ratio application in pattern recognition is emphasized, as deviations can invalidate setups.

Upcoming discussions will explore automating pattern identification using MQL5, enhancing trading strategies through harmonic patterns.

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #Harmonic
❀30πŸ‘¨β€πŸ’»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πŸ‘3πŸ‘¨β€πŸ’»2
Explore the innovative approach of transforming market behavior into binary code to uncover hidden patterns. By encoding price movements, one can translate complex data into sequences of zeros and ones, opening up new insights for traders and developers. This imaginative technique highlights the importance of timeframes by revealing how the same binary sequence can differ across them. Discover the potential of these patterns, particularly with volatile assets like Bitcoin, where sequences can capture clear trends. Analyze the market from a new perspective, like a decryptor, seeking patterns in binary, and consider the potential of integrating machine learning for predictive insights.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Algorithm
❀29πŸ‘¨β€πŸ’»6πŸ‘2
The Artificial Tribe Algorithm (ATA) leverages tribal behavior to enhance optimization processes by combining dispersal and migration. As an innovative bionic intelligent algorithm, ATA replicates tribal reproductive and migratory mechanisms to find optimal solutions. Implementation begins by setting parameters and initializing populations, assessing conditions for reproduction or migration based on a fitness criterion. An adaptive dual behavior system facilitates deep exploration or migration depending on progress towards a global optimum. A global inertia weight improves search performance. Recent tests highlight ATA's effectiveness, yet point to challenges in maintaining solution diversity. Modifications incorporating dynamic probabilities show promise, addressing diversity issues and improving overall efficiency.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #Algorithm
❀40πŸ‘2πŸ‘¨β€πŸ’»2
Explore the cutting-edge MASA framework designed for dynamic portfolio risk management, seamlessly integrating deep reinforcement learning with a multi-agent system. MASA features two key agents: one maximizes returns leveraging the TD3 algorithm, while the other agent utilizes evolutionary algorithms for risk minimization. A Market Observer uses deep neural networks to analyze market trends and adapt strategies in real time. Experimentation on major indices like CSI 300 and S&P 500, over a decade, showcases MASA's superiority over traditional models. The MASA's implementation in MQL5 highlights its modular design, ensuring accessibility and efficiency for developers aiming to enhance algorithmic trading strategies.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Fintech
❀26⚑3πŸ‘3πŸ‘¨β€πŸ’»2πŸ‘Œ1
Discover an innovative approach to market analysis through the lens of language and AI. Our study transforms price movements into binary sequences, then into mnemonic phrases using the BIP39 protocol, akin to cryptocurrency wallets. By applying a transformer architecture typically used in natural language processing, we develop a system to translate market data into human-readable language. This method captures hidden market patterns, achieving noteworthy prediction accuracy. Our findings suggest the market speaks a nuanced "language" with its vocabulary, providing unique insights for traders and developers. This groundbreaking approach opens new avenues for understanding and engaging with financial markets.

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #AITrading
❀36πŸŽ‰3πŸ‘¨β€πŸ’»3πŸ‘2
A recent Expert Advisor leverages a trend-following and momentum confirmation approach employing two Exponential Moving Averages and the Relative Strength Index for decision-making. A buy signal is triggered when the Fast EMA surpasses the Slow EMA and RSI moves above a specified threshold. Conversely, a sell signal occurs when the Fast EMA falls below the Slow EMA with the RSI below its threshold. Integral to the EA is its dynamic lot size computation, contingent on account balance and pre-set risk percentage, accompanied by automated Stop Loss and Take Profit levels.

With an optional trading time filter, users can constrain trading to specific hours. Fully coded in MQL5, the EA is versatile across charts, with the ability to adjust EMA, RSI, risk, lot size, Stop Loss, Take Profit, and trading hours to tailor strategies. Optimal parameters for EURUSD on an ...

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #EA
❀38⚑5πŸ‘¨β€πŸ’»2πŸŽ‰1
TardioBot V1.05 is an Expert Advisor for MetaTrader 5 using a triangular arbitrage strategy. It targets price discrepancies among three currency pairs to optimize trading outcomes. Core functionality includes constant monitoring of bid and ask prices, calculation of arbitrage ratios, and execution of trades once set thresholds are met. It considers spread and commission impacts, supporting six predefined arbitrage trios like EUR/USD, GBP/USD, and EUR/GBP.

The EA adapts to symbol-specific price data, validates lot sizes, and responds to individual commission and spread costs. Integrated safety measures check equity, margin, and extreme ratios while ending non-performing trades after a user-specified duration. Note: TardioBot is for demo and testing only due to potential risks in live trading environments. Substantial updates are needed for real-world appli...

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #EA
❀38πŸ‘¨β€πŸ’»7πŸ‘5
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
❀35πŸ‘Œ9πŸ†4πŸ‘¨β€πŸ’»4πŸ‘2😁2⚑1
Explore the revolutionary MQL5 Algo Forge, a Git-based platform revolutionizing algorithmic trading development. It's more than a project list; it's a collaborative environment for developers. Equipped with powerful version control, it supports offline work, secure history backup, and easy collaboration. Key features include staging, commits, cloud synchronization, branching, and rollback. Integrated with MetaEditor, it simplifies complex version control tasks, focusing on efficient code writing and management. MQL5 Algo Forge caters to traders and developers seeking structured, reliable project management, enabling safe experimentation and teamwork with intuitive, user-friendly commands for seamless development experience.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #AlgoForge
❀121πŸ‘¨β€πŸ’»19πŸ‘9⚑8πŸŽ‰7πŸ†6πŸ‘Œ5
Explore advanced trend detection techniques in algorithmic trading detailed in the latest article, highlighting key strategies and calculation improvements. Learn about innovative enhancements to classic indicators like the moving average, including methods to minimize lag and improve trend accuracy. Discover the application of random component smoothing filters and empirical probability functions to identify key market movements. The article also delves into unique mathematical criteria such as Kendall and Foster-Stewart that offer robust trend detection capabilities. Gain insight into constructing effective trading strategies, leveraging these refined techniques to enhance algorithmic decision-making and optimize trading outcomes. Ideal for developers keen to integrate sophisticated analysis tools.

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Trend
❀38πŸ‘¨β€πŸ’»3πŸ‘2πŸ‘2πŸ‘Œ2
Databases offer organization, performance, and reliabilityβ€”essential for complex algorithmic trading using MQL5. Moving beyond CSV files, databases enable structured, efficient access and manipulation of vast data through SQL commands. SQLite's integration with MQL5 provides powerful native functions for database management, from simple tasks like opening and closing connections to advanced operations like transactions ensuring data integrity. Introducing a mini-ORM, TickORM, streamlines these tasks by encapsulating database functions into intuitive entities and attributes, transforming trading strategies into robust, scalable systems. This approach strengthens your trading environment, enhancing both traders' and developers' workflows.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Database
❀40πŸ‘¨β€πŸ’»3πŸ€”2πŸ‘Œ2
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
The price increase indicator has been updated to correct a previous error in the calculation of margin and price changes. The update, effective from December 13, 2024, ensures accurate display and analysis of data, reflecting percentage changes accurately. Users who rely on precise margin calculations for decision-making can now implement this update to maintain reliability in their financial assessments. Ensuring accurate computations is crucial for consistent performance reviews. It is recommended for users to update to the latest version immediately to benefit from the corrected calculations and enhanced accuracy.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
❀42πŸ‘7πŸ‘€4πŸ‘Œ3πŸ†2πŸ‘¨β€πŸ’»2