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
In part 2 of our series, the focus shifts to developing an AI-integrated program using MQL5, building on our existing JSON parsing framework. The program facilitates interaction with OpenAI's API directly on the MetaTrader 5 chart, offering AI-driven trading insights.

We cover setting up OpenAI API access, configuring MetaTrader 5 for HTTP requests, and the implementation of the ChatGPT program in MQL5. This includes creating a user interface with input fields and buttons for querying the AI, and displaying formatted responses on the chart.

Key steps involve obtaining an API key, performing curl tests to ensure API connectivity, and configuring MT5 settings for seamless communication with OpenAI. This comprehensive approach ensures robust AI interaction within a trading environment.

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #ChatGPT
❀38πŸ‘¨β€πŸ’»1
The development of a custom market sentiment indicator combining multiple timeframes enhances trading efficiency. By automating this indicator, traders benefit from consistent sentiment monitoring without emotional bias, promoting faster market reaction. The framework uses various technical elements like moving averages and price action analysis to classify sentiment into five categories: bullish, bearish, risk-on, risk-off, and neutral.

The execution logic warrants systematic trading decisions. Buy orders align with bullish or risk-on sentiment due to expected upward price momentum, while sell orders correlate with bearish or risk-off sentiment predicting downward trends. Neutral sentiment prompts trade avoidance to reduce high-risk entries in uncertain conditions.

Integration of MetaTrader 5's CTrade class facilitates automated trade execution. ...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #Indicator
❀34⚑4πŸ‘¨β€πŸ’»3
Explore the geometric interpretation of machine learning models and their impact on trading strategies. Unlike traditional methods, which merely map inputs to outputs, these models embed target images onto a space defined by inputs, causing potential misalignment and irreducible errors. This nuance affects prediction accuracy, emphasizing the need for multi-step forecasts over direct comparisons. A practical case shows a 153% increase in profitability by leveraging such predictions. Key techniques include the use of ONNX models for cross-platform deployment and the refinement of strategies through analysis of model predictions, aligning coordinate systems for improved trading outcomes without altering the base model.

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #ML
❀34πŸ‘4πŸŽ‰2πŸ‘¨β€πŸ’»1
In our latest technical assessment, we explored integrating third-party libraries with MQL5 Algo Forge, focusing on the SmartATR library. Initially, manual cloning via Git worked to integrate the library, revealing MetaEditor's current limitations when handling external repositories. We found console commands a requirement for external code integration, as MetaEditor didn't fully support repository cloning without pre-existing correct permissions or context operations.

We explored an alternate approach: forking external repositories via the MQL5 Algo Forge web interface. Forking provides an independent copy where developers can make modifications, which is then visible in MetaEditor for streamlined repository management. This supports the open-source model, allowing for potential code contributions and efficient project backups.

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀67πŸ‘5πŸ‘5πŸ‘Œ2✍1🀯1πŸ‘¨β€πŸ’»1
A new trend analysis method is discussed, focusing on quantile-based calculations. The approach involves comparing the current close price with the upper and lower quantiles of the last 30 periods, defined as 60 and 40 defaults, respectively. An uptrend is identified if both values exceed zero, a downtrend if both are below zero, and a ranging market if one is positive and the other negative.

Additionally, a high-low mode is available, comparing the current high and low prices against these quantiles. This variation provides more nuanced insights into market movements, particularly for filtering ranging bars. However, it may introduce more lag.

In visualization, a Green Block indicates an uptrend, an Orange Block denotes a downtrend, and a Gray Block signifies a ranging market.

πŸ‘‰ Read | Docs | @mql5dev

#MQL4 #MT4 #Indicator
❀41πŸ‘¨β€πŸ’»4🀯3✍1
Explore the power of the MQL5 Standard Library to craft efficient, robust trading systems. By integrating classes like CTrade for trade execution, CiATR for volatility assessment, and CiMA for trend detection, developers can streamline their coding process and focus more on strategy than on tedious implementation details. This approach not only reduces errors but enhances consistency and clarity in developing Expert Advisors. Testing reveals that while shorter timeframes demand extra filtering to tackle noise, trading on higher timeframes like H4 aligns better with trend-following strategies, delivering clearer signals and more reliable outcomes. Unlock a new level of proficiency by embracing systematic workflows with MQL5.

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #OOP
❀32πŸ‘¨β€πŸ’»5πŸ‘3⚑2
Developing advanced trading systems involves understanding classical patterns and programming skills. A recent implementation in MQL5 focuses on the Shark Pattern system, a harmonic pattern based on pivot points and Fibonacci retracements/extensions. The system automates trade execution upon detecting a valid pattern, offering flexible entry, stop-loss, and take-profit options. The use of chart objects enhances pattern visualization, aiding in clarity and decision-making.

For implementation, key steps involve defining structures for swing pivots, employing logic to detect pattern criteria, and visual aesthetics for chart depiction. Testing through historical data ensures efficacy and reliability, while careful risk management remains essential.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀60πŸ‘¨β€πŸ’»5⚑4πŸ€”4πŸ‘Œ3πŸ†2πŸ‘€1
In MetaTrader 5 build 5320, we've added a separate CodeBase category for Services. Now you can easily share such MQL5 applications, as well as download them directly from the platform with automatic installation to the appropriate folder.

We've also improved operations with input variables in MQL5. Now, using a separate parameter, you can specify a variable name to be displayed in the program properties in the platform. Previously, the name was specified through comments, which was a less obvious method.

In addition, we have made several improvements to the MQL5 compiler and debugger, and added translations of the Web Terminal into Romanian and Hebrew.

Important:
Build 5320 is the last update to support Windows 7, Windows 8, Windows 8.1, and Windows Server 2008. Starting with the next version, desktop platforms running on these operating systems will no longer receive updates. The only exception is platforms running under Wine.


Read more...
❀116πŸ‘13πŸ”₯13πŸ‘Œ6πŸ†5πŸ‘€4πŸ‘¨β€πŸ’»3
Combining stochastics with varying periods can aid novice traders in gaining a more comprehensive view of market trends. By using stochastics with different time frames, traders can effectively monitor both short-term and long-term momentum. This approach helps in identifying potential overbought or oversold conditions across different periods, providing clearer signals for trading decisions. Properly analyzing these overlayed indicators requires understanding their distinct implications and recognizing how each period reflects different market conditions. This method can offer valuable insights into price movement patterns, assisting traders in executing more informed trading strategies and reducing uncertainty in decision-making.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #Indicator
❀49πŸ‘¨β€πŸ’»3πŸ†2⚑1
Explore the significant benefits of the Detrended Price Oscillator (DPO) for algorithmic trading in MetaTrader 5. This article delves into coding a custom DPO indicator, its integration into trading systems, and how it isolates short-term price cycles by filtering long-term trends. Discover effective DPO strategies like Zero Crossover and Trend Validation, offering clear protocols for automating trades. Enhance your trading insights with optimized systems and backtesting results. Whether you're a seasoned trader or a developer, the practical applications discussed provide valuable knowledge for improving trading performance with robust, actionable data-driven techniques.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
❀35πŸŽ‰4πŸ†3⚑2πŸ‘¨β€πŸ’»1
In the realm of algorithmic trading, Reinforcement Learning (RL) exhibits significant promise with TD3 (Twin Delayed Deep Deterministic Policy Gradient) emerging as a key player. TD3 excels by addressing the limitations of its predecessor, DDPG, through enhanced stability and efficiency, making it ideal for trading, where market dynamics are continuous and volatile. It leverages dual critics to reduce overestimation bias, incorporates target policy smoothing to manage market noise, and introduces delayed policy updates to stabilize learning. The RL cycleβ€”comprising environment interaction, action selection, and reward optimizationβ€”is integrated with Python for training and exported via ONNX for seamless execution in MQL5, thus bridging advanced training with practical trading execution.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #ReinforcementLearning
❀38πŸ‘Œ7πŸ†6πŸ‘¨β€πŸ’»3⚑2
Elevate your trading strategy by incorporating a robust statistical arbitrage framework for MetaTrader 5. This method focuses on creating a mean-reversion strategy with cointegrated Nasdaq stocks alongside Nvidia (NVDA), prioritizing market neutrality. A comprehensive scoring system evaluates stock pairs through criteria like Engle-Granger and Johansen cointegration tests, spread stationarity, and liquidity. This framework efficiently screens thousands of stock combinations, maintaining a focus on stability and tradeability. Detailed correlation and cointegration analyses ensure a well-informed selection process, paving the way for a robust, data-driven, and economically meaningful portfolio development. Such a strategy optimizes resource allocation and enhances trading edges through meticulous screening and backtesting.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Strategy
❀73πŸ‘¨β€πŸ’»9πŸ†6πŸ‘Œ4✍1
The Adaptive Relative Strength Index (aRSI) calculation involves a few key steps. Start by subtracting 50 from the traditional RSI value, then apply the absolute value function. This outcome is then divided by either 100 or 50, based on settings, to produce the aRSI value, which is expressed in a percentage-like format.

When adjusting bands, the lower band is computed as the current lower band value minus the product of the lower band value and aRSI. Conversely, the upper band is computed as the current upper band plus the product of the upper band value and aRSI.

An optional feature is available to toggle the display of the standard SuperTrend indicator. The overall settings include adjustable parameters for Factor, applicable to both SuperTrend styles, ATR length, and RSI length specifically for the aRSI SuperTrend.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #RSI
❀36⚑5πŸ‘2πŸ‘¨β€πŸ’»2
This project's recent advancement expands on our Shark Pattern system by incorporating a Trendline Breakout System in MQL5. It accurately identifies and trades on the breakouts of support and resistance levels. Utilization of swing points validated by R-squared and angle constraints ensures reliability in detecting market momentum shifts.

The system automates trendline detection, drawing, and breakout signals through comprehensive logic that includes handling the lifecycle of trendlines and managing trading signals in real-time. Our approach emphasizes capturing significant market trends while managing risks effectively.

With integrations for visualization and trade execution, this critical system supports automated response to market changes, with customizable settings for diverse trading strategies.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #Strategy
❀69πŸ†8πŸ‘Œ7πŸ‘2⚑1πŸ‘¨β€πŸ’»1
This tool effectively identifies upward (bullish) and downward (bearish) pinbars on various chart timeframes. Users can customize the parameters for specifying pinbar structure and detection logic to meet specific needs. The tool visually represents detected pinbars with colored arrows, using lime for upward indicators and red for downward indicators, making it easier to interpret chart data. Moreover, it can be configured to provide pop-up alerts and push notifications, allowing timely updates in real-time trading scenarios. To utilize its full potential, adjust the input parameters according to the preferred trading strategy and enable alerts as needed for optimal monitoring.

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
❀51πŸ‘¨β€πŸ’»5πŸŽ‰1
The article explores the enhancement of graphical tools within the MetaTrader 5 client terminal using the MQL5 language. It introduces a method to create composite graphical objects, enabling traders and developers to bundle analytical tools into new technical analysis sets. This is achieved by improving library classes, allowing for dynamic connections and arrangements between base and dependent objects. The development involves creating new classes to manage the coordinates of dependent objects attached to basic graphical objects, streamlining the process of graphical data manipulation. These advancements provide traders with the flexibility to configure and automate complex analytical tools in real-time, enhancing trading efficiency and accuracy.

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #Algorithm
❀52πŸ†7πŸ‘¨β€πŸ’»3
John Ehlers, in his February 2022 article for TASC, discusses the application of the inverse Fisher transform to develop a tool he names the "elegant oscillator." This version is an enhancement over the original, offering flexibility through the non-fixed oscillator period and the ability to choose different price inputs. Users are encouraged to experiment with various parameter settings. An example highlights two configurations: the default setting in red and an alternative setting with periods 100,100 in blue. This illustrates the broad scope for customization, providing traders with a versatile indicator that can be tailored to their specific analysis requirements within diverse market scenarios.

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #Indicator
❀39πŸ‘4πŸ‘¨β€πŸ’»3
Optimize your trading strategy with a sophisticated approach to MetaTrader 5 by applying multiple custom criteria in a single optimization run, rather than separately. The article introduces innovative techniques for visualizing balance and equity graphs, using minimal MQL5 coding experience. By utilizing separate include files for key functionalities, you streamline data collection and custom criterion calculations. Discover methods to evaluate optimization results efficiently with advanced graphical representations for balance and equity, allowing you to make informed decisions swiftly. The approach boosts productivity by preserving only necessary trade data, thus ensuring effective data processing and insightful criteria evaluation for better trading outcomes.

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #ExpertAdvisor
❀80πŸ‘15⚑6πŸ‘¨β€πŸ’»3πŸŽ‰2
The Didi Index has been simplified by inverting only the slow line to align with the trend direction. This adjustment aims to streamline the interpretation process while retaining essential trend visibility. By focusing exclusively on the slow line inversion, complexity is reduced without sacrificing crucial trend-following capabilities. This approach is particularly beneficial for traders seeking a refined method for gauging market trends and making informed decisions. Implementing this simplified version can enhance analytical accuracy and efficiency, simplifying the decision-making process for traders while maintaining reliability in market trend assessment.

πŸ‘‰ Read | Forum | @mql5dev

#MQL4 #MT4 #Indicator
❀36πŸ‘¨β€πŸ’»8πŸ‘7πŸ”₯2πŸ†2πŸ‘Œ1
Optimization algorithms continue to be vital in solving complex problems. Among these, the Cyclic Parthenogenesis Algorithm (CPA) draws inspiration from aphids' reproductive strategies, balancing solution exploitation and search space exploration. Proposed by Ali Kaveh and Zolghadr, CPA involves colonies of solutions, with mechanisms for both self-replication and paired reproduction. It organizes decisions within the colony and introduces migration between them for information exchange.

Implementing CPA involves creating several colonies, each having "female" and "male" individuals. The process includes using the C_AO_CPA class, which manages parameters like population size and colony count. The algorithm proceeds through initializing, moving, and revising solutions, incorporating factors such as scaling and flight probability.

Test results for C...

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #algorithm
❀69πŸ‘16πŸ’”6✍3⚑3😁3πŸ‘Œ3