MQL5 Algo Trading
389K subscribers
2.58K photos
2.58K 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
Developers, consider a script that possesses the capability to close or delete an order contingent on the input value passed onto it. In practice, if the OP_BUY parameter is issued, all buy trades would be abruptly terminated. Similarly, inputting OP_SELL_LIMIT would result in the immediate deletion of all sell limit orders. This represents another evolutionary step in the development of automation procedures, with impacts felt directly in the field of trading operations.

Read more...
πŸ‘5❀1πŸ‘1
Attention to developers in the trading sector! We present a simplified script that diligently manages open tickets, geared to eliminate errors. The tool sorts the tickets in ascending order, proceeding to close them one by one, following the order of arrangement. The initial trade gets to be attended to first, followed by the second, and so on, until closure of all trades is achieved.

Designed with precision, this script comes furnished with a magic feature and a symbol filter. This pair continues being the cornerstone of trade management, enabling bespoke customization of activities. This characteristic aids to streamline the trade closing process; thereby, enhancing efficiency and saving time.

The script's innovative design prioritizes thoroughness and order to foster well-timed operations. You'll discover its simplicity, yet a stark standout efficiency-wise, in managing trade ti...

Read more...
πŸ‘6πŸ‘2❀1
In the realm of order types, the following exist: OP_BUY, OP_SELL, OP_BUYSTOP, OP_SELLSTOP, OP_BUYLIMIT, OP_SELLLIMIT. Six in total, each bearing a unique role in the procession of market operations. This pertinent script is specifically engineered with the capability to accurately determine the quantity of both active and efficiently closed orders, rendered in correspondence with their particular type. Such a feature proves indispensable for effective order management and strategic decision-making in live market scenery. By rendering real-time data accessible in an organized fashion, the script facilitates efficient market analysis.

Read more...
❀7πŸ‘3πŸ‘2πŸ‘€1
Unveiling an expert advisor that possesses the capability to calculate current winning and losing streaks in the MT4 terminal. The innovative system incorporates two filter options - one based on symbols, and the other on a Magic number. In case these filters are activated, the calculation of winning and losing trades will be contingent on the filter parameters. Enhancing the accuracy in determining the success ratio of trades, this expert advisor leads in precision and customization. Suitable for traders who appreciate granular control in their hands, this system proves critical in making informed decisions and strategizing future trades.

Read more...
πŸ‘9❀3πŸ‘1
The world of binary options can be a riddle, considering the numerous trading platforms with limited capabilities for strategy testing and optimization. Hence, MetaTrader 5 proves to be a reliable tool for examining various strategies for binary options.

In binary options, the goal is to accurately predict the market scenario. The assets range from currencies, securities, commodities, and even weather forecasts. Despite the ease of trading and simple registration, the disadvantages include high risks and hefty commissions.

Multiple types of binary options are available for trading. High/Low options involve predicting whether the asset value will rise or fall, One touch requires predicting if the desired price level will be achieved, and Range determines a price corridor within which the asset value will be placed upon expiration.

Various strategies are available for binary options...

Read more...
πŸ‘6❀4πŸ‘2πŸŽ‰1
The expert advisory systems in development today pack a lot of efficiencies and features, but much excitement is around an advisor with a code that developers often find useful. Usually, the focus is on the last completed trade, but this advisor offers the flexibility of trade searching with any index.

By implying active trade, the reference is not to pending orders but market orders. For instance, passing 0 will yield the latest active trade, whereas passing 1 will fetch the trade before the most recent one, and the pattern repeats.

Another excellent feature is trade filtering based on symbols and magic numbers. These features enhance user experience and operational efficiencies, significantly driving productivity among developers and users alike. The trade search option by index, in particular, brings a fresh level of flexibility and customizability to the platform.

It is a de...

Read more...
❀5πŸ‘Œ1
A robust new expert advisor promises to enhance developer interactions with trading indices. Traditionally, obtaining the last active trade is necessary; however, this new device provides a refreshing deviation, allowing developers to search a trade with any index. For clarification, by 'active trade,' market orders, not the pending ones, are referred.

The innovative tool operates on a simple numerical system: inputting '0' retrieves the latest active trade. Simultaneously, keying '1' brings up the trade prior to that, and the system follows this pattern progressively.

A unique add-on to this feature is its ability to sift through trades based on the symbol and magic number. This dramatically streamlines the trade selection process, enabling easier and more efficient navigation in the trading environment. Enhanced functionality and efficiency, now more attainable for developers with...

Read more...
❀4πŸ‘2πŸ‘1
Understanding the importance of history in the context of trading, an Expert Advisor (EA) has been devised to help. This EA functions to scan all closed trades, identifying the most recently closed one.

Renowned for its specificity, this EA implements a system where a passed parameter, such as 0, fetches the most recently closed trade. Continuation in this pattern, passing 1 for example, retrieves the trade that closed prior to the most recent, with following numbers retrieving their respective trades.

Key features of this EA include a symbol filter and a magic number filter. These filters grant the ability to sort trades based on particular symbols and magic numbers, thereby upping the game in targeted analysis.

Overall, this EA holds great potential in enhancing trade monitoring through its specialized historical review feature.

Read more...
❀3πŸ‘3⚑1πŸ‘1
In the realm of expert advisor development, finding solutions that cater for common requirements can be invaluable. One such solution presented here allows developers to search for a trade using any index, rather than just the last active trade. This feature enhances flexibility and control.

Active trades, referring specifically to market orders, can be fetched based on their position in the sequence - the most recent active trade being retrieved by passing 0, the preceding trade by passing 1, and so forth. Moreover, this solution affords the opportunity not only to identify trades but also to filter them based on symbol and magic number.

In essence, this expert advisor provides a comprehensive approach to trade retrieval, delivering efficiency and customization to developers in their work. Providing solutions that encompass a myriad of developer needs is an invaluable quality.

Read more...
πŸ‘6❀5πŸ‘3
Designing a robust trading system takes skill and knowledge of key technical analysis tools. One such tool is the Fibonacci Retracement, widely appreciated for its efficiency. The text discusses how to use this tool to build an effective trading system on the MetaTrader 5 terminal using the MQL5 language.

The process includes defining Fibonacci, understanding its strategy and blueprint, as well as creating a trading system. It's advised to supplement Fibonacci with other technical tools for best results. Before actual trading, thorough testing of the strategies is recommended.

The Fibonacci Retracement tool is based on the Fibonacci mathematical series. On a chart, it appears as horizontal lines at levels like 23.6%, 38.2%, 50%, and 61.8%. The retracement after an uptrend or downtrend is tracked using these Fibonacci levels acting as potential support or resistance points.

Two a...

Read more...
πŸ‘8❀2πŸ‘2
The concept of the weighted deviation is an extension of the simple linear weighted deviation model. With linear weighting incorporated into every calculation step, the result is an indicator that functions differently than the standard deviation when a linear weighted moving average is operative. Its responsiveness surpasses that of the standard deviation, reinforcing its utility in a variety of scenarios. This deviation indicator can be employed in the same way as any other deviation indicator for nuanced technical analysis. It offers a more refined data interpretation, thereby enhancing the overall efficiency of the trending strategy.

Read more...
πŸ‘5❀1πŸ‘1πŸ‘Œ1
Principal Component Analysis (PCA) is a widely utilized technique across various fields such as image processing, finance, and machine learning. PCA helps in reducing the dimensions of large data sets by transforming a set of variables into a smaller one that still encapsulates the majority of the information from the larger set. This process not only simplifies the data, allowing for easier visualization and analysis, but also enhances the efficiency of machine learning algorithms.

Key steps in the PCA algorithm include standardizing the data, finding the covariance matrix, eigenvectors, eigenvalues, PCA scores, and finally, obtaining the principal components. Standardization is crucial as it normalizes the data, ensuring that each variable contributes equally to the analysis and preventing bias due to varying scales or units.

Understanding PCA and its implementation can significa...

Read more...
πŸ‘8❀2πŸ‘2
Automated trading strategies continue to be integral in financial markets, aiding in the execution of complex trades with efficiency and precision. In the realm of algorithmic trading, the development of such strategies can be observed through various materials including code files. One example includes code files in the .mq4 format, designed for MetaTrader 4, which encompasses about 525 lines. This illustrates a standard scope for scripting comprehensible yet substantial automated trading algorithms. These strategies are not just about facilitating trades but also about enhancing performance by refining accuracy and decreasing time latency. Professionals interested in automated trading will find studying these strategies beneficial for understanding both the technical aspects and practical implementation in trading platforms.

Read more...
πŸ‘5❀2πŸ‘1
In continuing the discussion on automated EA (Expert Advisor) management for MetaTrader platforms, attention turns to interaction restrictions between the EA and the C_Orders class to prevent unauthorized transactions. Key enhancements include conditions that block the creation of new orders when specific limitations are detected, such as already having an open position on HEDGING accounts or a pending order ticket already in place.

Further exploration is given to NETTING accounts where automated EAs pose unique risks. Specifically, problems arise when the trading server on a NETTING account automatically adjusts the average position price, potentially causing significant financial loss if not correctly monitored and controlled.

To address potential volume control issues in automated trading scenarios, a trading volume limit is introduced. This involves implementing a static, global...

Read more...
❀11πŸ‘2πŸ‘2
In the realm of financial trading, analyzing market trends through bullish or bearish bars can be vital for strategy development. The provided sample code is designed to count the number of consecutive bullish or bearish bars in a trading data set. This functionality assists traders in quantifying momentum and potentially forecasting future market movements.

Developers and traders can utilize this code as a foundational tool, with the ability to modify or enhance it to better align with specific trading strategies or analytical frameworks. It stands as a practical example of applying programming skills to financial markets, offering both insight and utility for technical analysis purposes.

Read more...
πŸ‘6❀2πŸ‘1
Statistical arbitrage employs advanced mathematical models to exploit pricing inefficiencies among closely related financial instruments. Using methodologies such as correlation, cointegration, and the Pearson coefficient, this trading strategy enables the identification of paired assets with significant predictive price relationships.

Correlation in quantitative finance quantifies how two securities mirror each other's price movements. A positive correlation implies synchronized movement direction, whereas a negative correlation suggests opposite movements. Traders exploit these correlations to forecast future price behaviors.

Cointegration extends correlation by measuring the stability of the linear combination of two or more variables over time, suggesting a long-term equilibrium despite short-term individual variance. This forms the basis for pairs trading strategies, focusing ...

Read more...
❀4⚑1πŸ‘1πŸ‘1
In the rapidly evolving field of algorithmic trading, the integration of machine learning and data mining techniques has become essential for uncovering hidden patterns in financial data. Yun Li, Jennie Si, Guojing Zhou, Shasha Huang, and Songcan Chen have introduced a notable contribution, the "FREL: A Stable Feature Selection Algorithm." This research leverages the algorithm Feature Weighting as Regularized Energy-Based Learning (FREL) to enhance feature selection.

FREL is based on weighted nearest-neighbour classification, refining prediction accuracy by assigning appropriate weights to each feature. This method is differentiated from the standard k-nearest neighbor (k-NN) algorithm by utilizing weights based on the proximity of the data points, typically calculated using metrics such as the Manhattan distance.

The conceptual foundation of FREL lies within energy-based models, wh...

Read more...
πŸ‘4πŸ”₯2πŸ‘1
The new Expert Advisor (EA) tool focuses on trading signal efficiency by utilizing specific technical indicators across multiple timeframes. This EA initiates buy orders based on MACD divergence on the 5-minute chart, combined with conditions where the stochastic main line on the 1-hour timeframe surpasses its signal line within the 0-40 range. Additionally, a daily EMAs crossover where the 9-period EMA exceeds the 20-period EMA supports the buy signal, further validated if the 5-minute price bar closes beneath the 9 EMA of the daily chart.

Sell orders are executed under the inverse conditions. The EA's strategy includes precise entry points and exits based either on predefined stops and targets or when the 7-period RSI on any given chart exceeds the 77 mark, indicating an overbought scenario.

Optimized for minimal trading frequency, this EA requires extensive backtesting, ideally ...

Read more...
πŸ‘7πŸ”₯3❀1πŸ‘1
Continuing the examination of MQL5 wizard capabilities, Bayesian inference emerges as a significant statistical tool for updating probabilities with new data. This method remains particularly useful in forecasting time series, critical in financial markets where traders primarily analyze security prices and trade histories. The premise of Bayesian inference is to increase the adaptability of trading systems by continuously updating hypotheses, which potentially reduces curve-fitting errors during historical data tests and future applications.

Bayesian Inference operates on the formula P(H|E) = [P(E|H) * P(H)] / P(E), where H symbolizes the hypothesis and E stands for evidence. This formula facilitates recalibrations based on new data, though challenges remain in determining P(E|H) effectively.

Practical applications in trading using Bayesian inference can be typified through signal,...

Read more...
❀6πŸ‘2πŸ‘1
The updated "Simple Yet Effective Breakout Strategy" now incorporates additional functionalities tailored for proprietary trading firm challenges. Given the essential criteria for such challengesβ€”achieving target profits, adhering to maximum daily loss limits, and maintaining overall loss thresholdsβ€”the script now includes two key functions.

These functions are designed to automatically close all positions and cancel pending orders if the target profit is achieved or if the trades are nearing the maximum daily loss limit. It is important to note that the handling of the maximum loss criterion is dependent on individual trading strategies and risk management practices, and as such, is not integrated into this script.

The updated script requires users to configure specific parameters, enhancing its utility and adaptability in meeting the rigorous demands of prop firm trading challenge...

Read more...
πŸ‘5πŸ‘3