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
Market depth is crucial for order block detection. Initiation involves creating dynamic arrays for buy and sell volumes. During OnInit, arrays resize to start storing market order volumes. Depth availability is key, determined by broker support, checked via the chart corner for volume indication.

Initial set-up involves global variables marking market depth availability. Successful initialization uses Depth of Market functions checking OnInit. OnBookEvent tracks volume changes in dynamic arrays. Verification ensures updates with new candlesticks, controlling array size to 30 elements maintaining recent data integrity.

Structured logic for order blocks involves set conditions without loop iterations. Arrays hold critical price points to maintain real-time trading strategy integrity. Buffers are visualized using dynamic arrays, with OnInit processing...

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #OrderBlock
❀20πŸ‘Œ7πŸŽ‰2πŸ”₯1πŸ‘¨β€πŸ’»1
In the continuation of our trading strategy development in MQL5, we have built a Supply and Demand Trading System leveraging a retest and impulse model. This system identifies supply and demand zones through periods of consolidation, confirms their validity with impulsive price moves, and facilitates trading on retests.

Key components of this strategy include defining risk parameters, implementing trend confirmation, and enhancing chart visualization with dynamic labels and colors. We covered the framework, implementation in MQL5, key enumerations, zone detection and validation, trading logic, and the integration of trailing stops. This comprehensive approach provides a functional trading strategy in MQL5 to efficiently manage supply and demand zones for potential reentry trades.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #Trading
❀58✍7πŸ†7πŸ‘¨β€πŸ’»5⚑3πŸŽ‰1
This script outlines three methodologies for calculating the current Aroon Up and Aroon Down values. The first method involves utilizing the CopyHigh and CopyLow functions. The second method uses iHighest and iLowest functions to determine these values. The final method employs the Aroon indicator directly for the calculation. The indicator, authored by Nikolay Kositsin, is available for download from the MQL5 library. Access to this resource enables integration and comparison of these approaches, allowing for enhanced decision-making in technical analysis and algorithmic trading strategies.

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
❀27πŸ‘4πŸ‘¨β€πŸ’»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
The Balance of Power (BOP) indicator, devised by Igor Livshin in 2001, assists in determining the dominance dynamics between buyers and sellers per candle session. This variant integrates a Simple Moving Average (SMA) to effectively reduce market noise, enhancing clarity in reading the indicator. The visual representation delineates buyer dominance (bulls) when the closing price approximates the high and seller dominance (bears) when it nears the low. The formula driving BOP is: (Close - Open) / (High - Low). A BOP above zero indicates buyer control, below zero suggests seller control, and values around zero reflect market balance or indecision. Extreme values, such as Β±0.2, often signal potential corrections due to excessive strength.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Indicator
❀25πŸ‘¨β€πŸ’»2
The article delves into enhancing MetaTrader 5's library classes to manage the complete history of graphical object changes on trading charts. This innovative approach enables recording every property change within a graphical object, providing a comprehensive snapshot of its historical data. Developers can effectively restore any object to a previous state, facilitating nuanced technical analysis by recognizing past object configurations. By introducing new properties and updating existing ones like Group and Species, the framework is optimized for sorting and accessing change history effectively. This is particularly beneficial for developers aiming to create sophisticated tools for analyzing market trends with precision and efficiency.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #EA
❀50πŸ‘9πŸ‘Œ6πŸ‘€5πŸ‘¨β€πŸ’»4πŸ†2
PriceVar% is a technical indicator that calculates the percentage difference between market price and a moving average. It measures market movement strength against a reference value. When the closing price is above the moving average, use this formula: Var = (High - MA) / MA * 100. If it's below, the formula is: Var = (Low - MA) / MA * 100. Results are shown as a percentage histogram: green signals price above average, indicating buying force; red signals price below average, indicating selling force.

For interpretation, positive values represent the high's distance from the average, while negative values represent the low's distance. Larger absolute values mean a greater percentage distance. This indicator helps detect overbought or oversold conditions, quantify volatility, and support breakout or reversal strategies. It's also useful for setting th...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #Indicator
❀33πŸ‘8πŸ‘¨β€πŸ’»4
The article explores the integration of the AutoCorrelation Function (ACF) as a filter in enhancing the Moving Average Crossover strategy for algorithmic trading. It utilizes sixteen years of M15 currency data to assess the effectiveness of the ACF, which identifies time series patterns by measuring correlations within price data. Unlike conventional indicators like ATR and Bollinger Bands, the ACF is not influenced by volatility, showing potential to differentiate profitable from non-profitable trades. When applied to the SMA Crossover Strategy, the ACF threshold requirement significantly bolstered profitability for both EURUSD and GBPUSD pairs, highlighting its utility for expert advisors and algorithmic traders.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #EA
❀67πŸ‘9✍5πŸ”₯3πŸ‘Ύ3⚑2πŸ‘Œ2
Dollar Index Tracker offers a tool for traders to gauge the US Dollar's standing against a basket of major currencies directly alongside their trading charts. It displays USDX composed of six major pairs with EUR/USD having the most influence. Established in 1973 at a value of 100, it remains crucial for measuring dollar strength. The tracker executes the USDX formula in real time, enabling customization with moving averages to identify trends. Input settings allow adjustment of currency pairs and coefficients, offering strategic advantages such as detecting divergence and confirming trends. Multi-timeframe analysis can enhance alignment with dollar trends across various trading frames. It serves as a critical correlation filter, providing clarity on dollar momentum and guarding against false trading signals. Ensure all key currency pairs are listed in Mar...

πŸ‘‰ Read | Freelance | @mql5dev

#MQL4 #MT4 #USDX
❀53✍4🀑3🀣3😁2πŸ‘¨β€πŸ’»1
Introducing a technical solution for traders seeking to leverage retail sentiment: the Ziwox Retail Sentiment EA. This Expert Advisor employs data from the Ziwox API to implement a contrarian strategy by analyzing retail trader sentiment. Overextended market conditions often occur when most retail traders take one side. By understanding these positions, traders can apply contrarian moves, potentially in synergy with broader market trends and institutional flows.

The advisor retrieves sentiment data via an API call, interpreting the Retail Long and Short Ratios. The contrarian logic triggers sell trades if the long sentiment exceeds a certain threshold with a confirmed technical trend and triggers buys in the opposite scenario. A technical filter with moving averages ensures trades align with established trends, preventing this from crowding.

Automated trad...

πŸ‘‰ Read | Calendar | @mql5dev

#MQL4 #MT4 #Sentiment
❀27πŸ‘Œ3πŸ‘¨β€πŸ’»2
The StockFormer hybrid trading system leverages cutting-edge methods like predictive coding and reinforcement learning to forecast market dynamics. Its innovative structure features three specialized Transformer branches for extracting asset interdependencies, and short and long-term predictions. The integration through advanced attention mechanisms enhances pattern detection and adaptability in volatile markets. Practical implementation emphasizes the use of the Diversified Multi-Head Attention module for efficient pattern recognition in noisy data. The training of predictive models focuses on constructing expert systems for time series analysis, optimizing for profitability through focused trajectory selection in neural network training. This robust framework positions StockFormer as a powerful tool for algorithmic trading development.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #AI
❀28πŸ‘¨β€πŸ’»1
Markets often operate in cycles of optimism and pessimism, and traditional mechanical strategies can fall short in volatile conditions. To address this issue, advanced machine learning methods such as Variational Autoencoders (VAEs) are introduced for trading strategies. These models compress noisy data into core features, crucial for discerning valid signals amidst market noise.

A significant advance involves the integration of VAEs with binary event encoding, contrasting previous continuous-value pipelines which diluted key signals. This approach enhances signal clarity, stability, and live performance. The MQL5 Wizard facilitates the assembly of trading strategies by combining custom signal classes with machine learning models. This allows for adaptive strategies that are aligned with market dynamics.

The process involves training models in Python, expo...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #ML
❀29πŸ‘3πŸ‘¨β€πŸ’»1
The latest article in our MetaTrader 5 Machine Learning series delves into the implementation of the adaptive trend-scanning labeling method. This method refines trade prediction by dynamically determining the most statistically significant time horizon, rather than relying on a fixed duration. The trend-scanning technique utilizes t-statistics to find genuine trends, enhancing adaptability to volatile or calm market periods. Key innovations include the use of Numba for speed optimization and dynamic volatility filtering to prevent noise. Tested with a moving average crossover strategy, trend-scanning significantly outperformed fixed horizon labeling, improving risk-adjusted returns and offering robust insights for adaptive algorithmic trading.

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #ML
❀34πŸ‘5🀣2🀩1πŸ‘Œ1πŸ‘¨β€πŸ’»1
The article delves into an intricate challenge faced by MetaTrader 5 developers: effective communication between the Chart Trade indicator and the Expert Advisor to manage futures contracts. The proposed solution involves using message exchanges between these components, carefully addressing sequence and synchronization issues when MetaTrader 5 changes the chart timeframe. A notable approach is implementing custom events to smoothly adjust contract types and maintain user interface consistency without convoluting systems. This innovative strategy enhances flexibility in contract management while keeping interface components separate, emphasizing the importance of structured message passing for improved algorithmic trading applications.

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #Trading
❀30πŸ‘5πŸ”₯3πŸ‘Œ3πŸ‘¨β€πŸ’»1
Testing trading strategies in a controlled environment enables precise calibration of variables like StopLoss and TakeProfit levels. A recent assessment demonstrated unexpected profitability by adjusting these elements. The experiment also examined integrating various trailing stop methods, including Parabolic SAR and moving averages. By utilizing trailing stops, specifically those based on double exponential moving averages, a notable increase in profitability was observed compared to original trading settings. However, not all indicators provided positive outcomes. Customization of trailing parameters per symbol is advisable for optimal results, as individual symbol characteristics influence trading performance significantly.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Strategy
❀51πŸ”₯6πŸ‘Ύ2πŸ‘¨β€πŸ’»1
The comprehensive trading system incorporates quantum computing principles, utilizing quantum states and probabilities for decision-making. The AI modules integrate multiple indicatorsβ€”RSI, ADX, MA, ATRβ€”with adaptive weighting, enhancing decision accuracy. Robust risk management is emphasized through deposit protection and strict control of drawdown, position size, and daily loss limits. The Quantum Trailing Stop provides a dynamic stop-loss mechanism, adjusting to the prevailing market conditions.

Automatic optimization streamlines parameter adjustments in the strategy tester, with specific configurations tailored for trading gold and silver, accounting for their distinct volatility characteristics. Protective mechanisms include a minimum deposit check, trade limits on loss exceedance, and risk reduction following a loss streak. Micro-account users benefit ...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #AI
❀28πŸ‘¨β€πŸ’»2✍1
The article explores the concept of refining Fibonacci retracement levels by utilizing a systematic, data-driven approach. Traditional levels, often used by traders, may overlook non-standard but frequently occurring retracement points. The study employs historical OHLCV data and statistical filtering to identify these "hidden" levels, enhancing existing trading strategies. Using a two-stage process, the research gathers extensive market data and applies statistical methods to isolate consistent intermediate levels not captured by traditional ratios. A custom data collection script in MQL5 processes large datasets, aiming to improve signal quality. Python and Jupyter Notebook are utilized for further statistical analysis, offering robust insights into market behaviors.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Fibonacci
❀20πŸ‘11πŸ‘¨β€πŸ’»3πŸ€”2🀩1
Unlock sophisticated asset prediction with Multitask-Stockformer, a cutting-edge framework leveraging deep learning for stock forecasting. Combining wavelet transforms with self-attention networks, this model captures both high-frequency market fluctuations and long-term trends. By decomposing historical data into distinct components, it accurately forecasts returns using dual-frequency encoders and decoders. Ideal for traders and developers, it employs graph attention networks to map complex market relationships, ensuring refined trading strategies. The seamless integration with MQL5 underlines its practical applicability in algorithmic trading environments. Whether you're refining multifactor strategies or venturing into deep learning, Multitask-Stockformer represents a significant technical advancement.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Finance
❀22πŸ‘4πŸ‘¨β€πŸ’»4✍1πŸŽ‰1πŸ‘Œ1
ETARE presents a modern approach to algorithmic trading by integrating genetic optimization, machine learning, and advanced risk management. This system continually adapts to market conditions through an innovative trading loop, periodically refining strategies every 50 trades. Each trading instrument receives individual analysis based on recent data, ensuring precise position management. The strategies employ a descending volume approach to manage risk and maximize profits. A comprehensive trading decisions database ensures continuous learning, allowing the system to optimize for future trades. Through rigorous testing, ETARE has demonstrated adaptability across various market conditions, embodying a resilient and evolving trading system.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AITrading
❀51πŸ‘6πŸ‘Œ6πŸ‘¨β€πŸ’»2
The default moving average indicator on popular trading platforms doesn't provide alerts for crossovers, leading traders to potentially miss significant market movements. CrossFire Alert addresses this gap effectively. This advanced moving average crossover tool ensures instant notifications through various channelsβ€”on-screen, email, or push notificationsβ€”whenever two moving averages intersect. Users have the flexibility to display two customizable MAs and select among Simple, Exponential, Smoothed, or Weighted types. Additionally, traders can modify period, shift, colors, and how signals appear on the chart. CrossFire Alert not only identifies new market trends and reversals in real-time but also supports strategies in both trending and reversing markets. By providing timely alerts, it eliminates the need for constant chart monitoring, facilitating a m...

πŸ‘‰ Read | Freelance | @mql5dev

#MQL4 #MT4 #Indicator
❀36πŸ‘¨β€πŸ’»3πŸ‘€2