In the initial article, an Expert Advisor (EA) was developed with two trading strategy instances. This increased to nine instances in the second article and 32 in the third. Testing times remained manageable. A shorter single test pass is preferred, but overall optimization should still be completed within hours, not days. A single pass should finish in seconds or minutes for combined instances. Multiple strategy instances increase optimization time.
For the experiment, a new EA based on the existing OptGroupExpert.mq5 was created with necessary code changes and saved as BenchmarkInstancesExpert.mq5. Runs were conducted in different tick simulation modes, doubling instances from 8 to 16,384. Memory usage and simulation times were analyzed. Results indicated reasonable memory consumption and simulation times, with the highest number of instances...
#MQL5 #MT5 #ExpertAdvisor #Backtesting
Read more...
For the experiment, a new EA based on the existing OptGroupExpert.mq5 was created with necessary code changes and saved as BenchmarkInstancesExpert.mq5. Runs were conducted in different tick simulation modes, doubling instances from 8 to 16,384. Memory usage and simulation times were analyzed. Results indicated reasonable memory consumption and simulation times, with the highest number of instances...
#MQL5 #MT5 #ExpertAdvisor #Backtesting
Read more...
β€26π25π3π¨βπ»1
The High and Low Line Indicator plots the highest and lowest price levels of a selected symbol directly on the chart. This indicator aids traders in visual identification of key support and resistance levels, which is vital for informed trading decisions.
Use Cases:
Identifying Support and Resistance: The high and low lines serve as natural support and resistance levels, offering clear points for entry, exit, or stop-loss placement.
Breakout Trading: Monitor price movements above the high line or below the low line to identify potential breakout opportunities. This tool enhances the accuracy of trading strategies through simplified visual analysis.
#MQL5 #MT5 #trading #forex
Read more...
Use Cases:
Identifying Support and Resistance: The high and low lines serve as natural support and resistance levels, offering clear points for entry, exit, or stop-loss placement.
Breakout Trading: Monitor price movements above the high line or below the low line to identify potential breakout opportunities. This tool enhances the accuracy of trading strategies through simplified visual analysis.
#MQL5 #MT5 #trading #forex
Read more...
β€17π15π¨βπ»1
Introduction
In our previous article, we examined creating an expert advisor using Trend Constraint V1.09. Now, we aim to develop an independent expert advisor (EA) incorporating both trend analysis and risk-reward functionalities on MQL5.
Creating the Expert Advisor:
1. Launching the EA Template:
Open MetaEditor and select "Expert Advisor (Template)".
2. Customizing the Template:
Define necessary functions and variables, such as OnInit, OnDeinit, and OnTick, to create a structured EA.
3. Writing Trend Constraint Expert Logic:
Integrate logic for trend-based and RSI conditions for buying and selling, including trade management and trailing stops.
Tester Conclusion
Back-test your EA using historical data to ensure it adheres to developed trading strategies and improves profitability.
#MQL5 #MT5 #ExpertAdvisor #AlgoTrading
Read more...
In our previous article, we examined creating an expert advisor using Trend Constraint V1.09. Now, we aim to develop an independent expert advisor (EA) incorporating both trend analysis and risk-reward functionalities on MQL5.
Creating the Expert Advisor:
1. Launching the EA Template:
Open MetaEditor and select "Expert Advisor (Template)".
2. Customizing the Template:
Define necessary functions and variables, such as OnInit, OnDeinit, and OnTick, to create a structured EA.
3. Writing Trend Constraint Expert Logic:
Integrate logic for trend-based and RSI conditions for buying and selling, including trade management and trailing stops.
Tester Conclusion
Back-test your EA using historical data to ensure it adheres to developed trading strategies and improves profitability.
#MQL5 #MT5 #ExpertAdvisor #AlgoTrading
Read more...
π25β€10β‘4π€―2πΎ2π1π¨βπ»1
Review of "Conformer: Embedding Continuous Attention in Vision Transformer for Weather Forecasting"
Study on the potential of utilizing meteorological forecasting algorithms to predict financial market behavior, focusing on the Conformer algorithm. It combines Continuous Attention with Neural ODE, allowing the model to process weather variables over time. The architecture utilizes multi-head attention encoded as a differentiable function to model complex weather dynamics.
Technical implementation using MQL5 involves creating the CNeuronConformer class derived from CNeuronBaseOCL. The structure includes convolutional layers for Query, Key, and Value entities, differentiation over time, and initialization of feedforward and differential equation blocks.
Detailed implementation involves defining partial derivatives within the Continuous Attention mechanism, en...
#MQL5 #MT5 #Finance #AI
Read more...
Study on the potential of utilizing meteorological forecasting algorithms to predict financial market behavior, focusing on the Conformer algorithm. It combines Continuous Attention with Neural ODE, allowing the model to process weather variables over time. The architecture utilizes multi-head attention encoded as a differentiable function to model complex weather dynamics.
Technical implementation using MQL5 involves creating the CNeuronConformer class derived from CNeuronBaseOCL. The structure includes convolutional layers for Query, Key, and Value entities, differentiation over time, and initialization of feedforward and differential equation blocks.
Detailed implementation involves defining partial derivatives within the Continuous Attention mechanism, en...
#MQL5 #MT5 #Finance #AI
Read more...
β€8π7π4π¨βπ»4β‘1
Telegram
MQL5 Algo Trading
Boost this channel to help it unlock additional features.
π12β€6π¨βπ»3
Discover the potential of Brain Storm Optimization (BSO) for algorithmic trading! This advanced method leverages group idea generation and clustering algorithms like K-Means to identify efficient paths in the data landscape. Our article breaks down the practical implementation of BSO, detailing how agent behavior is modeled, ideas are mutated, and new solutions are generated for optimization. Through rigorous testing on various functions, BSO demonstrates its prowess, particularly in multimodal problem-solving. While parameter tuning is crucial, initial results show promising efficiency. Dive into the intricacies of BSO and enhance your trading strategies with this innovative optimization technique.
#MQL5 #MT5 #optimization #algorithm
Read more...
#MQL5 #MT5 #optimization #algorithm
Read more...
π27β€22π5π3π¨βπ»3π€£1
The 3 Line Strike pattern from TradingView has been converted to MQL4. This pattern consists of three consecutive candles moving in one direction followed by an engulfing candle moving in the opposite direction, indicating a potential reversal. Specifically, a bearish 3 Line Strike comprises three bullish candles followed by one bearish engulfing candle, whereas a bullish 3 Line Strike consists of three bearish candles followed by one bullish engulfing candle. Note: This version does not include alerts. For usage guidance, refer to instructional videos on YouTube.
#MQL4 #MT4 #forex #trading
Read more...
#MQL4 #MT4 #forex #trading
Read more...
π35β€16β‘5π₯5π¨βπ»4
Learn how to design a trading system with MQL5 using popular technical indicators. This series covers the Gator Oscillator, its application, and how to create a trading system on MetaTrader 5.
Gator Oscillator Definition:
Created by Bill Williams, the Gator Oscillator helps identify market trends and trading opportunities by measuring the convergence and divergence of balance lines derived from the Alligator indicator.
Gator Oscillator Trading Strategies:
1. Gator Status Strategy: Identifies market phases based on bar colors.
2. Gator Signals: Provides signals for entry, holding, and exit positions.
3. Gator with MA: Combines Gator indicator with Moving Average signals for buy/sell positions.
Blueprints and MQL5 code implementation for these strategies can efficiently enhance trading systems. Before using any strategy, ensure thorough testing on demo ac...
#MQL5 #MT5 #Trading #Forex
Read more...
Gator Oscillator Definition:
Created by Bill Williams, the Gator Oscillator helps identify market trends and trading opportunities by measuring the convergence and divergence of balance lines derived from the Alligator indicator.
Gator Oscillator Trading Strategies:
1. Gator Status Strategy: Identifies market phases based on bar colors.
2. Gator Signals: Provides signals for entry, holding, and exit positions.
3. Gator with MA: Combines Gator indicator with Moving Average signals for buy/sell positions.
Blueprints and MQL5 code implementation for these strategies can efficiently enhance trading systems. Before using any strategy, ensure thorough testing on demo ac...
#MQL5 #MT5 #Trading #Forex
Read more...
π50β€23π3π¨βπ»3π1π€©1
The Predictive Moving Average, developed by John Ehlers and featured in "Rocket Science For Traders" (page 212), is an early leading indicator. It provides actionable insights for buy and sell decisions based on color-coded signals. When the indicator line turns green, it signals a buying opportunity. Conversely, a red line indicates a selling point. This method aims to offer precise market timing by anticipating future price movements. Integrating this indicator into trading strategies can enhance decision-making processes and optimize trade execution by leveraging its predictive capabilities.
#MQL5 #MT5 #Trading #Indicators
Read more...
#MQL5 #MT5 #Trading #Indicators
Read more...
π30β€20β9β‘5π4π¨βπ»3
Q-learning was initially introduced in an article about Deep Q-Learning (DQN), which approximates the Q-functionβa dependency of rewards on system states and actions. The real world, however, presents multifaceted challenges that affect the accuracy of these estimations due to outliers and incomplete parameter consideration. In 2017, new algorithms were proposed to study reward value distributions, improving Q-learning application in Atari games.
Distributed Q-learning offers a significant enhancement by approximating the reward value distribution instead of a single value. This method involves splitting possible rewards into quantiles, leveraging parameters like Vmin, Vmax, and the number of quantiles. Unlike classic Q-learning, it transforms the problem into a standard classification problem, using LogLoss instead of standard deviati...
#MQL5 #MT5 #DeepLearning #ReinforcementLearning
Read more...
Distributed Q-learning offers a significant enhancement by approximating the reward value distribution instead of a single value. This method involves splitting possible rewards into quantiles, leveraging parameters like Vmin, Vmax, and the number of quantiles. Unlike classic Q-learning, it transforms the problem into a standard classification problem, using LogLoss instead of standard deviati...
#MQL5 #MT5 #DeepLearning #ReinforcementLearning
Read more...
π46β€19π7π7π¨βπ»6π1
Switching Templates Efficiently in MT4
To switch sequentially between multiple templates, modify the mq4 file in Metaeditor. Change the template names to your preference, separated by commas. Example: extern string Templates = "1.tpl, 2.tpl, 3.tpl";
Set ApplyAllCharts to true to apply the template to all charts, or false to apply it to the current chart only. Ensure template files are in your Data Folder/templates folder. At least two templates are required for switching.
Set a hotkey by right-clicking the script in your navigator and choosing desired keys. This enables quick switching.
The script uses Global Variables to track which template corresponds to each Chart ID. To reset, delete all variables starting with "AbiroidTemplate" from Global Variables.
Error Codes:
- Error Code 0: No error, but issue with MT4. Refresh Scripts in navigator or re...
#MQL4 #MT4 #templates #trading
Read more...
To switch sequentially between multiple templates, modify the mq4 file in Metaeditor. Change the template names to your preference, separated by commas. Example: extern string Templates = "1.tpl, 2.tpl, 3.tpl";
Set ApplyAllCharts to true to apply the template to all charts, or false to apply it to the current chart only. Ensure template files are in your Data Folder/templates folder. At least two templates are required for switching.
Set a hotkey by right-clicking the script in your navigator and choosing desired keys. This enables quick switching.
The script uses Global Variables to track which template corresponds to each Chart ID. To reset, delete all variables starting with "AbiroidTemplate" from Global Variables.
Error Codes:
- Error Code 0: No error, but issue with MT4. Refresh Scripts in navigator or re...
#MQL4 #MT4 #templates #trading
Read more...
π34β€24π¨βπ»2π₯1π1
In our previous article, we covered the process of sending chart snapshots with captions from MetaTrader 5 to Telegram. The method we used, though effective, was straightforward and somewhat inflexible, leading to repetitive and unmanageable code. To enhance this, transitioning to a more modular codebase is advisable.
In this fourth part, the focus will be on improving reusability through code modularization. Detailed discussions will be held on the principles of code modularization and their application to our project. We'll reorganize our existing MQL5 script into separate, well-defined functions.
By the end, you'll have the option of using either the old monolithic program or a new modular Expert Advisor (EA) providing the same output. We'll break the code into discrete functions for tasks like sending messages, taking screenshots, and en...
#MQL5 #MT5 #Telegram #CodeModularization
Read more...
In this fourth part, the focus will be on improving reusability through code modularization. Detailed discussions will be held on the principles of code modularization and their application to our project. We'll reorganize our existing MQL5 script into separate, well-defined functions.
By the end, you'll have the option of using either the old monolithic program or a new modular Expert Advisor (EA) providing the same output. We'll break the code into discrete functions for tasks like sending messages, taking screenshots, and en...
#MQL5 #MT5 #Telegram #CodeModularization
Read more...
β€41π32π¨βπ»10π6β‘2
For those utilizing the Ichimoku indicator and seeking Tenkan and Kijun cross signals, consider this Expert Advisor (EA). After download, compile it in Meta Editor. Then, on MT4, drag and drop it onto your chart. Adjust the timeframe to match your trading style and enable notifications. In the EA's dialog box, two parameters determine operational hours, set in a 24-hour format ranging from 0-24. Specify these according to your trading schedule. Ensure your Meta Quotes ID is updated in the notification settings of your MT4. Maintain effective trading practices.
#MQL4 #MT4 #Ichimoku #ForexEA
Read more...
#MQL4 #MT4 #Ichimoku #ForexEA
Read more...
β€33π18π4π¨βπ»3β1π1
In our latest article, we explore the Conformer method for weather forecasting, adapted for improving trading models using MetaTrader 5. Through timeseries data input, the Encoder model optimizes the Actor's policy. To enhance this process, we introduce Reversible Instance Normalization (RevIN), a simple yet effective normalization technique that addresses distribution shifts by normalizing input sequences and denormalizing output sequences. This technique enhances model accuracy by aligning mean and variance, thus improving timeseries forecasting. We also delve into practical implementation in MQL5, using neural layers for normalization and denormalization, enhancing the robustness and adaptability of trading algorithms.
#MQL5 #MT5 #forecasting #RevIN
Read more...
#MQL5 #MT5 #forecasting #RevIN
Read more...
π52β€35π₯8π8π3π¨βπ»3π2
Reviewing the code example for generating a histogram of momentum offset reveals several key components. The primary function captures the momentum calculation and its corresponding histogram generation. The `hist()` function from a data visualization library is utilized to plot the momentum data.
Steps involved:
1. Momentum data is derived from a price series.
2. The offset value is computed to adjust the histogram.
3. The histogram plot is generated to visualize the momentum distribution.
To enhance clarity and maintainability, consider adding comments to the code. This will provide additional context for each step, improving the overall readability and usability for other developers.
#MQL4 #MT4 #trading #forex
Read more...
Steps involved:
1. Momentum data is derived from a price series.
2. The offset value is computed to adjust the histogram.
3. The histogram plot is generated to visualize the momentum distribution.
To enhance clarity and maintainability, consider adding comments to the code. This will provide additional context for each step, improving the overall readability and usability for other developers.
#MQL4 #MT4 #trading #forex
Read more...
π31β€19π¨βπ»5π3β‘2π₯2
Discover the transformative impact of deep learning on timeseries forecasting with the introduction of the Client method. By blending the trend-capturing prowess of linear models with the intricate pattern recognition of enhanced Transformer architectures, Client offers a robust solution to multivariate long-term forecasting challenges. Key to this innovation is the strategic use of Reversible Normalization and transposed data processing to harness inter-variable dependencies. Practical applications in MQL5 highlight the methodβs efficiency, providing a comprehensive guide to implementing a custom neural layer. Elevate your trading strategies with this sophisticated approach to predictive modeling.
#MQL5 #MT5 #forecasting #deeplearning
Read more...
#MQL5 #MT5 #forecasting #deeplearning
Read more...
π21β€10β‘7π¨βπ»4
Examining the integration of Q-Learning and Markov Chains to refine the learning process of a multi-layer perceptron (MLP) network reveals potential improvements in models for Expert Advisors. Q-Learning, a reinforcement learning algorithm, quantifies actions as rewards during training rounds, referred to as episodes.
Reinforcement learning, often categorized alongside supervised and unsupervised learning, balances exploration and exploitation, updating a Q-Learning map to track suitable actions in different states. This map utilizes a learning rate, reward, and discount factor.
Markov Chains, supplementing Q-Learning, transition between states based on probabilities. Transition matrices calculate state importance, memorylessly transitioning from current states. This approach aids in training the Q-Learning map and updating actions efficiently....
#MQL5 #MT5 #machinelearning #trading
Read more...
Reinforcement learning, often categorized alongside supervised and unsupervised learning, balances exploration and exploitation, updating a Q-Learning map to track suitable actions in different states. This map utilizes a learning rate, reward, and discount factor.
Markov Chains, supplementing Q-Learning, transition between states based on probabilities. Transition matrices calculate state importance, memorylessly transitioning from current states. This approach aids in training the Q-Learning map and updating actions efficiently....
#MQL5 #MT5 #machinelearning #trading
Read more...
β€44π34π¨βπ»4β3π3
Since 2019, this personal library has been developed to facilitate position manipulation and retrieve various information. Key functions include:
- `SymbolOpenPipsMagic`: Returns open pips from all positions by magic number.
- `SymbolOpenPercentageMagic`: Returns percentage from open positions by magic number.
- `SymbolOpenPoints`: Returns open points/pipets trades.
- `SymbolOpenPositionsClose`: Closes all open positions.
- `SymbolOpenPositionsSpecific`: Returns the number of specific open trades by comment.
- `SymbolPositionResultMoney`: Returns the result from a position at a specified price target in money.
Other utilities handle pending orders, calculated margins, risk/reward ratios, and normalize volumes. Chart manipulation and candle data extraction are also streamlined. Additional functions support account status checks, managing historical data, a...
#MQL5 #MT5 #forex #trading
Read more...
- `SymbolOpenPipsMagic`: Returns open pips from all positions by magic number.
- `SymbolOpenPercentageMagic`: Returns percentage from open positions by magic number.
- `SymbolOpenPoints`: Returns open points/pipets trades.
- `SymbolOpenPositionsClose`: Closes all open positions.
- `SymbolOpenPositionsSpecific`: Returns the number of specific open trades by comment.
- `SymbolPositionResultMoney`: Returns the result from a position at a specified price target in money.
Other utilities handle pending orders, calculated margins, risk/reward ratios, and normalize volumes. Chart manipulation and candle data extraction are also streamlined. Additional functions support account status checks, managing historical data, a...
#MQL5 #MT5 #forex #trading
Read more...
β€26π23π¨βπ»2β‘1π1π€1π€¨1
Explore the potential of AI in trading with this comprehensive guide on algorithmic strategies for MetaTrader 5. Discover how to uncover key relationships between currency and precious metals markets, leveraging xauusd, xpdusd, and usdcad pair data. Learn how to fetch and preprocess this data using MQL5 and Python, ensuring clean datasets for accurate modeling.
Dive into various forecasting models, including Linear Regression and Linear Support Vector Regressor (LSVR), and understand their performance using 5-fold cross-validation. Finally, export your finely-tuned model to ONNX format and integrate it with your MetaTrader 5 Expert Advisor for smarter trading decisions.
#MQL5 #MT5 #trading #AI
Read more...
Dive into various forecasting models, including Linear Regression and Linear Support Vector Regressor (LSVR), and understand their performance using 5-fold cross-validation. Finally, export your finely-tuned model to ONNX format and integrate it with your MetaTrader 5 Expert Advisor for smarter trading decisions.
#MQL5 #MT5 #trading #AI
Read more...
π21β€12β7π2π¨βπ»2πΎ2π1
The U-shaped Transformer algorithm enhances the vanilla Transformer architecture for time series forecasting by retaining high frequency context. The innovative approach involves a two-stage training process: pre-training with diverse datasets to learn dependencies and reduce noise, followed by fine-tuning on specific problems. This method ensures efficiency, requiring less computational power for fine-tuning. Key features include patch-based embedding for extracting multi-scale features, convolutional layers, and skip-connections for fast data transfer, enhancing model robustness and generalization. Implementing these techniques in MQL5 involves advanced neural network layer handling and dynamic positional encoding, providing traders and developers a powerful tool for improved time series analysis.
#MQL5 #MT5 #Timeseries #AI
Read more...
#MQL5 #MT5 #Timeseries #AI
Read more...
π25β€7β‘4π2π¨βπ»2π1