MQL5 Algo Trading
388K 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
Explore the power of the Variable Index Dynamic Average (VIDYA) for algorithmic trading in MetaTrader 5. Developed by Tushar Chande, this trend-following indicator adapts based on volatility, offering dynamic insights for traders. The VIDYA uses the Chande Momentum Oscillator (CMO) to adjust like an exponential moving average, ideal for identifying trends and generating signals. Implement strategic approaches such as trend identification and crossover signals using MQL5 for precision trading. This approach allows traders to automate decision-making, enhancing efficiency and accuracy in volatile markets. Develop customizable trading systems to leverage VIDYA's capabilities, ensuring comprehensive market analyses and informed trading decisions.
#MQL5 #MT5 #Indicator #Strategy

Read more...
πŸ‘24❀8🀯4πŸ‘¨β€πŸ’»2
The Support and Resistance MetaTrader indicator visualizes crucial trading levels directly on your chart, aiding in the strategic placement of stop-loss and take-profit points. This tool leverages the standard MetaTrader Fractals indicator based on Bill Williams' method and is available for both MetaTrader 4 and 5 platforms. It comes with no adjustable input parameters, ensuring straightforward usage.

Alerts can be customized via input parameters. EnableNativeAlerts triggers a popup when price levels are breached. Email notifications can be activated with EnableEmailAlerts, given email settings are configured under Tools->Options->Email. Push notifications are possible through EnablePushAlerts, contingent on proper setup in Tools->Options->Notifications. Alerts can be configured to issue based on either the Previous or Current candle, providing flexibi...
#MQL4 #MT4 #Indicator #Trading

Read more...
πŸ‘13❀8✍8πŸŽ‰1πŸ‘¨β€πŸ’»1
The TD Sequential Ultimate indicator provides a comprehensive representation of Tom DeMark's Sequential method. It highlights Buy and Sell Setups inclusive of Setup Perfection arrows and provides the Buy and Sell Countdowns along with failed count 13 attempts. It also displays TDST Support and Resistance levels. Notably, this version offers several enhancements over traditional implementations.

Key features include customizable input parameters such as MaxBars, which determines how many bars are calculated, and various color settings for Buy and Sell Setups. Users can adjust font properties, arrow width, and pixel distance for better visualization on charts.

Additionally, the indicator supports various alert options, such as notifications for completed Setups, Setup Perfections, and critical Countdown candles. Alerts can be configured to trigger...
#MQL4 #MT4 #Indicator #TDSequential

Read more...
πŸ‘19❀8πŸ”₯4πŸ‘¨β€πŸ’»3✍2πŸ‘Œ2
The Total Power Indicator enhances traditional oscillators by integrating Bear and Bull Power indicators into a single tool. It provides a clearer long-term perspective by calculating the dominance of bullish and bearish bars over a set period. This results in continuous lines representing the relative average bear and bull power, helping traders to better understand market trends.

The initial MetaTrader 4 version was developed in 2011, and an MT5 version is now available. The indicator has configurable parameters: Lookback Period, Power Period, and several alert options. Alerts can trigger based on power level reaching 100 or crossover events and can be delivered via on-screen notifications, emails, or push alerts.

This indicator allows the observation of entry and exit points: a line reaching 100 indicates a potential reversal, while crossovers bet...
#MQL4 #MT4 #Indicator #Strategy

Read more...
πŸ‘18❀12πŸ‘¨β€πŸ’»3⚑2
The Trade Assistant MetaTrader indicator offers an integrated solution for comprehensive trend analysis using three standard technical indicators: Stochastic Oscillator, RSI, and CCI. It provides trend directions across nine timeframes from M1 to MN1, delivering an extensive overview of market trends in any chosen timeframe. Compatible with both MT4 and MT5, the indicator's configuration includes several adjustable input parameters, such as CheckCandle, PercentK, PercentD, and Slowing for the Stochastic Oscillator, as well as RSIP1 and RSIP2 for the RSI.

Additional settings enable the display and alert functionality, including native MetaTrader alerts, email notifications, and push alerts, enhancing the indicator's utility in trading strategies. These notifications require appropriate configuration under MetaTrader's Tools->Options settings. It's a rel...
#MQL4 #MT4 #Indicator #Trading

Read more...
πŸ‘18πŸ‘¨β€πŸ’»12❀8πŸ‘Œ2
The Support and Resistance indicator for MetaTrader presents key market levels directly on the chart to aid in decision-making for stop-loss and take-profit points. This indicator utilizes the standard Fractals method by Bill Williams and is compatible with MetaTrader 4 and 5, offering no adjustable input parameters.

Key features include alert systems for price action relative to support or resistance levels. Alerts can be configured for native popups, emails, or push notifications. Email alerts require proper configuration in MetaTrader under Tools->Options->Email, while push notifications are set up under Tools->Options->Notifications. There is also the flexibility to select the TriggerCandle parameter, allowing alerts for either the most recently closed candle or the current active candle.
#MQL5 #MT5 #Indicator #AlgoTrading

Read more...
❀35πŸ‘16πŸ‘¨β€πŸ’»3⚑2✍1
The Coppock MetaTrader indicator is a technical analysis tool designed for detecting long-term buy and sell opportunities. Created by Edward Coppock in 1962, it employs a weighted moving average method to analyze the sum of two rates of change. The classic version uses a 10-period moving average based on rates of change with periods of 14 and 11. This version for MetaTrader platforms, including MT4 and MT5, allows customization of these parameters.

Default settings include ROC1Period at 14 and ROC2Period at 11 for the rates of change, MAPeriod at 10 for the moving average, and MAType at 3 (WMA) for the moving average method in MT4. Modification of MAType is typically not recommended.

The strategy involves initiating buys when the curve ascends from a trough below zero and selling when it descends from a peak above zero. Smaller fluctuation peaks a...
#MQL5 #MT5 #Indicator #AlgoTrading

Read more...
πŸ‘32❀19πŸ‘€4πŸ‘¨β€πŸ’»2
Understanding the various components of a trading Expert Advisor (EA) can enhance automated trading strategies. Here are key points on the structure and logic of an EA using enums, input parameters, and essential functions:

Enums define signal types and order actions in the EA. `enumJnsSignal` distinguishes between a cross of two Moving Averages (eTypeCrossMA) and trend-following through Moving Averages and Stochastic (eTypeTrend). `enumOrderType` categorizes buy (`eBuy`), sell (`eSell`), or no action (`eNone`).

Input parameters personalize the EA's trading behavior. These include unique identifiers like `inMagicNumber`, trade size settings (`inLotSize`, `inMultiply`), grid strategies (`inJarakLayer`), and indicator customization such as MA and Stochastic values.

Key functions manage trading logic. Initialization occurs in `OnInit()`, ensuring MA settin...
#MQL5 #MT5 #EA #AlgoTrading

Read more...
πŸ‘20❀12πŸ‘¨β€πŸ’»3⚑2πŸ’”2
Navigating volatile markets requires robust strategies; combining VWAP with Fibonacci retracement offers a dynamic approach for MetaTrader 5 developers. The integration of VWAP's volume-backed insights with Fibonacci's historical price levels enhances signal accuracy, reducing false alarms. This system operates through MQL5 EAs and a Python server, exchanging data to generate signals. A buy signal occurs when VWAP is below mid-range Fibonacci, and sell signals occur when above, aligning volume and price action. This solution offers traders precise decision-making tools and demonstrates technical synergy between MQL5 and Python for effective trading insights and visualization.
#MQL5 #MT5 #Fibonacci #TradingStrategy

Read more...
πŸ‘27❀8πŸ‘¨β€πŸ’»3πŸ’―2πŸ‘Œ1
Developing effective trading strategies relies heavily on accurate future price movement predictions. This precision is achieved using complex deep learning models that leverage inherent periodicity and trends in the data. Currency price movements often tie closely to specific trading sessions. Discretizing time series by these sessions reveals periodic and sequential trends, facilitating data decomposition.

This technique enables the development of lightweight forecasting models like SparseTSF. This model simplifies long-term forecasting to basic trend prediction, minimizes data complexity, and significantly economizes computational resources. SparseTSF represents a major innovation by employing minimal parameters while efficiently capturing the essential periodicity and trends of time series data.
#MQL5 #MT5 #Forecasting #AlgoTrading

Read more...
❀21πŸ‘10πŸ‘¨β€πŸ’»3πŸ‘€3
Explore the innovative approach to algorithmic trading with our automated Order Block Detection System, crafted in MetaQuotes Language 5 (MQL5). This system leverages smart money concepts by identifying key institutional order blocks directly on trading charts, a shift from traditional indicators. Traders can now visually assess zones of potential market reversal or trend continuation, thanks to a structured methodology that emphasizes price structure over arbitrary indicators. The comprehensive guide outlines the system's development, including price action analysis, MQL5 implementation, and robust backtesting, providing a valuable resource for developing advanced trading algorithms aligned with market dynamics.
#MQL5 #MT5 #AlgoTrading #Strategy

Read more...
πŸ‘37❀23πŸŽ‰7✍5πŸ‘¨β€πŸ’»5πŸ‘4πŸ‘€1
In the absence of a default event handling function for new bar openings in MetaTrader, developers must implement their own detection logic. By monitoring the opening time of the current bar, it becomes possible to react to a new bar formation when this time changes. The sample code provided for both MQL4 and MQL5 illustrates how to implement such a mechanism. It leverages a static variable to retain the bar’s opening time across multiple OnTick() events, distinct from regular local variables which lose their state upon exiting the function. This is crucial for accurately detecting when a new bar begins. Additionally, care must be taken when initially deploying the Expert Advisor, as it will interpret the first run as detecting a new bar. Special handling may be required for this scenario based on specific needs. Access to the full source code of this functi...
#MQL5 #MT5 #EA #Algorithm

Read more...
❀24πŸ‘18πŸ†1πŸ‘¨β€πŸ’»1
In the series on mastering log records in MQL5, the focus has been on developing a custom log library to surpass the limitations of MetaTrader 5's native logs. Key aspects covered include creating a robust structure using the Singleton pattern, implementing advanced persistence for audit trails, and classifying logs by levels. Flexibility in log output formats allows developers to cater to specific project needs.

The latest development introduces caching and file rotation to enhance file-based log storage. By caching log messages, the library reduces disk I/O operations, boosting performance. File rotation, based on size or date, ensures logs are manageable by archiving older logs and preventing excessive accumulation.

Real-world applications have shown significant performance improvements with these enhancements. Performance tests revealed substantial r...
#MQL5 #MT5 #EA #AlgoTrading

Read more...
πŸ‘23❀8πŸ‘¨β€πŸ’»1
The article highlights key insights for developing effective trading strategies in MetaTrader 5. It advises on spotting unreliable Expert Advisors (EAs) by examining claims about AI integrations and mentions the pitfalls of look-ahead bias and misrepresented AI usage. To avoid overfitting, it suggests utilizing longer data periods and limiting tunable parameters during optimization. The piece stresses the importance of considering commission and spread impacts in backtesting, especially for high-frequency strategies. It also recommends in-sample and out-of-sample testing to ensure model robustness, focusing on maintaining a consistent profit factor and keeping drawdown within acceptable limits.
#MQL5 #MT5 #Strategy #AITrading

Read more...
πŸ‘22❀8πŸ‘¨β€πŸ’»1
Recent research has highlighted limitations in deep learning-based time series modeling, noting that shallow networks or linear models often outperform them on certain benchmarks. As foundational models in NLP and CV advance, their adaptation to time series data remains a challenge. TEMPO is introduced as a generative pre-trained transformer model focused on time series forecasting. It uses GPT and a two-component analytical framework to address specific temporal patterns like trends and seasonality. TEMPO enhances prediction accuracy by decomposing time series data into components, enriching model performance through an innovative prompt-based approach. This approach combines trend, seasonality, and residuals for a cohesive forecasting solution.
#MQL5 #MT5 #TimeSeries #AITrading

Read more...
πŸ‘35❀33πŸ‘¨β€πŸ’»2
The code framework consists of three main components for handling economic news data in MetaTrader 5.

1. CalendarRetriever.mq5 (Script): This script fetches historical economic news events and stores them in the "Common" folder of the terminal. It outputs files such as `Countries.txt`, `Events.txt`, and `News.bin`, which are crucial for backtesting. Input parameters include a start date and an end date.

2. CalendarFile.mq (Include File): This file structures news data management within an expert advisor. It features classes like `CalendarFileWriter` for data storage and `CalendarFileReader` for data retrieval and processing during trading.

3. NewsBacktest.mq5 (Expert Advisor): This component leverages the stored news data to simulate real-time conditions in the strategy tester. It uses functions like `LoadEvents()`, `LoadCountries()`, and `LoadValues(...
#MQL5 #MT5 #Script #Strategy

Read more...
❀25πŸ‘13⚑2🀯1πŸ‘¨β€πŸ’»1
Discover how to master JSON parsing in MQL5 without a built-in library. This article guides you through creating a flexible JSON reader for MetaTrader 5, ideal for integrating web API data and local configurations. It covers parsing essential JSON elementsβ€”strings, numbers, arrays, and objectsβ€”and discusses converting MQL5 data structures into JSON. Practical use cases include fetching market data and transmitting trade logs. Learn to address challenges like special characters and whitespace handling. By the article’s end, you’ll craft a custom, robust JSON parser, enhancing your algorithmic trading strategies with dynamic configuration capabilities. Explore JSON integration seamlessly in your trading programs.
#MQL5 #MT5 #MQL5 #JSONParser

Read more...
πŸ‘17❀14πŸ‘¨β€πŸ’»3✍1πŸ”₯1
The construction of a custom Keltner Channel indicator in MQL5 requires an understanding of both its theoretical framework and practical implementation. This volatility-based indicator functions by using a Moving Average for centerline smoothing and an Average True Range (ATR) for the upper and lower bands, adjusting for dynamic support and resistance levels.

The development process involves decomposing the indicator architecture into core elements like input parameters, indicator buffers, and graphical properties. Buffers are utilized for storing the computed channel values, linked to graphical display components via MQL5 functions, ensuring adaptability to market volatility.

For visualization, custom canvas graphics enhance the indicator's output, providing a clearer, more informative trading tool. The modular design emphasizes separability of data...
#MQL5 #MT5 #Indicator #Strategy

Read more...
❀14πŸ‘12πŸ‘¨β€πŸ’»2πŸ†1
Soft Actor-Critic (SAC) is a powerful reinforcement learning algorithm known for its balance between exploration and exploitation. Central to SAC is the replay buffer, which stores diverse experiences for improved learning stability and efficiency. While simple implementations using Python lists or NumPy are effective for small problems, leveraging PyTorch or TensorFlow offers scalability and GPU acceleration.

The algorithm employs two critic networks to reduce bias and uses target networks for stability. Critic networks estimate Q-values crucial for policy updates, while the optional value network provides smoother targets. The actor network calculates action distributions aiding in exploration in continuous action spaces. For large-scale implementations, tensor-based approaches are superior in performance.
#MQL5 #MT5 #ReinforcementLearning #AlgoTrading

Read more...
❀15πŸ‘10πŸ‘¨β€πŸ’»4πŸ‘€2πŸ†1
Dive into the intricacies of MetaTrader 5's new Free Robots, offering a comprehensive suite of 28 Expert Advisors (EAs) designed around candlestick patterns and supported by technical indicators like CCI, MFI, RSI, and Stochastic Oscillator. These EAs provide traders with a dynamic approach to identify potential market reversals through tested patterns such as BlackCrows WhiteSoldiers, BullishBearish Engulfing, and more. Learn how each EA integrates a systematic logic flow β€” from pattern detection to trade execution and closure based on indicator signals β€” enabling developers to enhance their algorithmic trading strategies with precision and efficiency.
#MQL5 #MT5 #EA #Trading

Read more...
πŸ‘28❀15πŸ‘¨β€πŸ’»5πŸ‘Œ2
Exploring the intricacies of variables and functions, the article delves into how static variables help avoid unnecessary global variables, highlighting the role of functions as special types of variables that can return data types, unlike procedures. It explains the nuances of handling functions as constant variables across different programming languagesβ€”JavaScript, Python, C, C++, and MQL5. The text further clarifies the distinction and application of predefined variables in MQL5, which, while appearing as constants, can be modifiable under specific conditions using certain functions. This approach enhances code readability, maintainability, and security, crucial for developers working with algorithmic trading.
#MQL5 #MT5 #programming #variables

Read more...
πŸ‘28❀22πŸ‘¨β€πŸ’»11