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 post delves into the development of a Price Action Analysis Toolkit featuring a pivotal tool called the ZigZag Analyzer. This innovative tool employs the ZigZag indicator to efficiently draw trend lines by identifying key swing points, a vital aspect of technical analysis across various markets. MetaTrader 5 developers will appreciate the flexibility of MQL5, allowing the creation of adaptive trading systems. The article provides detailed insights into the system’s algorithm, focusing on efficient resource handling, accurate trendline and support/resistance drawing, and real-time adaptability. This technical prowess leads to clear actionable market insights beneficial for traders aiming for precise analysis and decision-making.

πŸ‘‰ Read | NeuroBook | Share!

#MQL5 #MT5 #Trendline
❀29πŸ‘17πŸ‘€5πŸ€”3⚑2πŸ‘Œ2πŸ‘¨β€πŸ’»2
Value at Risk (VaR) is central to market risk management in algorithmic Forex trading. It provides quantifiable assessments of potential losses over time periods, key to navigating Forex's volatility. Development efforts in MetaTrader 5 emphasize transforming theoretical VaR concepts into practical tools, leveraging Python for efficient integration.

Controlling drawdowns and optimizing portfolio via VaR are integral parts of dynamic position management systems. Key challenges include balancing between minimizing risk and achieving target returns. Optimization involves adapting the system dynamically, accounting for market conditions and maximizing efficiency while ensuring capital protection.

VaR's flexibility extends to varied trading strategies, enhancing grid systems' performance. Improved by systematic modifications like local trend adjustments and gri...

πŸ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #VaR
πŸ‘17πŸ”₯12❀10⚑5πŸ‘¨β€πŸ’»3
Point clouds provide a flexible 3D data structure, bypassing the complexity of meshes. Typically, researchers convert point cloud data into 3D voxel grids for deep learning models, but this introduces artifacts and increased data size. PointNet offers a direct approach by utilizing raw point cloud data. This model leverages point data's permutation invariance via a symmetric MaxPooling function, enhancing efficiency. The architecture supports both classification and segmentation tasks, handling 3D transformations effectively.

Implementation in MQL5 involves a new PointNet class, leveraging convolutional layers for feature extraction. This facilitates efficient point cloud classification within trading algorithms, integrating environmental state analysis.

πŸ‘‰ Read | Docs | Share!

#MQL5 #MT5 #PointNet
πŸ‘45❀26πŸ”₯7✍3πŸ‘2πŸ€”2πŸ‘¨β€πŸ’»2
An emerging library now enables read/write access to ".tst" files, which adhere to the MT5-Tester single pass format. This development opens new potential for engaging with trading, automated systems, and strategy testing within the MetaTrader 5 platform, notably referenced since beta build 2155. The file format can transform Tester cache-folder data into market products like analyzers or correctors for Tester results. This approach allows the combination of single passes, showcasing combined statistics and cleaning cache data by eliminating unnecessary passes. Users can compute optimal portfolios with suitable weighting coefficients, determine best trading intervals, and utilize interactive statistical visualizations. Additional features include calculating optimal money management and evaluating hedge position efficiency based on historical data. Result...

πŸ‘‰ Read | Forum | Share!

#MQL5 #MT5 #MT5
πŸ‘20❀19πŸ‘¨β€πŸ’»4
MetaTrader 5 has been enhanced with a volumetric historical dataset of fundamental calendar events, available for programmatic access. This library streamlines data management, offering integration for both the Tester and live trading scenarios. Source code comments in example scripts demonstrate library functionality, aiding users in accessing historical data that parallels the native MT5 terminal display. Additionally, the library facilitates the acquisition of future event information, enriching Expert Advisors and indicators with timely updates on significant calendar events.

A featured Expert Advisor utilizes NonFarm Payroll data, analyzing present and forecast metrics for strategic trading. For historical data access, a single run in the MT5 terminal is required to download approximately 60MB, after which it's retrievable within the Tester. ...

πŸ‘‰ Read | Quotes | Share!

#MQL5 #MT5 #Calendar
❀17πŸ‘13πŸ‘¨β€πŸ’»5πŸ‘Œ3✍1
For Expert Advisor development within MetaTrader, handling the initiation of a new bar poses a unique challenge since there is no built-in OnNewBar() event. Instead, developers need to track the opening time of the most recent bar to identify changes that indicate a new bar has started. This approach is implemented by using a static variable within the OnTick() function to persist data about the bar's opening time across calls. This method ensures that even when OnTick() is exited, the variable retains its value, allowing the detection of a change in bar time. Special care should be taken when the EA is first attached to a chart, as the initial bar open detection will differ, needing adjusted logic. Code samples compatible with MQL4 and MQL5 are available in MetaEditor's "Public Projects" under "FMIC.

πŸ‘‰ Read | NeuroBook | Share!

#MQL5 #MT5 #EA
❀29πŸ‘14πŸ‘¨β€πŸ’»4✍1
A bot has been developed to detect the opening of new candles on any specified timeframe. This automation facilitates the execution of one-time operations like placing trades and invoking other functions. The main logic resides in the OnTick() function. Users can customize the PERIOD_CURRENT to match their desired timeframe for detecting new candle formations. This approach streamlines processes, reducing manual intervention and enhancing efficiency in trading environments. Adapt the timeframe settings based on specific requirements to optimize performance and meet trading objectives effectively.

πŸ‘‰ Read | Quotes | Share!

#MQL5 #MT5 #Bot
❀25πŸ‘12πŸ‘¨β€πŸ’»5πŸ”₯1πŸ‘Œ1πŸ†1πŸ‘€1
The Atmosphere Clouds Model Optimization (ACMO) algorithm is an innovative approach to solving optimization problems by mimicking the natural behavior of clouds. By creating a virtual environment where clouds form in areas of high humidity, the algorithm explores potential solutions akin to cloud formations in the sky. Clouds move through a defined search space, spreading and adapting to environmental conditions, thereby avoiding local optima. The algorithm leverages cloud generation in high-humidity regions and guides cloud movement toward lower pressure areas, promoting diverse solution exploration and convergence on global optima. This methodology offers valuable insights for developers and traders engaged in algorithmic trading.

πŸ‘‰ Read | Docs | Share!

#MQL5 #MT5 #Algorithm
πŸ‘25❀6πŸ†2πŸ‘¨β€πŸ’»2πŸ‘Ύ1
The article delves into the significance of compilation directives in MQL5, enhancing code simplicity, speed, and flexibility for algorithmic trading. These directives, akin to commands, guide more efficient coding and facilitate version control without losing previous iterations. The #include directive, prominently used, helps organize code into modular blocks or headers, simplifying maintenance and comprehension. By restructuring code into header files and using #include statements, developers can replicate complex functionality across projects with ease. This approach reduces error rates and improves compilation success, providing traders and developers a structured framework for creating scalable and efficient trading algorithms.

πŸ‘‰ Read | Quotes | Share!

#MQL5 #MT5 #Education
πŸ‘38❀17πŸ‘¨β€πŸ’»5✍3πŸ‘Œ1
Discussing a strategy for hedge accounts: an Expert Advisor operates by opening two opposing positions on USDJPY, H1. Key actions occur when both positions close via Stop Loss or Take Profit, promptly opening new opposing positions at the next bar. Parameters available are limited to Stop Loss and Take Profitβ€”trailing and indicators remain excluded. The approach applies strictly to hedge accounts, emphasizing simplicity in operation and risk management without additional trailing mechanisms or indicator reliance. The strategy is straightforward, promoting disciplined trading based on predetermined risk and reward levels. It supports methodical engagement in the USDJPY market with a clear focus on entry and exit conditions.

πŸ‘‰ Read | NeuroBook | Share!

#MQL5 #MT5 #EA
πŸ‘28❀19πŸ‘¨β€πŸ’»3🀯1
The first version of MA Trend has been developed, incorporating a new trading restriction type parameter. Users can specify whether only BUY, only SELL, or both BUY and SELL positions are allowed. The Expert Advisor leverages the iMA (Moving Average, MA) indicator for decision-making and includes various configurable settings. Noteworthy among these are:

1. Only one position - allows only one market position.
2. Reverse - flips trading signals.
3. Close opposite - closes opposing positions upon a new signal.

Default parameter configurations generate trading signals based on price comparisons with the MA indicator on bar #1. For instance, a BUY signal is triggered when the current ASK is higher than the indicator value, and a SELL signal when the BID is lower. When Only one position is enabled, and Close opposite is true, opposing positions are closed befor...

πŸ‘‰ Read | AlgoBook | Share!

#MQL5 #MT5 #EA
πŸ‘22❀16πŸ‘¨β€πŸ’»3✍1
A sliding line indicator using 4th-degree polynomial interpolation effectively models trends, while leveraging sine wave extrapolation for predictive purposes. The method removes one value per bar to construct a stable line, ensuring that the output remains consistent and free from redrawing issues. Key parameters include `line_power`, which governs the degree of extrapolation, and `leverage`, which adjusts the elimination process. The `multiplier` defines the point of removal from various sinusoid perspectives, offering flexibility in data modeling. `line4_SHIFT` manages shifts from the extrapolated values, and `interval` fine-tunes the method's averages. Further refinement is suggested by calculating differences.

πŸ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #Indicator
πŸ‘21❀12πŸ‘¨β€πŸ’»3
Running an Expert Advisor on multiple symbols in MT5 can be streamlined using the "All symbols selected in the Market Watch window" mode. This allows for consistent EA settings across different symbols, but managing numerous MT5-tester runs can become cumbersome. A specialized library facilitates this by allowing configuration of various combinations of symbols, timeframes, and intervals. This setup enables both single runs and optimization, including forward testing.

The library proves useful for researching symbol performance across different timeframes and evaluating the viability of auto-optimization for trading strategies. To utilize, configure MT5-Tester according to specifications. Optimizations, executed via full brute force on real ticks, can be set for the required symbols and timeframes.

The included MTTester.mqh file aids in managing MT5-tester pr...

πŸ‘‰ Read | NeuroBook | Share!

#MQL5 #MT5 #EA
πŸ‘19❀10πŸ‘¨β€πŸ’»7
The content describes a library with two display types: LabelsDisplay and CanvasDisplay. LabelsDisplay uses CChartObjectLabel while CanvasDisplay is based on CCanvas. Both are optimized for rendering frequency. Demo.mq5 demonstrates functionality, while CanvasVsLabelsTester.mq5 and CanvasVsLabels.mq5 measure performances in various environments. Methods include setText, push, and update, with LabelsDisplay offering an additional updateOne method for fast updates. Input parameters such as outType, nLines, and optimiseUpdate allow display customization. The outType parameter lets you select between Canvas or Labels, and nLines adjusts the line count retained after scrolling with the push method. OptimiseUpdate is for economical updating when the push method isn't called. Display width and text size adjustments are managed by bWidth and lY_Dist respectively. The bac...

πŸ‘‰ Read | NeuroBook | Share!

#MQL5 #MT5 #EA
πŸ‘20❀6πŸ‘¨β€πŸ’»5✍2
The Expert Advisor Utility enhances trading operations by providing a structured panel for managing positions efficiently. It organizes BUY and SELL positions in specific ordersβ€”ascending for BUY and price-based for SELL. The panel can display up to five positions from each category, facilitating clear visibility.

Users can select positions through intuitive checkboxes, enabling streamlined management. The utility offers three distinct actions for chosen positions. Firstly, removing the Take Profit level is possible for immediate flexibility. Secondly, users can set a new Take Profit value as defined by the input parameter, calculated from the opening price. Lastly, the utility allows setting the Take Profit to the Breakeven point, minimizing potential losses. This utility aims to offer precise control and efficiency in manual position handling.

πŸ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #EA
πŸ‘24❀11✍3πŸ‘¨β€πŸ’»2
An Expert Advisor utilizes two main indicators for trading: the Chaikin Oscillator (CHO) and a custom indicator known as CCIDualOnMA. CHO acts as a trend indicator and is instrumental in signaling the closing of positions when it crosses the zero threshold. Meanwhile, CCIDualOnMA serves as a filter for adding positions. These indicators operate on a predefined working timeframe, which also determines when a new bar appears.

Closing positions are prompted by the CHO indicator crossing zero. The system supports both reverse trading modes and cross-from-bottom/top scenarios, with conditions allowing either only BUY, only SELL, or both types of positions. Normal signals for adding a position are generated when the CHO and CCI conditions align as described.

The Expert Advisor offers robust options for optimization based on timeframes. Market entry is limited to ...

πŸ‘‰ Read | Freelance | Share!

#MQL5 #MT5 #Strategy
πŸ‘19❀4πŸŽ‰3πŸ‘¨β€πŸ’»2πŸ‘€2
The JavaScript version of the Report library offers significant performance improvements for handling MT4 style trading commands using MT4Orders or Virtual. It processes data up to 10 times faster compared to the traditional Report, with reduced NTML file sizes and capacity to display up to 5.4 million lines. The functionality mirrors that of Report, demonstrating trades from MT4, MT5, and their testers.

In MT5, report data is stored as an array, optimizing speed and reducing file size. JavaScript handles statistics computation, charting, and HTML code generation on the browser side. Paginator functionality aids navigation, and charts present deals on a time scale, offering insights into trading patterns.

A streamlined UI includes an interactive chart feature using Google or Highcharts, delivering zoom capabilities for in-depth analysis. Enhanced c...

πŸ‘‰ Read | Calendar | Share!

#MQL5 #MT5 #AlgoTrading
πŸ‘18❀7πŸ‘¨β€πŸ’»5πŸ†4
An indicator has been developed to calculate the angle between a trend line and the horizontal, where the X axis represents minute bars regardless of the timeframe, and the Y axis represents points. It is important to recognize that local minima or maxima on lower timeframes may not align with the start of bars on higher timeframes. This can result in minimal differences in indicator values across various timeframes. An alternative version of the indicator computes the average rate of price change in pips/minute. While the utility of these indicators is subjective, understanding their calculations and implications is crucial for effective implementation in trend analysis and decision-making. Further exploration of their application in different scenarios may yield variances in utility and effectiveness.

πŸ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #Indicator
πŸ‘26❀11πŸ‘¨β€πŸ’»4⚑1
This article delves into the world of portfolio-level statistical arbitrage, particularly focusing on simplifying this complex technique for the average retail trader. It outlines the core concepts of the market being in a continuous state of change and the enigma it presents, emphasizing that understanding and adapting to market dynamics is crucial for successful trading. The approach starts by building a simple pairs-trading portfolio using MetaTrader 5, focusing on tools like Python integration for historical price correlation. The method is accessible and cost-effective, allowing traders to begin experimenting with powerful trading strategies and gradually expanding their scope with more data and resources.

πŸ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #Algorithm
❀20πŸ‘9πŸ‘¨β€πŸ’»5⚑1
Depth of Market (DOM) is central to informed trading, showing pending limit orders that often remain unexecuted due to changing market conditions. Tracking DOM is straightforward using SymbolInfoInteger for order book depth, crucial for understanding liquidity without complex event handlers.

Generating a custom symbol enables DOM testing when live data isn't available. Using CloneSymbolTicksAndRates script, traders can replicate real symbols for simulated analysis, aiding order book event testing with custom data. This facilitates strategic testing despite live feed restrictions.

An indicator, developed using OOP principles, showcases market depth variations efficiently on the chart. It provides optimized visualization by displaying buy and sell histograms with customizable attributes, enhancing clarity and usability, crucial for traders relying on ...

πŸ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #Algorithm
πŸ‘14πŸ‘¨β€πŸ’»6❀3