MQL5 Algo Trading
390K 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
In the realm of IT, one would appreciate the implementation of a script that has a function to track the stop loss of every open purchase and sell order. Manipulating the TrailStart and TrailStop parameters can customize these to align with one's desired levels. Undeniably, this acts as a fundamental instance and opens the door for further enhancement and customization, catering to a range of specific requirements. This proposed automation is instrumental in optimizing strategies, thereby fostering increased efficiency in trading activities.

Read more...
πŸ‘3πŸ‘1
MetaTrader 4 users may find interest in the new script developed for automated buying and selling actions. It functions based on a simple continuous trend-following strategy. The script has several components:

Initialization and Deinitialization: These two stages ensure the smooth running of the script. The success of initialization and deinitialization is verified through printed messages.

OnTick Function: This function responds to every new price change in the market. It performs various subfunctions including tracking variables' reset, open orders' check, position opening, and closed orders' check.

Open Buy and Sell Positions: If predefined conditions are met, the script initiates buy or sell positions corresponding to the market bid or ask price respectively. Stop loss and take profit are also defined in this stage.

Input Parameters: The script includes parameters for lot size...

Read more...
πŸ‘6πŸ‘2
Simulated Annealing (SA) algorithm's conventional version was discussed in the first part. This discussion revolved around three main concepts - randomness, acceptance of worse decisions, and reduction of the probabilities of accepting worse decisions. Think of a de-heated metal gradually cooling, causing shifts in its structure. Similarly, the Simulated Annealing algorithm starts from a high temperature and lessens the temperature incrementally aiming for the optimal solution. The algorithm's significant parameters, such as the initial temperature and the cooling ratio, can greatly influence its efficiency.

Some shortcomings of the system were examined as well. It was observed that this algorithm tended to get stuck at local extrema, which can be overcome by using an appropriate distribution of the random variable. Likewise, improving the convergence speed and efficiency of the algo...

Read more...
✍3πŸ‘3❀2πŸ‘1
A newly designed script offers its functionality to technocrats dealing with financial data, particularly those focusing on candle analysis. This script serves to perform several tasks with high accuracy and ease, hence simplifying decision-making in trading.

The script's primary function is data retrieval - it gathers vital information about the open, close, high, and low prices of candles pertaining to the attached financial instrument. Post retrieval, the script moves to categorize each candle as bullish, bearish, or neutral, founded on the direct comparison between its respective closing and opening prices.

A unique feature of this program is its ability to calculate the amplitude (the high-low difference) of every candle. Further, it comprehensively computes the average amplitude for both bearish and bullish candles, a crucial utility for making strategic, informed decisions.

...

Read more...
πŸ‘4❀2⚑1πŸ‘1
Experienced software developers and traders may find interest in the "Virtual_SL_TP_Pending_with_SL_Trailing.mq4" script. This adaptable trading tool is constructed to handle trades by adjusting virtual stop loss and take profit levels, in addition to a virtual pending order, all encompassing an optional trailing stop loss function.

Copyright and Link: These data points outline proprietary details and provide a direct path to the developer's portal. The Version element highlights the current software revision. Description: This section offers a detailed outline of the script, including ways of contact for the maker, pertinent IP minutiae, and a cautionary note about utilizing the software at personal risk.

Input Parameters: These external variables give users an avenue to modulate the EA's response, inclusive of options such as StopLossPoints, TakeProfitPoints, SpreadThreshold, Trai...

Read more...
πŸ‘4πŸ‘1
Unraveling the complexities of probability theory and interfacing it with optimization algorithms, this study offers an in-depth analysis of various aspects such as probability, distribution, expectation, dispersion, skewness, and kurtosis. No stone is unturned in analyzing random phenomena and determining the probability of outcomes.

Delving into the practical aspects, the post details the construction of random numbers according to required distribution laws. Implementations under scanner include uniform distribution, normal distribution, and power law distribution. It also verifies the approach with a specially designed test bench.

The implementation delves into deeper aspects of optimization, using probability distributions to model uncertainty and approximate complex functions. This study culminates in the introduction of a revolutionary optimization algorithm, the β€˜Smart Ceph...

Read more...
❀2πŸ‘2πŸ‘2πŸ”₯1
In an attempt to increase efficiency in detecting new bars within a code, focus is shifted away from using time, and instead utilising the count of bars. This method is not only lighter, but also operates at a faster pace than its time counterpart.

Variables are declared using integer data type to contain the bar counts. Upon initialization, the bars count is assigned to the "BarsTotal_OnInt". The function iBars() is utilised to allocate the bars count for the "BarsTotal_OnTick" variable during live chart operations. It is important to note that this variable undergoes updates on every tick.

The accuracy of the code can be validated via the use of comments and alerts. Always strive to maintain a clean and concise programming culture, fostering a comprehensive understanding of operations. Leveraging the use of bar counts positively impacts output speed and greatly enhances overall c...

Read more...
πŸ‘7πŸ‘3🀨1
πŸ’‘Do you have an interesting idea you're eager to share with the community❓

Write an article on MQL5.com, where thousands of readers can learn from your experience. You can discuss your findings and seek assistance from seasoned algo-traders.

What's more, you can monetize your knowledge😎

Add new article...
πŸ‘12❀3πŸ”₯2πŸ‘1πŸ†1
In the data-driven era, the Principal Component Analysis (PCA) stands as an indispensable tool for dimensionality reduction in large data sets. This process discards 'non-principal' components, essentially refining the data to its most significant vectors.

The key to a well-performed PCA lies in identifying those principal components, which can potentially be achieved through methods like the Eigen vectors & values, Singular Value Decomposition (SVD), and the Power Iteration. Like finding a diamond in the rough, PCA pinpoints the matrix vector that embodies the entire matrix's principal components.

PCA's ability to reduce the computation cost enhances efficiency when comparing data points in forecasting and diminishes computation time during model training. In a world where IT resources are precious, PCA can also help mitigate the 'curse of dimensionality,' minimizing storage spac...

Read more...
πŸ‘2πŸ‘1πŸ€”1
Discover how a database can aid your trading strategy. This piece outlines how to construct a database for storing data from the MQL5 Economic Calendar, offering a practical resource for managing and analyzing large datasets. The data compiled will allow traders to act quickly in response to significant news releases, enhancing opportunities for profit. The use of SQLite databases in MQL5 makes it possible to work with extensive data sets with ease, even in strategy testing. Get a clear understanding of the benefits and challenges of trading in various currencies listed on the MQL5 Economic Calendar.

Grasp how daylight savings impacts back-testing and the functioning of financial markets. Extracted from US, UK, and Australian contexts, the concept is explained clearly with references to changes in trading schedules or time zones during the daylight saving period.

The article then ...

Read more...
πŸ‘4πŸ‘Œ3πŸ‘1
Understanding the versatile GridManager library: For efficient grid management, the library contains standardized base public methods. Give special heed to MaxDD or 'maximum allowed drawdown'. By default, its value is inactive but can be energized using the Set method. The emphasis here is on the %balance value.

Starting a fresh grid, though not initiated, can become effortless with the Start method. Concurrently, make use of Update for identifying new entries and possible exits.

Exemplifying these principles, observe this representative code of EA operating based on the GridManager Object. This understanding of grid management comes handy in many real-world programming scenarios. All effectively highlighting the versatility of the GridManager library.

Read more...
πŸ‘9❀5πŸ‘2πŸŽ‰1
The following piece of the article is about the utilization of a CNN-LSTM-Based Model to forecast financial timeseries, as implemented by senior developers Wenjie Lu, Jiazheng Li, Yifan Li, Aijun Sun, Jingyang Wang in their research paper published in the Complexity magazine. They found the model had utmost accuracy compared to other available ones during the course of the experiments.

Python is a recommended platform due to its extensive capabilities in handling ML models along with its set of specialized libraries making data preparation and processing facile. For maximizing productivity, GPU resources are encouraged to be used. The prerequisites involve the installation of Python version 3.9.16 and libraries (suitable for Conda/Anaconda users).

A significant aspect of this model is building and training it. For this purpose, a Python script is employed. The steps include import...

Read more...
πŸ‘4πŸ‘2
A new cryptocurrency Expert Advisor (EA) has been developed, aimed at facilitating ETH/USD trading transactions. This application was birthed in response to challenges faced with timing and schedules in the flurry of day to day activities. Decentralizing the process, the EA is deployed on a Virtual Private Server (VPS), ensuring round-the-clock response to trading signals and entries.

The EA embraces a relatively straightforward strategy. It identifies the trend after touching the Bollinger Band (200), from which a trade is enacted on the 55 WMA breakout. Trailing is executed using the Bollinger Band, providing critical support for large-scale profits. Recommended for a 5-minute trade chart, the EA implements an extensive TP/SL ratio of 30/1 and trailing.

Entry is done via 55 WMA, with the trend and trailing conducted by Bollinger Bands 200. Being suitable for conservative investme...

Read more...
πŸ‘6πŸ‘2❀1
The complex market patterns encountered by programmers can be categorized into two distinct trends - horizontal and non-horizontal. To explain this concept in detail, let's consider the Janus factor, a theory that succinctly encapsulates the dual nature of these market trends.

Per the Janus theory, the market intricacies are driven by price oscillations and proportional trader responses, a mechanism akin to a feedback system. In trending markets, gained confidence motivates traders to augment their profits, leading to price escalation. Conversely, an atmosphere of uncertainty incites fear, encouraging traders to sell to curb potential losses.

An instrumental component of this feedback-based approach is the analysis of symbol performance in varied market conditions. The analysis evidences that traders usually favor high-performing stocks in an uptrend, while targeting under-performin...

Read more...
πŸ‘6πŸ‘4
In a recent release, a four-step process is outlined for developers to count "X" times and then pass in their code. The first two steps involve establishing a variable to set the count limit and recording the counted limit. The process continues with comparison of the counter and count limit, triggering the passage of a designated code block when equal. It concludes with resetting the counter to avoid an infinite count.

Another technique integrating wait times is also brought to light. This method alternates between passing and waiting intervals in the code. Counter and waiter variables are initially set, leading to pass or wait activities dictated by the count and wait limits. The final step is resetting both counter and waiter to maintain the function’s continuity. Users can implement filtering conditions to the counter and waiter blocks as per their requirements.

For scenarios wh...

Read more...
πŸ‘5πŸ‘1
In the ongoing development of an Expert Adviser, a base system for order processing has been implemented, utilizing MetaTrader 5 platform. The aim is to create a system that works seamlessly with a real trading server for both demo and real accounts.

Initial functions in this system are basic, enabling operations with the trading server and ensuring accurate communication between the EA and the platform. In order to avoid unnecessary complexities, the system is designed to take full advantage of MetaTrader 5's support for working with a trading server.

An issue with user interface on MetaTrader 5 has been addressed to improve ease-of-applications for users transitioning from other platforms. A code adjustment has been made to change selections in MetaTrader 5 to resemble other platforms and provision for notifications has been integrated to alert users about chart object creation ...

Read more...
πŸ‘2⚑1
Fellow developers and technologists, here's an illuminating breakthrough into the process of restoring a historical position from trading deals. A position essentially, is a result of an executed trading order. Whereas obtaining open positions are straightforward, the complexity lies in retrieving already closed positions due to the absence of conventional functions to handle that. Yet, there's a workaround - complementing the unique ID assigned to each position.

This ID is what gets registered in deals affecting the position, such as opening, modification, or closure. By assembling a list of deals, links to positions associated with certain deals can be discovered. This way, the entry and exit deals for a position can be identified along with other key elements like time, and lot among others.

Building on that foundation, a loop can be used to generate lists of historical deals. Fo...

Read more...
✍4πŸ‘2πŸ‘1
Latest developments in multi-symbol, multi-period indicators have uncovered a more streamlined way to process and display data. Drawing styles can now indicate whether a buffer is colour or not, providing a unique perspective to IT professionals examining the data. The capability to determine the source array for the class buffer, expedites the data copying process.

New indicator object creations now allow for an immediate setting of Digits and the initial "empty value" of data and colour buffer. Additionally, indicator levels and values can be set at creation. This feature simplifies buffer colour assignments and indicator properties.

However, the most significant development lies in the ability of multi-period indicators to use multiple arrays per plot buffer. This reduces the need to remember narrower specifics, such as the array assigned to the indicator buffer or indirect ind...

Read more...
πŸ‘5πŸ‘1
A new script is garnering attention in the tech community for its unique approach to data management. Requesting rate updates every 50ms, this innovative script captures data and stores it in an array with remarkable efficiency.

Subsequently, the script performs an operation to identify both the maximum and minimum values contained within the array. This practical application of data science may greatly benefit sectors that require constant monitoring of fluctuations such as finance, weather forecasting, and IoT technologies.

Emphasizing on performance, speed, and accuracy, this script might revolutionize how developers track and analyze real-time data. A tool showcasing the blend of programming ingenuity and technical knowledge, the implications for its future applications in data mining and analytics are worth observing.

Read more...
πŸ‘7πŸ‘3🀑2❀1
In the realm of system development, APIs propel efficient communication between various applications. A noteworthy subset is the RestAPI, which simplifies interaction between diverse internet systems. Driven by straightforward principles, RestAPIs employ resources and identifiers to orchestrate data management. Unlike the once-popular SOAP protocols, RestAPIs offer a more streamlined alternative for system communication. These APIs can be implemented in various programming languages, reinforcing their preference among developers worldwide.

In a digital sphere, the term "API" reigns supreme. An API is essentially rules and protocols that facilitate inter-software communication. Their function extends to consolidating real-time data from other services, abstracting system complexity, and providing a dedicated, secure channel for interaction between applications. However, due largely to...

Read more...
πŸ‘5πŸ‘1
Evolution Strategies algorithms are optimization methods that mimic natural selection. Used primarily in machine learning and AI, they have been adapted since their emergence in the 1960s, subsequently becoming critical in solving complex optimization problems. By utilizing real vectors to represent solutions and various algorithmic operators, a more accurate solution space is achieved. Variants differentiate through their operators and population processing methods.

The (1+1)-ES variant, though less effective with complex problems, is a simple method that creates one child per parent, with the best solution becoming the future parent. This approach uses a random vector, modified per generations, until optimization.

The (ΞΌ,Ξ»)-ES variant generates Ξ» children from a population of ΞΌ parents, with the best replacing the parents. Created in 1965, this algorithm promotes a competition mod...

Read more...
πŸ‘4❀1πŸ‘1