In MT5, the standard NewTick event triggers only for the symbol on which an Expert Advisor (EA) is active, making multisymbol trading challenging. To address this, a library has been created to implement a multisymbol OnTick event across specified trading symbols. It serves as a convenient enhancement to the existing framework.
This is showcased through an example of a multisymbol EA designed to tally incoming ticks for each specified symbol. By using the MT5 Tester, users can verify EA functionality. Symbols of interest are input after a comma, dictating the multisymbol OnTick's scope. Results from the Tester confirm that all ticks for these symbols are processed appropriately. This ensures EAs function consistently without reliance on a base symbol, as ticks for all specified symbols are captured efficiently.
π Read | Calendar | @mql5dev
#MQL5 #MT5 #EA
This is showcased through an example of a multisymbol EA designed to tally incoming ticks for each specified symbol. By using the MT5 Tester, users can verify EA functionality. Symbols of interest are input after a comma, dictating the multisymbol OnTick's scope. Results from the Tester confirm that all ticks for these symbols are processed appropriately. This ensures EAs function consistently without reliance on a base symbol, as ticks for all specified symbols are captured efficiently.
π Read | Calendar | @mql5dev
#MQL5 #MT5 #EA
β€45π9π3
Implementing RSA in its raw form offers insight into its encryption process. Create an RSA instance and format the message to encrypt into a uchar[] array. Apply EncryptPKCS1v15 for encryption, producing a char array result, altered by padding particulars.
Real-world applications often employ RSA in tandem with AES due to RSA's computational load and key size restrictions. Hybrid models overcome these by encrypting a randomly generated AES session key with RSA, while the data payload is secured using AES, optimal for larger data due to its speed. The AES-encrypted message and RSA-encrypted key are sent together, efficiently blending the benefits of both algorithms, with RSA securing the AES key exchange and AES providing rapid data encryption.
Within MQL5, this amalgamation facilitates secure communication between components via built-in CryptEncode(...
π Read | Freelance | @mql5dev
#MQL5 #MT5 #RSA
Real-world applications often employ RSA in tandem with AES due to RSA's computational load and key size restrictions. Hybrid models overcome these by encrypting a randomly generated AES session key with RSA, while the data payload is secured using AES, optimal for larger data due to its speed. The AES-encrypted message and RSA-encrypted key are sent together, efficiently blending the benefits of both algorithms, with RSA securing the AES key exchange and AES providing rapid data encryption.
Within MQL5, this amalgamation facilitates secure communication between components via built-in CryptEncode(...
π Read | Freelance | @mql5dev
#MQL5 #MT5 #RSA
β€38β‘9π2
The BBMA strategy, developed by Ali Oma from Malaysia, incorporates Bollinger Bands and Moving Averages to identify market movements. The strategy emphasizes the combination of signals from various time frames, enhancing the probability of successful entries. Key components include CSA/CSAK, MHV, Momentum, and Reentry Zone ZeroLoss. The integration of these elements into clear standard operating procedures aids traders in discovering high-probability entry points.
The BBMA indicator simplifies analysis by displaying all signals concurrently on a chart. It minimizes the chance of missing crucial market movements. Separate data buffers for each signal facilitate the integration with Expert Advisors, supporting custom dashboard development or fully automated trading systems. This structured approach provides a comprehensive outlook on market trends for effec...
π Read | AppStore | @mql5dev
#MQL5 #MT5 #BBMA
The BBMA indicator simplifies analysis by displaying all signals concurrently on a chart. It minimizes the chance of missing crucial market movements. Separate data buffers for each signal facilitate the integration with Expert Advisors, supporting custom dashboard development or fully automated trading systems. This structured approach provides a comprehensive outlook on market trends for effec...
π Read | AppStore | @mql5dev
#MQL5 #MT5 #BBMA
β€49β10π3
The third part of our series enhances a gauge-based MQL5 indicator for displaying multiple oscillators like RSI, CCI, and MFI. Building on previous work, this iteration introduces sector and round gauge styles with advanced rendering, employing derived classes for tailored visualization.
The framework supports selective indicator combinations via user inputs. It utilizes enumerations for gauge selection and null mark positioning, allowing flexible layouts, particularly beneficial for showing oscillators with negative ranges like CCI.
The implementation involves setting up and initializing the gauges, creating unique instances for RSI, CCI, and MFI, and managing their visual properties and data representation. The application dynamically updates the buffer data and reflects it graphically, ensuring accurate and visually appealing output.
The prop...
π Read | NeuroBook | @mql5dev
#MQL5 #MT5 #Indicator
The framework supports selective indicator combinations via user inputs. It utilizes enumerations for gauge selection and null mark positioning, allowing flexible layouts, particularly beneficial for showing oscillators with negative ranges like CCI.
The implementation involves setting up and initializing the gauges, creating unique instances for RSI, CCI, and MFI, and managing their visual properties and data representation. The application dynamically updates the buffer data and reflects it graphically, ensuring accurate and visually appealing output.
The prop...
π Read | NeuroBook | @mql5dev
#MQL5 #MT5 #Indicator
β€27π3π2π2π1
Explore the synergy between Python and MQL5 with this insightful article on enhancing file I/O operations in MetaTrader 5. Discover how Python's flexible file handling capabilities can inspire robust solutions in MQL5, including automated file flag generation and abstraction techniques. Dive into the nuances of reading and writing different data types, handling CSV files effectively with custom-built classes, and managing file modes to ensure seamless integration in trading environments. Learn how to simplify complex tasks, reduce errors, and improve code maintainabilityβall without compromising on MQL5's native offerings. Perfect for traders and developers seeking efficient algorithmic trading strategies.
π Read | Quotes | @mql5dev
#MQL5 #MT5 #Python
π Read | Quotes | @mql5dev
#MQL5 #MT5 #Python
β€45π8π7π5
A utility function simplifies timeframe representation by converting full timeframe identifiers such as "PERIOD_M1" to their concise forms like "M1". This can enhance code readability and efficiency by streamlining how timeframes are displayed and referenced in your projects. By using shortened names, the codebase remains clean without losing the clarity of timeframe identification. Implementing such a function improves maintainability and can facilitate easier updates or modifications across projects. Effective for developers looking to optimize their workflow by reducing verbosity in their scripts and ensuring a more intuitive understanding of time-based operations.
π Read | Calendar | @mql5dev
#MQL5 #MT5 #Timeframes
π Read | Calendar | @mql5dev
#MQL5 #MT5 #Timeframes
β€37π6β2π2
Creating custom indicators with candlestick charts in MQL5 involves various methods, each with distinct characteristics. The simplest approach is constructing single-color candles, neglecting highs and lows. More complex is using multicolored candles guided by defined business rules, which aids in interpreting market movements.
Building a basic candlestick chart requires defining price series for open, high, low, and close values. Utilizing buffers to store data is key, and color differentiation is tied to business logic. For example, green indicates buying, red for selling, and yellow reflects a neutral state in the market.
Using DRAW_COLOR_CANDLES allows multicolored candle plotting, adding an extra buffer for storing color data. This buffer facilitates distinguishing between bullish and bearish candles based on preset trading conditions.
If co...
π Read | AppStore | @mql5dev
#MQL5 #MT5 #Indicator
Building a basic candlestick chart requires defining price series for open, high, low, and close values. Utilizing buffers to store data is key, and color differentiation is tied to business logic. For example, green indicates buying, red for selling, and yellow reflects a neutral state in the market.
Using DRAW_COLOR_CANDLES allows multicolored candle plotting, adding an extra buffer for storing color data. This buffer facilitates distinguishing between bullish and bearish candles based on preset trading conditions.
If co...
π Read | AppStore | @mql5dev
#MQL5 #MT5 #Indicator
β€62β13π8π5π₯3
The price channel indicator is a tool allowing customization of both the period and line colors, providing versatility in trading strategies. It is often utilized in channel break strategies, as it helps identify support and resistance levels within market trends. The ability to adjust these parameters offers traders insights into price movements and potential breakout points. This accuracy in setting channels aids in making informed decisions and enhancing strategic approaches. The price channel indicator stands as a valuable resource for traders aiming to pinpoint market entry and exit opportunities while accommodating various personal and trading preferences.
π Read | Calendar | @mql5dev
#MQL5 #MT5 #Indicator
π Read | Calendar | @mql5dev
#MQL5 #MT5 #Indicator
β€44π3π2π¨βπ»2π₯1π1
For traders seeking efficiency, this article delves into optimizing trade execution by analyzing historic Bid/Ask spreads using MetaTrader 5's tick data. It offers a technical solution for evaluating brokers' declared versus actual spreads, particularly during volatile markets or specific trading hours. The article demonstrates how to harness OnInit() and OnCalculate() functions for strategic analysis of recent price actions. This approach empowers traders and developers to make informed decisions by understanding true cost impacts on strategies, especially in high-frequency trading. Ultimately, it highlights the importance of selecting brokers with reasonable spreads to maintain profitability.
π Read | Signals | @mql5dev
#MQL5 #MT5 #Forex
π Read | Signals | @mql5dev
#MQL5 #MT5 #Forex
β€74π4β‘3
Introducing the ZigZag Color Indicator for line charts, designed to operate on close prices instead of high and low values. This tool simplifies trend analysis by focusing on market closures, enhancing clarity in chart readings. The indicator offers a single input parameter, ExtDepth, allowing users to fine-tune the sensitivity of trend detection with minimal effort. Optimized for performance, it ensures efficient chart analysis without compromising on speed or accuracy. Ideal for traders seeking streamlined insights into market movements while maintaining system responsiveness.
π Read | Freelance | @mql5dev
#MQL5 #MT5 #Indicator
π Read | Freelance | @mql5dev
#MQL5 #MT5 #Indicator
β€35β‘6π3π2π2β1
Understanding multi-task learning frameworks in financial market analysis reveals key advantages of using the ResNeXt architecture. This architecture employs a shared encoder to achieve robust pattern extraction across diverse tasks, enhancing generalization and resilience to noise. By reducing model overfitting through joint task training, it increases model stability in volatile markets. Computational efficiency is also improved, crucial for real-time trading systems.
ResNeXt's modularity and grouped convolutions optimize performance without significant computational cost. This flexibility supports task-specific adaptability, crucial for algorithmic trading where latency matters. Integrating multi-task learning with ResNeXt fosters robust modeling for dynamic market conditions.
π Read | Docs | @mql5dev
#MQL5 #MT5 #FinanceAI
ResNeXt's modularity and grouped convolutions optimize performance without significant computational cost. This flexibility supports task-specific adaptability, crucial for algorithmic trading where latency matters. Integrating multi-task learning with ResNeXt fosters robust modeling for dynamic market conditions.
π Read | Docs | @mql5dev
#MQL5 #MT5 #FinanceAI
β€27β8π2
The Successful Restaurateur Algorithm (SRA) offers a unique approach to optimization by focusing on improvement rather than elimination. Unlike traditional methods, SRA enhances weaker solutions by integrating successful elements from better ones, maintaining diversity and steady improvement.
The implementation involves a main loop that selects the least successful "dish," combines it with elements from the best, and evaluates the new solutions. Parameters like temperature and innovation rate control experimentation intensity, balancing exploration and refinement.
Tests show SRA's broad search capabilities but highlight its challenges in precise solution refinement, ranking it 20th among population optimization algorithms. Despite mixed results, SRA's distinctive strategy provides valuable insights for future algorithm development.
π Read | AppStore | @mql5dev
#MQL5 #MT5 #Algorithm
The implementation involves a main loop that selects the least successful "dish," combines it with elements from the best, and evaluates the new solutions. Parameters like temperature and innovation rate control experimentation intensity, balancing exploration and refinement.
Tests show SRA's broad search capabilities but highlight its challenges in precise solution refinement, ranking it 20th among population optimization algorithms. Despite mixed results, SRA's distinctive strategy provides valuable insights for future algorithm development.
π Read | AppStore | @mql5dev
#MQL5 #MT5 #Algorithm
β€64π₯7π6β‘5π€¨5π3β2
Discover momentum deviation bands, an indicator akin to Bollinger bands. This tool assists in analyzing market momentum shifts. Use it as you would Bollinger bands to assess price volatility and potential breakouts. It offers insight into market behavior by tracking deviations from a moving average. This can aid in identifying trading opportunities and gauging market conditions. Employ momentum deviation bands to enhance technical analysis and refine trading strategies. Suitable for those seeking to expand their toolkit with a method focused on interpreting price movement dynamics.
π Read | Docs | @mql5dev
#MQL4 #MT4 #Indicator
π Read | Docs | @mql5dev
#MQL4 #MT4 #Indicator
β€37β5π2
Discover how to create a Mini Chat in MetaTrader 5 with sockets! In this article, explore integrating a chat system using sockets without the need for DLLs. Learn to separate client-server architecture, with clients in MQL5 and an external program as the server. This showcases the adaptability of sockets and offers a practical example of embedding them in a trading platform via an Expert Advisor. The demonstration includes managing connections dynamically and using a circular buffer for messages. Whether you're enhancing trading tools or experimenting with new features, this guide offers valuable insights into integrating interactive elements within MT5.
π Read | Calendar | @mql5dev
#MQL5 #MT5 #Sockets
π Read | Calendar | @mql5dev
#MQL5 #MT5 #Sockets
β€33π1
Testing Non-Random Market Behavior with MQL5
The concepts of market randomness and predictability form the core of trading strategies. This discussion focuses on Larry Williamsβ approach to determining whether markets display non-random behaviors. By utilizing MQL5, experiments are designed to test if certain price patterns appear more often than chance would suggest.
Experiments cover three main areas: overall directional bias within a single candle, conditional probability patterns after sequential candles, and short-term market structures like Williamsβ three-bar pattern. Each experiment uses an algorithmic approach to scan historical data and calculate probabilities.
The MQL5 Expert Advisor is crafted to assess the probability of repeated patterns, simulating real trading conditions by opening and closing positions at candle boundaries. This allo...
π Read | Signals | @mql5dev
#MQL5 #MT5 #Trading
The concepts of market randomness and predictability form the core of trading strategies. This discussion focuses on Larry Williamsβ approach to determining whether markets display non-random behaviors. By utilizing MQL5, experiments are designed to test if certain price patterns appear more often than chance would suggest.
Experiments cover three main areas: overall directional bias within a single candle, conditional probability patterns after sequential candles, and short-term market structures like Williamsβ three-bar pattern. Each experiment uses an algorithmic approach to scan historical data and calculate probabilities.
The MQL5 Expert Advisor is crafted to assess the probability of repeated patterns, simulating real trading conditions by opening and closing positions at candle boundaries. This allo...
π Read | Signals | @mql5dev
#MQL5 #MT5 #Trading
π16β€13β4π3
Explore an advanced AI-powered trading system in MQL5 with enhanced UI features. This includes loading animations for smoother interactions during API requests, precision in response timing, and intuitive response management tools like regenerate and export buttons. The implementation focuses on scalable, modular code, using clear rendering techniques for icons and dynamic updates without affecting core functionalities. Practical for developers, the upgrades facilitate better user engagement and streamlined trading operations. Future enhancements will include sentiment analysis and multi-timeframe signal confirmations for more informed trading decisions.
π Read | Quotes | @mql5dev
#MQL5 #MT5 #AITrading
π Read | Quotes | @mql5dev
#MQL5 #MT5 #AITrading
β€29β‘7β3π2π2π1
Part 33 of the MQL5 series delves into integrating the Google Generative AI API with MetaTrader 5. This tutorial covers sending text-based queries, receiving intelligent responses, and managing API limits like queries per minute, requests per day, and tokens per minute.
Understanding rate limits in API usage is crucial. Requests per Minute (RPM) limit the number of API calls in a minute. Requests per Day (RPD) constrain daily interactions, while Tokens per Minute (TPM) track the computational cost per request. Strategies to optimize usage and maintain smooth performance include request bundling and response caching.
Generating an API key is essential before using the API. The key identifies your application and controls access, ensuring secure interaction with Google's servers.
Enable WebRequest in MetaTrader 5 by adding the API URL to the settings, allowing y...
π Read | CodeBase | @mql5dev
#MQL5 #MT5 #AI
Understanding rate limits in API usage is crucial. Requests per Minute (RPM) limit the number of API calls in a minute. Requests per Day (RPD) constrain daily interactions, while Tokens per Minute (TPM) track the computational cost per request. Strategies to optimize usage and maintain smooth performance include request bundling and response caching.
Generating an API key is essential before using the API. The key identifies your application and controls access, ensuring secure interaction with Google's servers.
Enable WebRequest in MetaTrader 5 by adding the API URL to the settings, allowing y...
π Read | CodeBase | @mql5dev
#MQL5 #MT5 #AI
β€58β10π€―2π1
A lightweight script estimates an exponent (power) factor that measures how closely historical price increments match random-walk scaling. Under the theoretical random walk, displacement grows with the square root of steps, corresponding to an exponent of 0.5. Real market data typically deviates due to non-normal increments and regime effects.
The estimated factor can be used to rescale increments toward a more uniform distribution, improving stability of volatility-sensitive processing in automated trading systems. It also supports instrument classification by βrandom-walknessβ with a single computed value.
Interpretation is straightforward: values near 0.5 or below often align with lower volatility and range behavior, while values above 0.5 indicate higher volatility and heavier tails. In practice this tends to separate mean-reversion candidates fr...
π Read | AlgoBook | @mql5dev
#MQL5 #MT5 #Indicator
The estimated factor can be used to rescale increments toward a more uniform distribution, improving stability of volatility-sensitive processing in automated trading systems. It also supports instrument classification by βrandom-walknessβ with a single computed value.
Interpretation is straightforward: values near 0.5 or below often align with lower volatility and range behavior, while values above 0.5 indicate higher volatility and heavier tails. In practice this tends to separate mean-reversion candidates fr...
π Read | AlgoBook | @mql5dev
#MQL5 #MT5 #Indicator
β€20β5π4π€―1π1π1
An MQL5 library brings ARCH/GARCH-style volatility modeling into MetaTrader 5 with a clean, composable design: conditional mean, volatility process, and residual distribution are separate components but estimated jointly through the mean-model interface.
Model setup is driven by a single ArchParameters struct that captures the time series, optional exogenous inputs, AR/HAR lag configuration (including non-overlapping HAR windows), volatility family selection, distribution choice (Normal, t, skew-t, GED), scaling checks, and GARCH p/o/q plus power.
Fitting minimizes log-likelihood using ALGLIBβs constrained optimizer, returning an ArchModelResult with parameters, covariance, residuals, in-sample conditional volatility, and diagnostics (t-stats, p-values, adjusted RΒ², standard errors).
Forecasting supports analytic, Monte Carlo simulation, and bootstra...
π Read | Quotes | @mql5dev
#MQL5 #MT5 #AlgoTrading
Model setup is driven by a single ArchParameters struct that captures the time series, optional exogenous inputs, AR/HAR lag configuration (including non-overlapping HAR windows), volatility family selection, distribution choice (Normal, t, skew-t, GED), scaling checks, and GARCH p/o/q plus power.
Fitting minimizes log-likelihood using ALGLIBβs constrained optimizer, returning an ArchModelResult with parameters, covariance, residuals, in-sample conditional volatility, and diagnostics (t-stats, p-values, adjusted RΒ², standard errors).
Forecasting supports analytic, Monte Carlo simulation, and bootstra...
π Read | Quotes | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€34π4
Larry Williamsβ short-term swing points are turned from a chart concept into a testable MT5 system by encoding a strict three-bar pivot rule and structural filters. A swing low/high is confirmed only after bar close, using bars 1β3, with the middle bar as the candidate extreme.
Signal quality is improved by excluding pivots formed by outside bars (engulfing volatility) and setups involving inside bars (contraction/indecision). This keeps the EA focused on clearer exhaustion points.
The MQL5 Expert Advisor is designed for research: configurable trade direction, fixed or percent-risk sizing, exits by next-bar close or risk-reward take profit, and stop loss anchored to the swing bar extreme. Logic runs once per new bar, with modular functions for detection, validation, risk, and execution.
π Read | CodeBase | @mql5dev
#MQL5 #MT5 #EA
Signal quality is improved by excluding pivots formed by outside bars (engulfing volatility) and setups involving inside bars (contraction/indecision). This keeps the EA focused on clearer exhaustion points.
The MQL5 Expert Advisor is designed for research: configurable trade direction, fixed or percent-risk sizing, exits by next-bar close or risk-reward take profit, and stop loss anchored to the swing bar extreme. Logic runs once per new bar, with modular functions for detection, validation, risk, and execution.
π Read | CodeBase | @mql5dev
#MQL5 #MT5 #EA
β€34β4π2
Neuroboids Optimization Algorithm (NOA) reframes population-based optimization as many tiny neural agents. Each βneuroboidβ is a minimal two-layer network trained with Adam, using the current best candidate as a moving target rather than hard-coded swarm rules.
The loop is straightforward: random initialization, per-agent forward pass to propose a step, error vs. the best solution, backprop updates, then position updates with scaling to [-1, 1] and bounded resampling. A small elite-copy probability adds controlled exploitation while preserving diversity.
In benchmark tests (Hilly, Forest, Megacity), NOA reached about 45% of the maximum aggregated score for small to moderate dimensions, but becomes too slow at very high dimensionality (e.g., 1000 variables). Visual runs show fan-like movement patterns that reflect learned search directions across age...
π Read | CodeBase | @mql5dev
#MQL5 #MT5 #algorithm
The loop is straightforward: random initialization, per-agent forward pass to propose a step, error vs. the best solution, backprop updates, then position updates with scaling to [-1, 1] and bounded resampling. A small elite-copy probability adds controlled exploitation while preserving diversity.
In benchmark tests (Hilly, Forest, Megacity), NOA reached about 45% of the maximum aggregated score for small to moderate dimensions, but becomes too slow at very high dimensionality (e.g., 1000 variables). Visual runs show fan-like movement patterns that reflect learned search directions across age...
π Read | CodeBase | @mql5dev
#MQL5 #MT5 #algorithm
β€25π6π2π₯1