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
Reinforcement learning (RL) enhances the capability of traditional machine learning by effectively managing complex models when historical data is limited. Neural networks, while powerful, face challenges like overfitting and poor generalization. RL offers a solution through techniques like Prioritized Experience Replay (PER), which focuses on high-priority samples, improving efficiency, and learning speed. Key RL components include designing effective reward functions and selecting suitable algorithms, balancing between value-based and policy-based methods, like Q-Learning or PPO. Implementing PER requires additional complexity but provides more targeted learning. Both Proportional and Rank-based Prioritization each have specific advantages and challenges, affecting sampling distribution and stability.

πŸ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #RL
πŸ‘30✍12❀9πŸ‘Œ1πŸ‘¨β€πŸ’»1
This script efficiently gathers closing prices, attaching them to respective dates and times, and subsequently stores the information in a CSV file within the MQL5/Files directory. This approach allows easy external access for further analysis. The script utilizes fundamental functions, leaving room for enhancements once familiarity with advanced functions like CopyTime or CopyRates is established. While these built-in functions might streamline data retrieval, the current script remains effective for basic data collection needs. The choice between iClose, iTime, and other functions can depend on the specific requirements of your project, as performance and complexity trade-offs need consideration.

πŸ‘‰ Read | Quotes | Share!

#MQL5 #MT5 #script
πŸ‘20❀8πŸ‘Œ4✍2πŸ‘¨β€πŸ’»2
In Part 19 of our series, we implemented significant code changes to enable a new order system in MetaTrader 5. This initiative aims to provide traders with visual and easily understandable order placement, negating the need for detailed knowledge of tick values and such particulars.

Planning involved designing custom indicators with MetaTrader 5's resources, demanding a robust understanding of MQL5. Our goal is to create objects that communicate seamlessly and integrate effectively with each order system.

The implementation phase includes developing several classes such as C_Object_Base, C_Object_BackGround, and C_Object_TradeLine, each handling specific functions to maintain system integrity. Initial coding focuses on structuring these classes to meet the complex demands of the new order system.

Moving forward, modification of the C_ObjectsTr...

πŸ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #ExpertAdvisor
πŸ‘57❀21πŸ‘Ύ9🀯3πŸ‘Œ3πŸ‘¨β€πŸ’»3
The Engulfing Pattern Plus One indicator focuses on a specific chart pattern where the current bar completely engulfs the two preceding bars. This observation is based on the 'High' and 'Low' price data. The pattern is visually represented using 'Arrow' objects to indicate occurrences on the chart. Additionally, two rectangles can be manually drawn for users to visualize the pattern and comprehend its formation more clearly. This enhanced visualization aids in technical analysis by showing how the pattern operates, allowing for more informed trading decisions. The Engulfing Pattern Plus One provides a precise view for those looking to analyze market movements and potential reversals.

πŸ‘‰ Read | Signals | Share!

#MQL5 #MT5 #Indicator
❀70πŸ‘39πŸ”₯9✍8πŸ‘¨β€πŸ’»7πŸ‘Œ2
The process exports a trading account's transaction history to a file within your terminal directory at MQL4/Files or to a shared location at Common/Files. The file name can be autonomously created or specified via script parameters. This file assists in replicating transactions on a different server with the Simple History Receiver Expert Advisor or its open-source variant.

Parameters include:

- File Name: Determine a specific name or allow automatic generation.
- Data Separators: Choose between commas or semicolons for CSV data separation and decide on a dot or comma for the decimal point.
- Common Folder Storage: Set to True to save the file in the Common/Files folder instead of the local MQL4/Files folder.

Understanding and setting these parameters correctly streamlines data management and enhances efficiency in transaction simulations.

πŸ‘‰ Read | Freelance | Share!

#MQL4 #MT4 #Script
πŸ‘28❀12πŸ‘Œ3πŸ‘¨β€πŸ’»3
Explore the fascinating Anarchic Society Optimization (ASO) algorithm, inspired by anarchic societal structures without hierarchy. ASO applies unique optimization strategies, diverging from traditional swarm intelligence techniques like PSO and ACO. It balances various movement strategies, guided by indices like Fickleness, External, and Internal Irregularity, to enhance solution space exploration and avoid local optima. With adaptive parameters mimicking anarchic behavior, ASO offers MetaTrader 5 developers and algorithmic traders a robust tool for complex optimization tasks across both continuous and discrete problems, enhancing decision-making through innovative, autonomous procedural design.

πŸ‘‰ Read | Calendar | Share!

#MQL5 #MT5 #Algorithm
πŸ‘17❀15πŸ‘¨β€πŸ’»2πŸ‘Œ1
The Engulfing Pattern Plus One indicator focuses on a specific chart pattern where the current bar completely engulfs the two preceding bars. This observation is based on the 'High' and 'Low' price data. The pattern is visually represented using 'Arrow' objects to indicate occurrences on the chart. Additionally, two rectangles can be manually drawn for users to visualize the pattern and comprehend its formation more clearly. This enhanced visualization aids in technical analysis by showing how the pattern operates, allowing for more informed trading decisions. The Engulfing Pattern Plus One provides a precise view for those looking to analyze market movements and potential reversals.

πŸ‘‰ Read | Docs | Share!

#MQL5 #MT5 #Indicator
πŸ‘36❀15✍2πŸ‘¨β€πŸ’»2πŸ‘Œ1
The latest advancements in developing a trading Expert Advisor involve crucial updates to the order system for accommodating both NETTING and HEDGING accounts, reflecting their operational differences. For NETTING, an average price is generated with a single open position, while HEDGING allows multiple positions with individual limits for simultaneous buying and selling.

The goal is to make the order system visual, eliminating message boxes for position analysis. This visual approach enables real-time insight into profit and loss limits of OCO positions without extra calculations. The strategy involves leveraging MQL5 to model data effectively, supporting dynamic objects and facilitating better chart management without restricting the number of objects.

πŸ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #AlgoTrading
❀36πŸ‘28πŸ”₯2πŸ‘¨β€πŸ’»2πŸ‘Œ1πŸ†1
An indicator named "CHO Smoothed Arrow" has been developed to display arrows in the main window when two lines, 'CHO' and 'Smoothed CHO', intersect. The second version of this indicator introduces enhanced signal checking criteria. In this version, a 'BUY' signal is considered valid only when it appears below the zero line, while a 'SELL' signal is valid only when it occurs above the zero line.

Given that this indicator functions as an oscillator, two strategies can be applied to enhance trading decisions. Firstly, it can be used in conjunction with an additional filter from a trend indicator to improve accuracy. Secondly, a trader might choose to increase their position with each signal generated by the indicator. This refined approach aims at maximizing efficiency and potential returns in trading activities.

πŸ‘‰ Read | Forum | Share!

#MQL5 #MT5 #Indicator
πŸ‘43❀20πŸ”₯2πŸ‘¨β€πŸ’»2⚑1πŸ‘Œ1
Unveil the intricacies of the Asian Breakout Strategy expertly coded into an MQL5 Expert Advisor. This robust system utilizes session-based range detection and moving average trend filtering. It strategically places pending orders at calculated breakout levels, ensuring optimal position entries. Built-in dynamic risk management, including stop-loss and take-profit settings, mitigates market unpredictability. Additionally, a time-based exit strategy ensures efficient order handling post-session. Successful backtesting showcases its effectiveness, which can be further enhanced with trailing stops. This comprehensive EA offers traders and developers a precise tool for trading breakouts, enriching both technical skills and algorithmic trading strategies.

πŸ‘‰ Read | Calendar | Share!

#MQL5 #MT5 #AlgoTrading
❀14πŸ‘13πŸ‘Œ1πŸ†1πŸ‘¨β€πŸ’»1πŸ‘Ύ1
Our focus shifts to automating trade entries using MQL5 in the Economic Calendar series. Trades are automated by analyzing news events, user-defined filters, and time offsets. Orders are executed based on forecast and prior values, aligned with market expectations.

Critical trade logic components include time filters, currency significance, and impact assessments. Trades are evaluated using an offset period before the event. If forecast exceeds prior values, a BUY is executed; otherwise, a SELL. Absent or equal data results in no trade.

Countdown timers manage timing until news release, resetting post-trade to adjust to evolving conditions. Robust implementation ensures trades are executed accurately and strategically, enhancing automated trading precision.

πŸ‘‰ Read | Docs | Share!

#MQL5 #MT5 #AlgoTrading
πŸ‘23❀13✍3πŸ‘Œ2πŸ†1πŸ‘¨β€πŸ’»1
The Quarters Theory, developed by Ilian Yotov, segments significant price ranges into smaller segments for technical analysis. These segmentsβ€”defined by major whole numbers and subdivided into large and small quartersβ€”offer traders a structured way to identify support and resistance levels. Using MQL5, the "Quarters Drawer" script automates the visualization of these levels, simplifying identification of key market dynamics.

MQL5 implementation enables customization through input parameters, allowing traders to modify line styles, colors, and visibility of various quarters. The script's architecture adheres to strict coding standards, ensuring reliable performance. By marking major and intermediate levels on charts, it provides traders with a systematic framework to analyze price behavior, supporting efficient trading decisions.

πŸ‘‰ Read | Freelance | Share!

#MQL5 #MT5 #Strategy
πŸ‘22❀14⚑1πŸ‘Œ1πŸ‘¨β€πŸ’»1
Understanding data types and operators is crucial for MQL5 development. In strongly-typed languages like MQL5, operations can yield different outcomes based on data types. For instance, dividing integers results in an integer, potentially causing confusion for newcomers. Typecasting remedies this by converting integers to floating-point values, ensuring expected results. Furthermore, programmers must grasp integer representation in memory. The concept of bit width explains range limitations for data types, impacting operations and potential errors. Logical operators, evaluating conditions, complement arithmetic operations, providing a framework for understanding computational logic within the programming environment. Exploring these topics helps avoid common pitfalls.

πŸ‘‰ Read | VPS | Share!

#MQL5 #MT5 #Education
πŸ‘39❀15⚑2πŸ‘Œ2πŸ‘¨β€πŸ’»1
An EA has been developed to autonomously close BUY and SELL orders independently, using user-specified profit percentages tied to the account balance. This tool enables traders to establish distinct profit targets for both types of positions. By doing so, it manages each market side separately, concluding trades once their specific profit objectives are met. Furthermore, users can monitor individual BUY and SELL profits directly on the chart. This feature provides real-time visual feedback to effortlessly track trade performance, ensuring a more organized trading approach.

πŸ‘‰ Read | Forum | Share!

#MQL4 #MT4 #EA
πŸ‘31❀14⚑5πŸ†3πŸ‘Œ1πŸ‘¨β€πŸ’»1
Gann's Square of 9 remains a standout in market analysis for its geometric and numerical approach, offering insights into price levels and time cycles. We've outlined how to translate this historic tool into the digital age with an indicator for MetaTrader 5. This involves coding sophisticated algorithms in MQL5 to represent Gann's spiraling number sequence as a visual trading tool. The indicator aids in determining key support and resistance levels and relevant time intervals using dynamic price and time scales. Additionally, this digital adaptation captures the modern acceleration of market cycles, thus serving both experienced traders and newcomers seeking to integrate advanced technical analysis into their strategies.

πŸ‘‰ Read | Docs | Share!

#MQL5 #MT5 #AlgoTrading
❀42πŸ‘35😁3πŸ‘Œ3πŸ‘¨β€πŸ’»1
The ADXm (experiment) has been adapted for MetaTrader 4 following its initial setup in MetaTrader 5. Those interested in the details of its functionality and implementation should review the information provided in the MetaTrader 5 release. This adaptation aims to bring the features of the ADXm to MetaTrader 4, allowing users of this platform to leverage its capabilities. It is important for users to understand the background and application of this version to make effective use of it in their trading strategies. Reference to the original MetaTrader 5 information will provide valuable insights into utilizing this tool effectively.

πŸ‘‰ Read | Signals | Share!

#MQL4 #MT4 #ADXm
πŸ‘28❀9✍2πŸ‘¨β€πŸ’»2⚑1πŸ‘Œ1
Explore the Kalman filter's potential in algorithmic trading for forex markets. As a recursive estimator, it filters noise and predicts financial time series, aiding strategies like mean reversion. The article guides on implementing this filter in MetaTrader 5, comparing its effectiveness with moving averages. Through backtesting, it reveals how the Kalman filter and moving averages enhance mean-reversion strategies, offering unique insights for both traders and developers. Although not superior, the Kalman filter provides distinct filtering advantages, emphasizing its unique role in trading algorithm development. Delve into this advanced tool for refining trading strategies and boosting profitability.

πŸ‘‰ Read | Signals | Share!

#MQL5 #MT5 #AlgoTrading
πŸ‘24❀11πŸ‘Œ2πŸ‘¨β€πŸ’»1
The article outlines the development of an Expert Advisor for the Trend Flat Momentum Strategy using MQL5. This strategy uses a combination of moving averages and momentum indicators like RSI and CCI to identify market trends. Key steps include creating the strategy blueprint, implementing the logic, backtesting, and optimizing in MetaEditor.

Moving average crossover and momentum indicators serve to confirm buy or sell signals, with dynamic risk management for stop loss and take profit. Implementation focuses on accurate code structure and error handling, while also improving trade efficiency by refining pivot detection methods.

Backtesting ensures robustness, with optimizations addressing initial issues in swing point detection. The completed system provides structured entry and exit, although profitability isn't guaranteed without thorough testing.

πŸ‘‰ Read | Quotes | Share!

#MQL5 #MT5 #EA
πŸ‘35❀13πŸ†2πŸ‘Œ1πŸ‘¨β€πŸ’»1
Neural networks are often misunderstood. Despite their complexity, they fundamentally operate as advanced mathematical models, not as an independent intelligence. They process data by fitting it to equations, allowing them to classify new, similar datasets effectively. When data is unprocessed, neural networks go through a training phase to identify patterns.

In starting out with neural networks, one can illustrate key concepts using a single neuron. Initially, the neuron receives random data and computations begin with arbitrary values. The goal is to refine these values until the neuron can recognize patterns and produce accurate outputs. The weight and error calculations guide this learning process.

Incorporating secant lines within neural network algorithms is crucial here. The secant line helps the network directly address errors, facilitating accurat...

πŸ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #NeuralNet
πŸ‘42❀27⚑3πŸ‘Œ3πŸ‘¨β€πŸ’»3😁2πŸ€”2
The described indicator operates by examining a series of Simple Moving Averages (SMA) across a specified range of periods at each bar to identify the most recent bounce, either upward or downward. This process involves checking all SMA periods from a defined minimum to maximum range. If no discernible bounce is detected, the bar remains unaltered.

The main function of this tool is to assess market momentum. When both upper and lower lines contain values, this suggests potential range-bound market conditions. However, the requirement for significant computational resources is a notable challenge. Utilizing an extensive range of MA periods or switching to more complex moving average methods could lead to delays in the indicator's loading time. Once initialized, only the latest bar needs updating. Efficient computation is crucial for optimal performance.

πŸ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #Algorithm
❀19πŸ‘11πŸ‘¨β€πŸ’»5πŸŽ‰2⚑1✍1πŸ‘Œ1