Project Brief: Optimized & Modular RSI Divergence Detection Module (MQL5)

Specification


I am looking to develop a highly optimized and fully modular script in MQL5 specifically for detecting RSI Divergences. This script will serve as a foundational building block to be integrated into a larger, comprehensive Expert Advisor (EA) later. Therefore, execution speed, strict logic, and a clean codebase are my absolute top priorities.


Here are the core technical requirements for this project:

1. MQL5 Performance & Memory Management (Crucial):

Efficient Handle Creation: The RSI indicator handle must be strictly declared and initialized only once within the OnInit() function.

Optimized Data Retrieval: Use CopyBuffer() efficiently to fetch only the newly required data points per tick or per new bar.

Zero Memory Leaks: Under no circumstances should the indicator be re-called or recalculated from scratch on every OnTick(). The module must be extremely lightweight.

2. Customizable Divergence Selection (Important):

The algorithm must be capable of mathematically detecting BOTH Regular and Hidden divergences.

However, I require external input parameters (e.g., boolean variables like Enable_Regular_Div and Enable_Hidden_Div, or a dropdown Enum) that allow me to strictly control which signals are active and displayed. I must be able to select:

Only Regular Divergences

Only Hidden Divergences

Both simultaneously
This flexibility is critical for my backtesting and strategy optimization.

3. High-Efficiency Detection & Strict Confirmation:

Minimal Lag: The algorithm scanning for peaks and troughs must be mathematically optimized.

No Repainting: The divergence signals must be robust and definitively confirmed (e.g., strictly evaluated after the candle closes). Once a signal is printed or registered, it must not repaint or disappear.

4. Clean & Modular Architecture (Integration-Ready):

Encapsulation: The logic must be cleanly separated into modular functions or classes.

No Global Variable Conflicts: Avoid using loosely defined global variables that could clash when I include this .mqh file or logic into my master EA.

Clear Inputs: All customizable parameters (RSI Period, applied price, peak/trough lookback periods, and the divergence type toggles mentioned above) must be clearly defined as input variables.

5. Documentation:

Please include professional, brief comments explaining the core logic, especially around the loops used for identifying the historical pivots/fractals for the divergence.

Please review these requirements and let me know your approach to ensuring the code remains as fast and modular as requested.

Responded

1
Developer 1
Rating
(19)
Projects
24
38%
Arbitration
3
67% / 33%
Overdue
1
4%
Working
2
Developer 2
Rating
(2)
Projects
2
0%
Arbitration
0
Overdue
1
50%
Free
3
Developer 3
Rating
(5)
Projects
7
14%
Arbitration
3
33% / 0%
Overdue
0
Working
Published: 3 articles, 30 codes
4
Developer 4
Rating
(168)
Projects
201
48%
Arbitration
5
20% / 60%
Overdue
2
1%
Working
5
Developer 5
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
6
Developer 6
Rating
(574)
Projects
945
47%
Arbitration
309
58% / 27%
Overdue
125
13%
Free
7
Developer 7
Rating
(40)
Projects
43
58%
Arbitration
1
100% / 0%
Overdue
1
2%
Free
Published: 5 codes
8
Developer 8
Rating
(74)
Projects
84
64%
Arbitration
5
100% / 0%
Overdue
9
11%
Free
9
Developer 9
Rating
(6)
Projects
5
0%
Arbitration
3
33% / 67%
Overdue
2
40%
Working
10
Developer 10
Rating
(1)
Projects
1
0%
Arbitration
0
Overdue
0
Free
11
Developer 11
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
12
Developer 12
Rating
(362)
Projects
435
54%
Arbitration
21
52% / 14%
Overdue
30
7%
Loaded
13
Developer 13
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
14
Developer 14
Rating
(298)
Projects
477
40%
Arbitration
105
40% / 24%
Overdue
81
17%
Loaded
Published: 2 codes
15
Developer 15
Rating
Projects
1
0%
Arbitration
2
0% / 100%
Overdue
0
Free
16
Developer 16
Rating
(5)
Projects
6
50%
Arbitration
0
Overdue
1
17%
Free
17
Developer 17
Rating
(5)
Projects
9
11%
Arbitration
2
0% / 50%
Overdue
2
22%
Working
18
Developer 18
Rating
(2)
Projects
2
0%
Arbitration
0
Overdue
0
Free
Published: 1 code
19
Developer 19
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
20
Developer 20
Rating
(572)
Projects
664
32%
Arbitration
42
45% / 45%
Overdue
12
2%
Loaded
21
Developer 21
Rating
(1)
Projects
3
33%
Arbitration
0
Overdue
0
Working
22
Developer 22
Rating
(198)
Projects
254
20%
Arbitration
22
50% / 18%
Overdue
0
Loaded
23
Developer 23
Rating
(3)
Projects
3
0%
Arbitration
0
Overdue
0
Free
24
Developer 24
Rating
(271)
Projects
553
50%
Arbitration
57
40% / 37%
Overdue
227
41%
Working
25
Developer 25
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
Similar orders
Project Overview We have a highly optimized, production-ready custom cTrader cBot built for a fast-paced Renko breakout strategy (specifically trading XAUUSD/Gold). The core system architecture, structural mapping, and breakout logic are flawless. We are seeking an expert C# algorithmic developer for a targeted engagement to refine the execution mechanics and add an advanced trade management module. This is not a
SNIPER X AI 30 - 200 USD
I really need a developer Who can help me to create my SNIPER X AI - Elite AI Trading System Overview SNIPER X AI BOT is an AI-assisted trading system for Forex, Crypto, Stocks, Indices, and Gold. Currency: USD,RAND,KWD, POUND,EURO Core Features AI Scalping, Sniper Entries, Auto Buy/Sell, Smart Risk Management, Telegram Alerts, Mobile Monitoring, VPS Deployment. Supported Platforms MetaTrader 4, MetaTrader 5, Exness
Emmanuel bot 30 USD
No thank you just choose for me I need to be automatically buy and sell and take a profit only that is enough for me thank you so much my name is Emmanuel kabale
Limzy 30+ USD
//+------------------------------------------------------------------+ //| HighPerformanceEA.mq5 | //| Copyright 2026, AI Developer | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2026" #property link " https://www.mql5.com " #property version "1.00" #property strict //
I need an experienced MQL5 developer to build a professional XAUUSD scalping Expert Advisor. The trading logic is already fully defined and will be shared privately with selected developers. Requirements Fast execution suitable for scalping Dynamic lot sizing Strict risk management Clean and optimized MQL5 code Compatible with MetaTrader 5 Additional Rules No repainting logic No delayed execution Avoid duplicate
Prepare expert for xauusd live chart [ expert is not executing xauusd trades , just printing the logic on the chart ] . Deletion and cleaning code ( subject to if required ) . Integration of candles with present logic, Since expert is coming out from an arbitration subject : Before project start , review the code if it is clean and ready for the developer to continue with previous developer's technical debt -thereby
Hello, I am looking for an experienced developer who can build a professional EA suitable for long-term prop firm account passing and account management. I am NOT interested in risky strategies such as martingale, grid, or aggressive recovery systems. My main priorities are: very low and stable drawdown, strong and consistent risk management, strict news filter, long-term sustainability, realistic and stable monthly
Need a Profitable with a good trading system or strategy. would test the product first Looking for a professional MT5 Expert Advisor based on smart strategies. The EA should include session filters, risk management, trailing stop, multi-pair support, and low drawdown protection. I need a consistent, high-probability automated trading system optimized for long-term profitability and funded account compliance
Junior EA 30+ USD
1. EA for MT5, hedging allowed. 2. Entry: 50 EMA crosses 200 EMA on H1. Buy on bullish cross, sell on bearish. 3. SL: 100 pips, TP: 200 pips. No trailing stop. 4. Lot size: 0.01 fixed. Max 3 trades at once. 5. Trade only 08:00-18:00 GMT. No trades if spread > 20 points. 6. Inputs: EMA periods, SL, TP, lot size, start/end time
I need an experienced MQL5 developer to build a semi automated trading signal system for Gold (XAUUSD) on MT5. The system is NOT a martingale or grid EA. The goal is to build a clean rule based signal engine that detects high probability setups based on predefined strategy rules and sends trading alerts with optional pending order logic. Main Requirements: 1. Signal Generation - Buy and Sell signals - Buy Limit - Buy

Project information

Budget
80 - 120 USD
Deadline
to 5 day(s)