MQL5 Algo Trading
400K subscribers
2.63K photos
2.63K 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
The development of an Inverse Fair Value Gap (IFVG) detection strategy continues in MetaQuotes Language 5 (MQL5). Following detection of Fair Value Gaps (FVGs), IFVGs are introduced to identify states where a mitigated gap inverts direction due to price action. Settings like colors for state visualization, trading modes, and handling overlapping FVGs are configurable.

The implementation involves setting up input parameters, declaring global variables, and utilizing existing MQL5 libraries for managing trades. Specific functions are defined for creating and updating visualization elements such as rectangles and labels to display FVG zones and states. Historical data is analyzed during initialization to process past FVGs, updating their states to guide decision-making.

The system extends its capability by scanning and updating setups with the appearance of new bar...

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #EA
❀21✍4⚑3πŸ‘Œ2
A script has been developed to calculate autocorrelation and partial autocorrelation functions, displaying results graphically. Key input parameters include:

1. N: Data window for calculation, where a default value of 100 is set. Capable of handling large datasets, it efficiently processes over 100,000 bars.

2. K: Number of lags for analysis, defaulted at 16. Typically, analysis remains effective with lags under 40, though the script supports up to 500.

3. start_pos: Defines data window offset, with zero indicating calculations start from the latest loaded bar.

4. duration: Chart display period, set for 10 seconds.

These settings facilitate comprehensive time series analysis, enabling efficient examination of large datasets for technical insights. Adjust parameters according to specific analysis needs.

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #script
❀21πŸ‘Œ2
A library for keyboard operation is essential for managing keyboard layouts and key processing. It includes comprehensive data on various keyboard layouts, allowing for the configuration and recognition of different key arrangements. This library aids in determining the status of keys, whether they are pressed, released, or held down, and provides efficient processing for these events to trigger corresponding actions in applications.

An example usage scenario includes handling key inputs in a software program, where the library detects the keyboard layout in use, interprets user input correctly, and reflects real-time key status changes. By integrating such a library, developers can ensure their applications respond accurately to various keyboard inputs across different systems and configurations. This enhances user interaction and input reliability in d...

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Keyboard
❀15πŸ‘Œ2
Explore a new approach in trading with the integration of RSI for smart stop-loss mechanisms. The research compares two strategies: a traditional fixed stop-loss against an innovative RSI-based stop-loss system. The findings reveal that while RSI lowers the risk of being hunted, traditional methods demonstrate higher profitability and consistency in practice. Notably, the RSI strategy showcases reduced risk and psychological benefits for traders, offering an alternative for those seeking a more methodical approach. For developers and traders, this insight highlights the importance of risk management and presents RSI as a potential tool to minimize stop-loss hunts, albeit with some trade-offs in profitability.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Strategy
❀19✍2πŸ‘Œ2
Deploying machine learning-driven trading applications poses numerous challenges, primarily due to hard-to-detect errors not addressed in standard literature. A major issue is model assumptions violation, which often leads to silent failures in trading algorithms. All statistical models require assumptions about data relationships, and flexible models with minimal assumptions are often preferred. However, a model without any assumptions is unfeasible.

Models depend on the assumption that the target is a function of given observations. Violating this foundational assumption can lead to unnoticed failures. Existing statistical tests to verify assumptions are problematic and may yield misleading results, exposing practitioners to substantial risks.

A proposed solution involves generating new candidate targets from input observations. This self-supervised le...

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #ML
❀24πŸ‘€5πŸ‘Œ2
An advanced MetaTrader 5 Expert Advisor (EA) seamlessly combines Smart Money Concepts (SMC) like Order Blocks, Fair Value Gaps, and Break of Structure with real-time market sentiment analysis. The EA dynamically adapts to market conditions, selecting optimal strategies for bullish, bearish, or neutral phases. It operates across multi-timeframes to analyze trends and volatility, ensuring a cohesive trading approach. By focusing on sentiment and structural price insights, the system intelligently executes trades aligned with market directions, enhancing efficiency and precision. This framework offers a sophisticated tool for traders and developers aiming to implement adaptive algorithmic trading strategies.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #EA
❀33πŸ‘Œ2
Analyzing indicator combinations for the VGT ETF was the previous focus, but here the goal shifts towards selecting complementary indicators methodically. The process of selecting technical indicators is prone to subjectivity and could lead to biases like survivorship and hindsight-confirmation. Rigorous methods are crucial, particularly for ETFs like FXI, which exhibits dynamic behavior influenced by external events. Volatility, momentum shifts, and liquidity changes mandate a robust analytical approach.

A Python-based plan integrates segmentation of FXI’s data into quarterly β€˜discrete-windows’ to assess indicator performance across market regimes. Data preparation is critical to ensure integrity with operations to validate, re-synchronize, and label data properly. A well-organized dataset facilitates reliable indicator scoring with minimal errors.
...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #Dataset
❀54⚑7πŸ‘Œ5🀯4
The primary function of this indicator is to assess the possibility of price maximums and minimums. It begins by gathering historical price data for analysis. By evaluating the current market conditions and comparing them to historical statistics, the indicator generates signals. These signals can serve as an auxiliary filter to predict potential market reversals.

Key parameters include iPeriod, denoting the period length with a minimum of 2, and History, indicating the number of bars analyzed for statistical collection. A History value of 0 implies a comprehensive analysis of all data. Be aware that larger history values may slow down initialization. The Percent parameter sets the signal threshold; a higher value results in less frequent alerts. Initial calculations may require additional time due to the extensive statistical gathering process.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #Indicator
❀31πŸ‘€4
Automating trading processes is instrumental in addressing prop firm challenges. These firms impose strict rules that differ from personal trading, requiring adherence to drawdown and risk limits. Traders often excel in strategy but struggle with emotional discipline and manual risk monitoring.

The designed Expert Advisor (EA) offers a solution by automating trade execution with built-in risk management. It evaluates trade setups based on strict criteria, preventing rule breaches with a 2% risk cap per trade. Utilizing ATR for stop-loss levels, it avoids risks during volatile news periods.

The EA's robust logic handles gold's volatility specifically. It dynamically adjusts position sizing and employs precise trade management. This includes trailing stops and profit-taking mechanisms to optimize reward-to-risk ratios. Key features include drawdown protect...

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #EA
❀66✍5πŸ’―4πŸ‘€4πŸ‘Œ3
Currently drafting a series of articles on developing a multicurrency Expert Advisor (EA) with multiple trading strategies. Code from these articles will be available in a library, and it's advised to review it sequentially to understand progressive improvements.

Part 1 focuses on integrating multiple strategies within a single EA, enhancing risk diversification and trading stability without managing them separately. Part 2 progresses by shifting market position handling to the EA level, enabling strategies to function virtually. Part 3 involves revisiting and optimizing the architecture based on initial development experiences.

Part 4 adds functionalities for handling pending orders and ensuring state persistence after system restarts. Part 5 introduces variable position sizing, moving beyond fixed sizes for live trading.

Part 6 aims to aut...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #ExpertAdvisor
❀20
Recent evaluations have highlighted performance and accuracy issues with the standard API functions ChartXYToTimePrice and ChartTimePriceToXY. ChartXYToTimePrice fails to function correctly when X and Y parameters fall outside the visible chart window, defaulting to zero values. Additionally, ChartTimePriceToXY experiences inaccuracies in certain scenarios. Both functions exhibit slow performance.

To address these issues, a revised script demonstrates improved accuracy across all parameter ranges. It utilizes a method where X and Y coordinates are translated to time and price and then reverted back. Accuracy is validated if input coordinates match the output. A discrepancy indicates functional errors, notating the issue during execution. The script concludes by reporting the final outcome, remaining silent if functionality is assured.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #script
❀25
Introducing a tool designed for technical traders focusing on delta metrics: Cumulative Delta, Net Delta, and their divergences. Key features include tracking aggregated buy and sell volumes through Cumulative Delta and analyzing the difference in buying and selling pressure via Net Delta for each bar. The tool also offers a session reset for tailored intraday analysis and includes EMA smoothing for more refined and legible delta curves.

Engineered to meet the needs of traders monitoring order flow dynamics and volume imbalances, these features allow detection of pivotal divergences. Such divergences include bullish and bearish indicators, where potential market reversals are highlighted. Additionally, hidden and exhaustion divergences provide insights into trend confirmations and possible corrections. This solution remains lightweight and fast, focusi...

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #OrderFlow
❀22πŸŽ‰4πŸ”₯2πŸ‘Œ1
The Liquidity Sweep on Break of Structure (BoS) system builds upon the inverse fair value gap concepts developed in previous articles, leveraging MetaQuotes Language 5 (MQL5) for enhanced functionality. The BoS strategy combines swing point identification with liquidity sweeps for detecting trend changes.

The system identifies swing highs and lows over a defined length, differentiating between higher highs (HH) and lower lows (LL) to set the BoS trend. A liquidity sweep is marked when prices wick beyond a swing but close inside on a directional candle, prompting potential reversals. The strategy executes trades on detected sweeps in accordance with the trend, with dynamic stop levels, trade limits, and pattern visualization.

Implementation in MQL5 involves creating a comprehensive program with dynamic inputs, ensuring readability, and implementing ...

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #Strategy
❀19😁7πŸ‘4✍2
In the latest installment of the MQL5 series, the focus shifts towards developing a more advanced project involving the Binance API and MetaTrader 5. Having previously covered the basics such as retrieving 5 daily BTCUSDT candle data, this segment will focus on extracting and processing data from the last 10 thirty-minute candles.

Initially, MQL5 scripts will leverage the OnTick event to efficiently request new data without exceeding API limits. Data from server responses will be parsed into structured arrays categorizing open, high, low, and close prices. Following extraction, string data undergoes conversion into appropriate datetime and double formats.

This structured approach ensures precision in data handling, facilitating the development of custom indicators capable of visualizing real-time market data efficiently.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #MQL5
❀26πŸŽ‰3πŸ‘€1
Elevate your algorithmic trading strategy with an innovative approach that integrates the Relative Strength Index (RSI) with market structure awareness to generate high-probability trade entries. Traditionally reliant on breakout and retest models, this method leverages early momentum confirmation for enhanced timing and reliability. By developing a structured system using MQL5, traders can automate the detection of trend channels and RSI divergence, transforming manual strategies into precise, executable algorithms. This programmatic solution offers sophisticated risk management, ensuring more effective entries and reducing reliance on manual signal interpretation. Discover a robust path from market theory to algorithmic practice.

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #Algorithm
❀18πŸ‘Œ1
In modern user interfaces, resizing elements with the mouse is essential. Implementing this feature requires a well-architected approach, typically using the MVC (Model-View-Controller) framework. In the MVC paradigm, the View component handles the visual and interactive aspects of resizing. It tracks mouse movements, determines cursor placement on element boundaries, and displays tooltips indicating resizing directions. The Controller processes events and updates the Model if necessary.

For TableView controls in applications, resizing enhances data adaptability, readability, and creates dynamic interfaces. Implementing resizing involves refining base classes and creating graphical tooltips. By enhancing the Base and Control classes, this functionality becomes integral to modern interface components. This structured approach ensures responsiveness and effective u...

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #UI
❀27πŸŽ‰3πŸ‘Œ1πŸ‘€1
The challenge of maintaining a consistent position for chart arrows has been noted. Typically, when an arrow is added, scrolling can result in its displacement, leading to visibility issues. This variability in position can hinder clear analysis, as the arrows might not correspond accurately to specific chart points. The provided code resolves this inconsistency by ensuring that arrows remain in a static, fixed position relative to the bars. This adjustment is crucial for clarity in data representation and analysis, facilitating more reliable decision-making. Consistent arrow placement can significantly enhance the usability of chart observations and historical data analysis.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL4 #MT4 #Indicator
❀20πŸ‘1πŸ‘Œ1
Explore the advanced features of MetaTrader 5 by leveraging its integrated chat capabilities. These powerful tools enhance trader communication and collaboration with private messages, group chats, and channels. Streamline interaction with brokers through dedicated support chats directly within the platform. Delve into team projects, exchange trading strategies, or broadcast updates with ease, all while ensuring efficient data usage and swift message delivery. Elevate your algo-trading experience by connecting effortlessly across MetaTrader's desktop and mobile apps. Ideal for both developers and traders, the chat system fosters a dynamic and responsive trading community, promoting proactive trading strategy development and customer engagement.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀31πŸ‘7