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 TEMPO method introduces an innovative approach to time series forecasting using pre-trained language models like GPT-2. It leverages the model's contextual understanding gained from language data to predict time sequences, transforming text into numerical codes for processing. The model's architecture is a single-layer design that simplifies implementation while maintaining robustness. The method segments time series into trend, seasonality, and residuals, converting them into embeddings suitable for language models. This decomposition happens independently for each univariate series without batch normalization, ensuring data comparability and reducing computational overhead. Instead of using a pre-trained model, a cross-attention block is trained with the main model.

πŸ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #AI
πŸ‘49❀24✍5πŸ‘¨β€πŸ’»3πŸ‘€3πŸ‘Œ1
The Expert Advisor discussed employs a straightforward trading strategy based on the DeMarker indicator. It opens 'BUY' positions when the indicator falls below the DeM: Level DOWN and 'SELL' positions when it exceeds DeM: Level UP. The default setting allows multiple open positions, disregarding current market stance. Transactions commence at each new bar without analyzing if the opening price is optimal.

Notably, the EA does not incorporate Stop Loss, Take Profit, or Trailing features; trades close only upon receiving an opposing signal and ensuring they generate a positive profit margin post-closure.

The trading setup includes selecting a working timeframe, controlling position sizes through fixed or percentage-based money management, and additional features like limiting to one market position or reversing signals. Log printing is available for compre...

πŸ‘‰ Read | AppStore | Share!

#MQL5 #MT5 #EA
πŸ‘40❀22πŸ‘¨β€πŸ’»5πŸ‘Œ3✍1
Using a refined trading strategy on MetaTrader 5, we can effectively reduce the frequency of being stopped out despite predicting market trends accurately. The core approach involves implementing a mean-reverting strategy combined with support and resistance levels. Rather than following conventional advice like widening stop lossesβ€”which increases inconsistent risk exposureβ€”we maintain fixed stop loss sizes for clarity and consistency. By employing neural network predictions of moving averages to assess potential price movements, our strategy filters potential losses. This method embraces a data-driven, systematic approach over subjective judgment, enhancing profitability and risk management in algorithmic trading.

πŸ‘‰ Read | Quotes | Share!

#MQL5 #MT5 #Trading
πŸ‘22❀9πŸ”₯5✍2πŸ‘¨β€πŸ’»2πŸ‘Œ1
Transformer-based architectures are revolutionizing multimodal time series forecasting with their ability to handle channel independence and channel mixing. The fusion of these approaches allows models to suppress noise and mitigate distribution drift while capturing high information capacity and channel specificity. The InjectTST method stands out by injecting global information into independent channels without explicit dependency modeling. This approach enhances forecasting accuracy by balancing noise suppression with channel-specific insights, utilizing a hybrid strategy of channel independence and mixing. Through advanced parallel processing and Transformer encoder use, InjectTST offers a robust solution for time series analysis, promising enhanced performance for traders and developers alike.

πŸ‘‰ Read | AlgoBook | Share!

#MQL5 #MT5 #Algorithm
πŸ‘22❀4πŸ”₯4⚑2πŸ‘Œ2πŸ‘¨β€πŸ’»1
In Part 8 of our series, attention shifts to the Butterfly harmonic pattern in MetaQuotes Language 5 (MQL5). This reversal setup uses Fibonacci ratios to identify market turning points, providing clear entry and exit signals. Developing an Expert Advisor (EA) that automates the detection and execution of these trades can enhance strategy effectiveness.

The Butterfly pattern consists of five key points: X, A, B, C, and D, forming specific bearish and bullish sequences. The EA identifies these patterns by calculating pivot points and employing Fibonacci retracements for precision.

Implementation involves setting global variables, leveraging the "Trade\Trade.mqh" library, and defining structures for trading execution. Visualization functions enhance pattern recognition on charts. OnTick event handling ensures efficient analysis of real-time data witho...

πŸ‘‰ Read | CodeBase | Share!

#MQL5 #MT5 #Strategy
πŸ‘27❀9πŸ‘¨β€πŸ’»3πŸ†2⚑1πŸ‘1πŸ‘Œ1
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