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
The article delves into innovative adaptations of the Commodity Channel Index (CCI) to improve its analytical accuracy and application in trading. By altering the calculation logic, such as replacing division with multiplication, and considering new statistical methods to set indicator levels, the modifications aim to produce unique and reliable indicator values. The evaluation is further enhanced by using diverse window functions like triangular and flat-top, resulting in varied outcomes. Testing with expert advisors reveals significant differences in trading performance. The adaptations provide traders customizability and potentially more informed trading decisions, catering to both classic and modern trading strategies.
#MQL5 #MT5 #CCI #EA

Read more...
❀44πŸ‘22πŸ†5⚑4πŸ‘Œ3πŸ‘¨β€πŸ’»2πŸŽ‰1
A straightforward trend-following strategy is introduced for daily (D1) time frames. Buy signals trigger when the closing price crosses above the EMA based on high prices, provided the RSI is above 55. Sell signals occur when the closing price crosses below the EMA based on low prices, with RSI below 45. Any existing trade will close upon an opposing signal. This strategy includes take profit and stop loss mechanisms to manage risk effectively. Decision-making relies on the calculated EMA and RSI indicators to ensure adherence to the defined trading logic. Suitable for traders seeking structured approaches within daily time frames.
#MQL4 #MT4 #Strategy #Trend

Read more...
πŸ‘37❀15πŸ‘¨β€πŸ’»8πŸ‘4✍2πŸ‘€2πŸ‘Œ1
Variational Autoencoders Unveiled"

The variational autoencoder (VAE) offers advanced unsupervised learning capabilities. It differs from standard autoencoders by incorporating a probabilistic approach to output distributed representations instead of single deterministic values. This addresses the interpolation gap issue seen in traditional autoencoders when reconstructing image data.

The VAE architecture uses an encoder to output distributions characterized by mean and standard deviation instead of discrete values. The reparameterization trick is key, allowing backpropagation compatibility despite non-differentiable elements like random generation by sampling from a standard normal distribution, and adjusting with learned parameters.

Regularization via Kullback–Leibler divergence encourages feature distribution alignment to a standard normal distribution, balan...
#MQL5 #MT5 #AI #ML

Read more...
πŸ‘44❀30⚑13πŸ‘Œ11πŸ‘¨β€πŸ’»11πŸ‘Ύ8✍4
This trading assistant is specifically designed for manual trading operations, operating exclusively on the current symbol. It utilizes a new parameter for trailing known as 'Trailing activate if profit is >= ', serving as a breakeven point for triggering the trailing mechanism. If a position reaches this set profit level, trailing will be activated. In instances where positions lack Stop Loss or Take Profit values, the assistant automatically applies the specified input parameters. Additionally, the assistant tracks target profits: once the target is reached, all positions are closed. Importantly, this Expert Advisor does not restrict the use of Magic numbers and ensures that, when modifying positions, the Magic number is preserved. This enhances flexibility and efficiency in managing trades effectively.
#MQL5 #MT5 #EA #Trading

Read more...
πŸ‘25❀20πŸ‘Œ3πŸ†1πŸ‘¨β€πŸ’»1
Creating a base class for WinForms object lists in your library enhances modularity and reusability. This class will encapsulate common functionalities needed for handling lists of WinForms objects, serving as a foundation for derived classes such as ListBox and ButtonListBox. By implementing this base object, you'll streamline future developments, ensuring a consistent structure and reducing redundancy.

Enhancements in library classes include making necessary adjustments in access controls for private methods to maintain functionality after recent client terminal updates. This involves refining inheritance and encapsulation practices to ensure seamless interaction with private methods through protected access.

The addition of new graphical element types and properties supports the comprehensive handling of UI elements. In the context of creating g...
#MQL5 #MT5 #WinForms #SoftwareDev

Read more...
❀46πŸ‘27πŸ‘¨β€πŸ’»10πŸ‘Œ4⚑1✍1
Users involved in data collection for modeling can utilize time dummies as a tool in economic modeling. The provided indicator generates each hour of the day as a binary buffer array vector, with an additional buffer storing the specific hour. When collecting data from other indicators, such as via a CopyBuffer function, this tool can add dummy columns for hours to the dataset. Ideal for those compiling data for machine learning or similar purposes, it offers a straightforward dummy variable (buffers 0-23) and an hour variable (buffer 24) for modeling.

The process begins by declaring buffer and plot numbers as 25. Buffer labels are assigned within the data window, followed by the declaration of buffers and an integer variable for the current hour. Using SetIndexBuffer proved challenging during looping, leading to an alternative approach, although plotting i...
#MQL5 #MT5 #Indicator #ML

Read more...
❀30πŸ‘22⚑3πŸ‘¨β€πŸ’»2πŸ‘Œ1πŸ†1πŸ‘€1
Polynomial regression serves as a key method in machine learning for handling nonlinear data relationships. It extends the capabilities of basic linear regression by fitting a polynomial equation to the data, allowing for more flexibility in modeling. Determining the optimal polynomial order plays a crucial role, which can be evaluated using criteria such as the Bayesian Information Criterion (BIC).

The process of finding coefficients involves matrix operations, making tools like matrix inversion fundamental. Feature scaling is essential to prevent large ranges from impacting the polynomial's power computations. However, caution is advised due to potential overfitting, which compromises performance on out-of-sample data. It remains vital to validate models with diverse datasets to assess generalization properties effectively.
#MQL5 #MT5 #ML #PolyReg

Read more...
❀33πŸ‘25πŸŽ‰6πŸ‘Œ2πŸ‘¨β€πŸ’»2
This code snippet is designed for implementing a trailing stop loss in your Expert Advisor (EA) on MQL5. It provides a framework that automatically adjusts the stop loss level as the trade moves in a favorable direction. The essential variables include `Lot`, `Setloss`, `TakeProfit`, and `TslPoints`.

You need to initialize the `CTrade`, `COrderInfo`, and `CPositionInfo` objects for managing trades and accessing position information. Parameters such as `InpMagic` allow you to specify a unique identifier for the trades so that the EA manages the intended orders.

Place the main logic within the `OnTick` function, calling the `TrailStop` method to check open positions and adjust the stop loss dynamically based on the market movements. This snippet supports both buy and sell positions, ensuring that the trailing stop activates only after the profit exc...
#MQL5 #MT5 #AlgoTrading #Strategy

Read more...
πŸ‘41❀20⚑2πŸ‘¨β€πŸ’»2πŸ‘€2πŸ‘Œ1
The article focuses on enhancing neural network models for trading applications. It utilizes MetaTrader 5, emphasizing its compatibility without third-party software. Initially, a basic perceptron example is introduced, evolving to more complex networks using the MQL library. The main structure proposed is a 4-4-3 network requiring 35 weights and biases, followed by the development of multiple Expert Advisors (EAs).

Optimization challenges are addressed using random number generation for parameter settings. The article discusses CSV files for storing optimization results and emphasizes an efficient method for EA tuning by employing a novel optimization algorithm. Testing was conducted across various timelines, resulting in better performance for the Angle EA compared to the Figure EA.

Future work involves optimization over larger periods and explo...
#MQL5 #MT5 #NeuralNet #AlgoTrading

Read more...
πŸ‘53❀29πŸ€”4πŸ‘Œ4πŸ‘¨β€πŸ’»3⚑1
A new parameter for trailing, 'Trailing activate if profit is >=', functions as a breakeven trigger for trailing operations. Trailing is initiated only after a position reaches a specific profit level, defined in 'Trailing activate if profit is >='. The Expert Advisor is designed to operate on the current trading symbol and adapts to any Magic number for seamless position modification. This feature enhances trading strategy by enabling more precise control over trailing stop adjustments based on predefined profit thresholds, ensuring more efficient risk management. The system does not limit functionality to specific Magic numbers, allowing greater flexibility in trade management.
#MQL5 #MT5 #EA #Strategy

Read more...
πŸ‘35❀18πŸ‘¨β€πŸ’»5πŸŽ‰2⚑1πŸ‘Œ1
In the previous segment of this resource, the focus was on optimizing the mechanism for adjusting pending orders and stop levels in a trading system. This approach, while aligning closely with server-side conditions, faced latency issues due to server communication on each tick adjustment. The solution proposed involves bypassing intermediary values, enabling a more responsive method of updating levels.

Implementation involves creating a 'ghost' label, an invisible indicator reflecting real-time changes, and making adjustments in the C_IndicatorTradeView class. This technique allows on-chart comparison without disrupting the system.

Changes in the variable handling within DispatchMessage and the introduction of a shared class variable help delineate the ghost from the real label, ensuring smooth operation.

These adjustments aim to streamline the process o...
#MQL5 #MT5 #EA #Indicator

Read more...
πŸ‘54❀19πŸ‘¨β€πŸ’»4😱2
The indicator identifies price movements by constructing a rectangle using maximum and minimum prices within a specified time frame. It operates without indicator buffers, making it distinct in its approach. The rectangle is formed by pinpointing the highest and lowest prices over the chosen period, providing a visual representation of price boundaries. This straightforward method allows for quick assessment of market trends and price volatility. By focusing on these critical price levels, users can gain insights into potential breakout zones and resistance levels. This technique enhances analytical capabilities without relying on complex formulas or additional indicators.
#MQL5 #MT5 #Indicator #Algorithm

Read more...
❀43πŸ‘21✍2πŸ‘¨β€πŸ’»2πŸ‘€1
Organizing WinForms objects into independent groups enhances flexibility and control within containers. Typically, objects like RadioButtons are interconnected, requiring management of group indices to allow separate toggle functions within the same container. Assigning group indices helps manage interaction rules. For instance, assigning a different group index to some RadioButtons enables them to function independently, avoiding the need for additional containers.

Enhancements in object properties, such as unique IDs for graphical elements, streamline access and identification. Each graphical element gains a unique ID, facilitating efficient management. The updated property assignment ensures the highest available ID is utilized, maintaining the robustness of object relationships.

Modifications also include improving control features of buttons a...
#MQL5 #MT5 #WinForms #Programming

Read more...
πŸ‘55❀21πŸ‘Œ3πŸ†3πŸ‘¨β€πŸ’»2
A utility EA has been enhanced with features including a specified symbol and magic number. A simple panel using OBJ_LABEL graphical objects displays total and percentage profit on a trading account for designated periods: daily, weekly, and monthly. The daily origin date is calculated based on the current day, adjusting for weekends to ensure the correct settlement day is used, such as Friday if it's Saturday. This setup also reflects transaction amounts over the respective periods, ensuring precise tracking and evaluation of trading performance. The panel provides a straightforward yet comprehensive view of financial activity and assists in decision-making and strategy assessment.
#MQL5 #MT5 #EA #AlgoTrading

Read more...
πŸ‘40❀14πŸ‘¨β€πŸ’»4πŸ”₯3πŸ‘Œ1
The article discusses advanced techniques for improving a MetaTrader 5-based trading system, focusing on integrating a feature to move orders directly on the chart, an essential addition for dynamic trading environments. The author highlights the challenges experienced when extending the system to support various markets like Forex and futures on the B3 exchange. The solution involved refining MQL5 code to adapt order calculations based on market specifics, minimizing errors related to volume and multiplier discrepancies. The new system architecture leverages MetaTrader 5’s capabilities to handle dynamic order management efficiently, aiding developers in creating versatile and robust algorithmic trading tools without significant performance trade-offs.
#MQL5 #MT5 #TradingSystem #AlgoTrading

Read more...
πŸ‘37❀25πŸ‘¨β€πŸ’»17πŸ‘Œ3✍2
The indicator "Fractals on OBV" leverages the On Balance Volume (OBV) indicator to identify potential market turning points. Developed at the request of the community, this tool implements fractal analysis on OBV data. Fractals, representing specific patterns in data series, highlight possible support and resistance levels in trading activity. By integrating fractals with the OBV indicator, the tool enhances technical analysis by providing additional insight into volume flow trends. This approach aims to assist in identifying reversals and optimizing trading strategies through detailed volume analysis. Analyze market dynamics with improved accuracy using fractal-based methodologies on OBV data.
#MQL5 #MT5 #Indicator #Trading

Read more...
πŸ‘37❀26⚑6πŸ‘¨β€πŸ’»3πŸ”₯2πŸ‘Œ1
Explore how to enhance MetaTrader 5 WinForms objects with interactive and animated features to create a more dynamic trading interface. The latest update enables mouse interactivity, allowing GUI elements like buttons to respond visually to user actions. By tracking mouse events and states, elements can adjust their appearance based on user interactionβ€”such as changing color on hover or press. This functionality adheres to typical Windows OS behavior, providing a seamless user experience. Developers are guided through adding new properties, managing event handling, and modifying graphical object behavior to support real-time user interaction, enabling more complex algorithmic trading solutions.
#MQL5 #MT5 #WinForms #UIProgramming

Read more...
πŸ‘55❀28πŸ†14πŸ‘Œ6πŸ‘¨β€πŸ’»4✍3
Developers working with MetaTrader 5 often encounter issues with symbol name mismatches when configuring Expert Advisors (EAs). Users commonly overlook the necessity to adjust symbol names according to broker conventions, leading to EA malfunctions. A typical scenario is when an EA is set to "EURUSD," but the broker uses variations like "EURUSD.i" or "EURUSD.m," causing functionality failures.

To address this, a reference script uses the Levenshtein distance algorithm to match configured symbols with those available in the Market Watch window. This method aids in automatically adapting EAs to broker-specific naming, ensuring smoother operations without manual configurations.

The script serves multiple purposes: it validates configuration during development, assists in testing EA robustness, and supports educational endeavors in MQL5 by demonstrating arra...
#MQL5 #MT5 #EA #Algorithm

Read more...
πŸ‘36❀24⚑5πŸ†5πŸ‘Œ2πŸ‘¨β€πŸ’»1
The article explores a sophisticated approach to volatility estimation using the GARCH (Generalized Autoregressive Conditional Heteroscedasticity) model, which is invaluable for financial data analysis. Unlike traditional methods that assume constant volatility, GARCH accounts for time-dependent volatility, providing a more realistic framework for risk assessment. It covers technical facets such as parameter optimization via the MinBLEIC algorithm in the ALGLIB library, and introduces an adaptive iGARCH indicator for real-time volatility forecasting. This model improves risk management by offering precise volatility predictions and adaptable modeling options, crucial for traders and developers in algorithmic trading.
#MQL5 #MT5 #Volatility #GARCH

Read more...
πŸ‘53❀35πŸ‘¨β€πŸ’»6⚑2πŸ‘Œ2
This Expert Advisor (EA) implements a strategy involving a sequence of positions aligned in a single direction, determined by the initial trade, either BUY or SELL. Subsequent entries are made at the most favorable prices, with an incremental volume increase following a Martingale-like approach. The series of positions, exemplified with SELL orders, continues until specific financial thresholds are met. Closure of the position series occurs when either a predefined maximum drawdown (in monetary terms) is achieved, indicating a loss, or when a target profit (also in monetary terms) is reached. This approach allows for potentially enhanced profit opportunities while managing risk through set financial parameters.
#MQL5 #MT5 #EA #Martingale

Read more...
πŸ‘33❀26⚑2🀯2πŸ‘Œ2πŸ‘¨β€πŸ’»1
Analyzing automated trading algorithms reveals key insights on adapting strategies for robust financial trading. Despite sophisticated backtesting tools available, such reports rarely predict how algorithms perform during unpredictable market shifts. The algorithm's historical success doesn't guarantee future performance due to the dynamic nature of markets.

Distinguish between lazy, persistent, and unstable algorithms. Lazy algorithms may extend trade durations post-market shift, eroding profits. Persistent algorithms switch from profitability to losses without apparent notice. Unstable algorithms can incur significant losses with slight parameter changes, emphasizing rigorous testing to identify vulnerabilities.

Risk management is crucial. Always invest within your risk tolerance, diversify exposure, and maintain readiness for market unpredictability. Au...
#MQL5 #MT5 #Algorithm #EA

Read more...
πŸ‘72❀29πŸ‘Œ6⚑3🀯2πŸ’―2πŸ‘¨β€πŸ’»1