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 universal class library is now available for implementing diverse StopLoss trailing strategies in trading robots. This library enables flexible management of StopLoss for open positions based on a fixed distance from the price or using popular indicators like Parabolic SAR, AMA, DEMA, FRAMA, MA, TEMA, VIDYA, and even custom levels.

The solution is integrated into MQL5 Expert Advisors by connecting the required class, setting parameters, and executing the Run() method in OnTick(). Classes include CSimpleTrailing for price-based trailing and CTrailingByInd for indicator-based trailing, with further subclasses like CTrailingBySAR and CTrailingByAMA for specific strategies.

Key parameters include SetSymbol, SetMagicNumber, SetStopLossOffset, SetTrailingStart, SetTrailingStep, SetSpreadMultiplier, and SetActive. Indicator classes have additional parameter...

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #Trading
❀47πŸ‘¨β€πŸ’»5🀯3πŸ‘Œ2
A new function is available to convert server times between broker time zones, specifically for stored times of bars, ticks, or economic calendar events. Identifying DST schedules for source and destination servers, whether US, EU, or none, is facilitated using an online script. The function incorporates standard offset notation, like JavaScript, where positive time zones have positive offsets (GMT+3 as +10800) and negative time zones have negative offsets. This contrasts with MQL5’s TimeGMTOffset(), which inverses this relationship. For a thorough understanding and extended functionality, the complete library is accessible online. It comes with additional features for enhanced time zone management.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #script
❀28πŸ‘¨β€πŸ’»5πŸ’―2πŸ‘1πŸ‘Œ1
Support and resistance zones are crucial concepts in technical analysis, serving as key psychological barriers for traders. Understanding these levels is essential as they significantly influence market participants' decisions. Support zones indicate areas where buying pressure exceeds selling pressure, causing price rebounds. Conversely, resistance zones denote levels where selling pressure halts upward movement.

The focus here is to automate the identification of these zones using an EA. By analyzing recent price data, the EA can spot swing highs and lows, pivotal for defining these zones. A swing low is characterized by a candle with a low price lower than its preceding and succeeding candles, while a swing high has a higher price.

For support zones, the EA logs relevant data, such as swing low time and price, ensuring no candle breaks below this zone t...

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Trading
❀35πŸ‘10πŸ‘¨β€πŸ’»2πŸ‘Œ1
Explore the latest advancements in building a robust statistical arbitrage framework tailored for MetaTrader 5 traders. The initial setup includes Python classes for cointegration tests and a comprehensive database to facilitate real-time strategy updates. A key focus is a scoring system that critically evaluates liquidity, transaction costs, and stability of portfolio weights to ensure efficiency. Additionally, strategic criteria like data frequency and lookback period can greatly impact trading outcomes. This detailed approach not only enhances the reliability of trading systems but also bridges the gap between theoretical concepts and practical, testable algorithmic trading strategies.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Algorithm
❀27πŸ‘2πŸ‘Œ2πŸ‘1πŸ‘¨β€πŸ’»1
The article focuses on the All Sessions EA, a MetaTrader 5 tool designed to enhance understanding of global forex market sessions by visualizing them directly on trading charts. The EA aligns with broker server time, automatically drawing session boxes for Asia, Tokyo, London, and New York, providing clear differentiation without time zone confusion. It includes user-friendly features like on-chart toggles and real-time alerts for breakout events, aiding traders in assessing volatility shifts. The modular, event-driven design ensures efficient resource usage and intuitive interaction, offering both beginner and experienced traders a detailed, real-time map of trading activity worldwide.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #Forex
❀52πŸ‘Œ5πŸ‘¨β€πŸ’»3
The Bollinger Bands Squeeze is a significant technical signal indicating potential changes in market volatility. Bollinger Bands consist of a middle band (20-period Simple Moving Average) and upper and lower bands calculated as the middle band plus or minus two standard deviations. The squeeze phenomenon occurs when the bands narrow significantly, suggesting an impending volatility shift.

During a squeeze, the market enters a consolidation phase, with low price fluctuations as buying and selling pressure balance. This scenario is a precursor to a breakout with substantial price movement, though the directionβ€”upward or downwardβ€”remains uncertain.

Signs of an impending breakout include increased trading volume and other technical indicators like candlestick patterns and RSI. Thus, recognizing a Bollinger Bands Squeeze allows traders to anticipate...

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #BollingerBands
❀42πŸ‘¨β€πŸ’»2
The ExpWPRBB Expert Advisor employs a straightforward trading approach utilizing Williams' Percent Range (WPR) and Bollinger Bands (BB). Positions are initiated when both indicators align: for a Buy, WPR exits the oversold territory, and the bar opens below the average BB line. For a Sell, WPR leaves the overbought zone, and the bar opens above the average BB line. Bollinger Bands breadth and ATR values determine Stop Loss and Take Profit levels. Functionality is exclusive to hedging accounts. An optional non-trading mode is available for signal visual testing.

Core input parameters include WPR and Bollinger Bands periods, deviation, shift, and price type. Trading parameters comprise signal-only mode, position volume, slippage tolerance, and a unique Magic number for tracking. Stop Loss and Take Profit can be predefined or dynamically computed using Bollinge...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #EA
❀29⚑3πŸ‘Œ3πŸ‘¨β€πŸ’»3πŸ‘€3✍2πŸ”₯2
Explore the power of Moving Averages in algorithmic trading with an informative guide on system design using MQL5 for MetaTrader 5. Discover three effective strategies: one, two, and three Moving Averages crossovers, each with distinct advantages in trend analysis. Learn to minimize whipsaws and optimize trading decisions by implementing these strategies systematically. This article provides clear coding examples and detailed steps for integrating Moving Averages into your trading setup, enhancing decision-making accuracy. Perfect for both seasoned developers and traders new to algorithmic solutions, this educational piece emphasizes practical application while keeping complex concepts accessible.

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #Trading
❀47πŸ‘5πŸ†5πŸ‘¨β€πŸ’»3πŸ‘Œ1
ExpPinBar Expert Advisor leverages a strategy centered around the Price Action PinBar indicator to initiate trades based on indicator signals. The tool features advanced trailing functionalities accessible through the trailing library, incorporating mechanisms like classic trailing, Parabolic SAR, and various moving averages such as AMA, DEMA, FRAMA, MA, TEMA, and VIDYA. It also considers High and Low candlestick shadow levels. Critical settings for the PinBar include defining minimum and maximum candle sizes and the position of the body relative to the preceding candle.

To optimize signals, users can adjust parameters like the aspect ratio of shadows. The configuration options for the advisor cover essentials such as position volume, slippage, magic numbers, and dynamic stop loss and take profit points based on PinBar shadows. Trailing settings allow cust...

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #EA
❀27πŸ‘5πŸ‘¨β€πŸ’»2πŸ‘Œ1
Explore efficient trade management with the AutoProtect Expert Advisor. This advanced solution automates crucial aspects like moving stop-losses to break-even, trailing stops as positions gain, and partial profit-taking. Built in the MQL5 environment, it provides flexibility for traders to customize individual functions according to their strategy. AutoProtect uniquely manages trades per symbol and supports filtering by magic number, allowing precise control. It enhances trading efficiency by focusing on real-time market dynamics, eliminating risks of manual errors. The structured, modular code supports easy updates, ensuring consistent and reliable trade adjustments. Ideal for both seasoned and aspiring MetaTrader 5 developers, AutoProtect optimizes trade management seamlessly.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #EA
❀33πŸ‘€5πŸ‘¨β€πŸ’»3✍1πŸ‘Œ1
In Part 37 of our series on MetaQuotes Language 5 (MQL5), we delve into developing a Regular RSI Divergence Convergence System with visual indicators. This system identifies bullish and bearish divergences between price swings and RSI values, automating trades with optional risk controls. The strategy detects potential trend reversals by spotting discrepancies between price action and RSI, using confirmed swing points and allowing for a clean divergence through tolerance buffers. We explore efficient MQL5 implementation, providing visual aids like colored lines for enhanced monitoring. This system empowers traders to capitalize on reversal setups with precise risk and reward management. Practical applications for algorithmic trading are highlighted.

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Strategy
❀38πŸ‘Œ4πŸŽ‰2πŸ‘¨β€πŸ’»2
The article delves into the complexities of financial machine learning, highlighting a critical challenge faced by algorithmic trading models: label concurrency. In financial time series, labels that overlap in time create dependencies that contradict the Independent and Identically Distributed (IID) assumption of most ML algorithms. This often leads to overfitted models with poor out-of-sample performance. The solution proposed involves sample weighting based on average uniqueness, quantifying the unique information each data point represents and adjusting weights accordingly. This adjustment aims to rectify model training by prioritizing unique data points. The discussion also introduces three methods to handle non-IID data, focusing on bagging techniques and specific measures to enhance model reliability in trading environments.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #ML
❀64πŸ‘Œ8🀣6πŸ‘4🀑2πŸ‘¨β€πŸ’»1
The Average True Range (ATR) indicator, introduced by J. Welles Wilder in 1978, remains a crucial tool for analyzing market volatility. It calculates the largest True Ranges over a specified period and provides insights into price movements and trading opportunities. Wilder later introduced smoothing to calm the fluctuations, utilizing a simple moving average typically over a 14-period range.

For those interested in expanding their toolkit, various multi-timeframe indicators and other technical tools are available through CodeBase or the Marketplace. Searching for specific methodologies, such as Alligator, MACD, or Bollinger Bands, can enhance analytical capabilities. Consider leveraging adaptive moving averages or volume-weighted averages to improve predictive accuracy in trading strategies.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #ATR
❀37πŸ‘Œ3πŸ‘¨β€πŸ’»3⚑1πŸ‘1πŸ‘€1
Traditional trading strategies often overlook the changing dynamics of portfolio sensitivity, particularly Delta's acceleration with price fluctuations. The article advocates using Black-Scholes Greeksβ€”Gamma and Deltaβ€”for strategic risk management and optimization. Gamma, the rate of Delta's change, enables proactive adjustments rather than reactive hedging. The article walks through setting up MQL5 scripts utilizing statistical methods and mathematical functions to calculate key metrics. By capturing historical data and real-time sensitivities for the EU50 index, traders can make data-driven decisions with Gamma and Delta analysis. Through this framework, traders gain a clearer picture of risk exposure and market sensitivity, refining their strategic approach.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #Gamma
❀52πŸ†8πŸ‘6πŸ‘Œ4πŸ’―1πŸ‘¨β€πŸ’»1
A code snippet is available for writing price values to a file, serving various practical scenarios in programming. This functionality is particularly beneficial for developing a local trade copier that utilizes a file-based transfer approach. Additionally, it provides a method for temporarily saving values, allowing them to be read in subsequent login sessions. Beyond these use cases, the code can also be used for logging custom data into a file for future reference. The ability to write data onto a file efficiently supports a range of applications, from transaction replication to persistent storage of temporary data. This approach is advised for operations requiring structured data archival and retrieval across sessions.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL4 #MT4 #Script
❀20πŸ‘4✍1πŸ‘¨β€πŸ’»1
Discover how MetaTrader 5 communicates with external platforms through APIs and enhances trading automation by integrating with Telegram using the WebRequest() function in MQL5. Dive into practical applications where you learn to send, edit, and delete messages using Telegram's API. This involves understanding the crucial components like bot tokens, chat IDs, and message IDs, which facilitate secure and precise message handling. Gain insights into setting timeout parameters and formatting data for API requests, ensuring seamless interaction between your trading platform and messaging services. This exploration offers valuable skills for developers and traders looking to leverage automated, real-time communication within MetaTrader 5.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #API
❀24πŸ‘¨β€πŸ’»2
A new strategy to visualize wick regions on lower-timeframe charts has been initiated. The primary goal is to enhance the Market Periods Synchronizer, integrating a Wick Visualization Utility. This tool isolates the upper and lower wick regions of higher-timeframe candles, rendering them with semi-transparent rectangles for detailed analysis.

To implement this, several technical steps are crucial. Initialization involves setting up a mutable UI for real-time interactions using a CCanvas bitmap label. This ensures efficient use of screen real estate while maintaining per-chart isolation through specific naming conventions.

The core logic focuses on rendering wicks only when a toggle is active. This involves calculating the top and bottom of candle bodies, and highlighting their wicks distinctly above and below these thresholds. These regions are prog...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #Trading
❀42⚑5πŸ‘¨β€πŸ’»1πŸ‘€1
Financial markets present complex challenges due to their volatile nature, demanding sophisticated decision-making processes. Traditional frameworks involve analysts, risk managers, and executives but often struggle with agility and efficiency due to human limitations and hierarchical structures. The advent of AI and automated systems provides a solution by enhancing decision accuracy and speed.

Modern AI research focuses on adaptive software that learns from historical data, recognizing patterns for informed decisions. An intriguing development is Natural Language Processing (NLP) integration, enabling thorough analysis of financial news and forecasts for improved predictions.

The FinCon framework exemplifies progress, simulating professional team workflows with adaptive, multi-agent systems for efficient financial operations and risk management. This innov...

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #FinTech
❀46⚑5πŸ‘¨β€πŸ’»2✍1
WaveWeisBarForce is a technical indicator designed to analyze market volume dynamics using the Weis wave methodology. It tracks and accumulates volumes within a trend, resetting when a directional change occurs. The indicator measures intensity by comparing the current wave volume to the largest recent accumulation, offering a window into market behavior. Input parameters include Volume_type, which allows selection between tick and real volume sources, and Intensity for determining the reference bar window.

The indicator provides visual cues with Bullish Levels (1 to 4) in shades of green from light to LIME, and Bearish Levels (1 to 4) from light red to RED. WaveMax highlights the highest volume bar per wave, while WaveClimax indicates when current wave accumulation surpasses historical records. This indicator supports various assets and timeframes...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
❀40πŸ‘€4πŸ‘3πŸ‘¨β€πŸ’»3
Explore how fractals can redefine market analysis in algorithmic trading. By translating trading history and backtests into mathematical expressions, we can uncover new dimensions of strategy development. Learn to apply fractal models to both pricing and trading strategies, leveraging the Bernoulli scheme for probability evaluations with two-state or multi-state systems. This approach not only organizes trading data into actionable insights but also prepares us for complex model analysis. As developers, we gain the tools to convert diverse trading strategies into coherent, data-driven models, potentially enhancing predictive accuracy and trading efficiency in MetaTrader 5 environments.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #DataAnalysis
❀45πŸ‘7πŸ‘¨β€πŸ’»5⚑2πŸ”₯2