Advanced Matrix Gamma Multi-Mode High-Frequency Scalper EA (XAUUSD S2 - Every Tick)

MQL5 Experts

Specification

Title: Advanced Matrix Gamma Multi-Mode High-Frequency Scalper EA with Tiered Volume Panel (XAUUSD S2 - Every Tick)

Description:
I need a highly skilled MQL5 expert developer to build a high-performance, object-oriented multi-mode high-frequency range-scalping Expert Advisor (EA) optimized for XAUUSD. This EA will be loaded onto a custom 2-Second offline chart (XAUUSD_S2) generated by Second Chart MT5, operating strictly under Every Tick execution mode. This configuration utilizes a dynamic dual-exit engine ("Matrix Gamma") to seamlessly transition between high-velocity channel scalping and macro trend-riding, fully integrated with an institution-grade Tiered Capital Volume Panel. All indicator parameters must be fully externalized into input variables. Default source code settings must strictly use placeholder mock parameters (e.g., 15, 10, 5) to guarantee strict proprietary logic privacy.

Technical Requirements & Infrastructure Safeguards:
1. [OnInit Handle Memory Anchor Lock]: Declare all indicator variables globally. Initialize all iStochastic handles strictly inside OnInit() to prevent dynamic memory overflow on live streaming server environments. The underlying indicator modules must support massive slow line periods smoothly without generating malformed EMPTY_VALUE calculation errors under heavy market volatility.
2. [Dynamic History Warm-Up & Data-Readiness Barrier]: To handle custom offline chart historical data initialization on startup, implement a rigid verification block: if the chart's total bar count is lower than Min_History_Bars (set to 150) or if Indicator buffers return EMPTY_VALUE, the EA must 100% force an immediate return and freeze all OrderSend loops to avoid erroneous market entries during data cache syncing.
3. [Dual-Mode Execution & Position Rolling Engine]:
The EA maps 3 macro filters (Filter_Alpha, Filter_Beta, Filter_Gamma) and 1 micro scalping sniper variable via direct CopyBuffer mapping. The trading architecture must execute strictly based on the following multi-mode logic switches:
- MODE A (Flat Channel Scalping): When macro filters (Filter_Alpha & Filter_Beta) walk flat inside the consolidation zone (between 30 and 70), the high-frequency radar activates. Long entries trigger at the channel floor (<20) with Hardcoded Comment "戰神黃牛多"; short entries trigger at the channel ceiling (>80) with Hardcoded Comment "戰神黃牛空". These positions must execute dynamic [Rolling Take Profit]—instantly closing the active scalp position when the price hits the Channel Pivot Mid-line (Pivot_Gamma), immediately clearing the execution slot for the next retracement wave.
- MODE B (Macro Trend Breakout Mutation): If macro filters (Filter_Alpha & Filter_Beta) break out and pin hard inside the ultra-strong momentum zones (>80 for Longs, <20 for Shorts), the EA must instantly [Physically Deactivate the Mid-line Take Profit] for the initial primary position. The first order transitions into a Trend-Rider, deploying a robust Trailing Stop engine to extract maximum points.
4. [Spread-Adaptive Minimum Retracement Filter]:
To eliminate low-yield over-trading, integrate a spatial matrix filter block: [Min_Retracement_Pips = 150]. When the micro sniper pulls back to trigger an entry, the EA must algorithmically calculate the distance between the current price and the local peak high/low wave. If the retracement distance is shorter than 150 pips (adjustable), the lower-tier scalp execution pipe must be 100% forced deactivated to prevent negative spread erosion.
5. [Multi-Trigger Audio Alert Interface with Timestamp Debounce Lock]:
Integrate a native MT5 audio Alert() pop-up engine. The EA must generate a clean audio notification alert whenever Filter_Alpha golden-crosses Filter_Beta, and when Micro_Sniper crosses user-defined adjustable boundaries (Alert_High = 80 and Alert_Low = 20). 
- **CRITICAL ANTI-CHATTERING GUARD**: To prevent terminal thread crash and infinite sound loop hanging under high-velocity tick streaming, you MUST hardcode a strict Timestamp Debounce Lock via Global Datetime Tracking variable (Last_Alert_Time). Implement an adjustable [Alert_Cooldown_Seconds = 60] parameter panel variable. Once an audio alert is executed, force an immediate absolute 60-second cooldown block, rejecting all subsequent Alert() triggers until the countdown completely clearing to zero. 
6. [Dynamic Equity Tiered Capital Volume Panel]:
To guarantee 100% stable broker volume step execution and seamless compounding scaling, the initial order lot size sizing MUST dynamically adjust according to three user-defined fully customizable account equity tiers fetched via AccountInfoDouble(ACCOUNT_EQUITY). Lot sizing rules must follow this precise multi-tiered dashboard logic:
- If current Account Equity is between Tier_1_Min_Equity and Tier_2_Min_Equity ➔ Use Base_Lots_Tier1 sizing.
- If current Account Equity is between Tier_2_Min_Equity and Tier_3_Min_Equity ➔ Use Base_Lots_Tier2 sizing.
- If current Account Equity is greater than Tier_3_Min_Equity ➔ Use Base_Lots_Tier3 sizing.
7. [Max Cap Barrier & Friday weekend purge Protection]: 
- Hardcode a strict system capacity ceiling variable: [Max_Total_Positions = 3]. Once the combined total of active market positions reaches 3, the OrderSend pipeline must completely shut down regardless of indicator states.
- Auto-liquidate all open range scalp orders cleanly when broker server time reaches Friday 18:00 (user-adjustable via inputs), halting execution loops completely to ensure empty positions over the weekend close.

==================================================
REQUIRED EXTERNAL INPUT FACELIFT PANEL:
==================================================
input group "======== Dynamic Equity Tiered Capital Volume Panel ========"
input double Tier_1_Min_Equity   = 100000.00; // Customizable boundary for Tier 1 Capital
input double Base_Lots_Tier1     = 0.3;       // Base high-frequency lot size for Tier 1
input double Tier_2_Min_Equity   = 180000.00; // Customizable boundary for Tier 2 Capital (e.g., 180k)
input double Base_Lots_Tier2     = 0.5;       // Expanded lot size for Tier 2
input double Tier_3_Min_Equity   = 320000.00; // Customizable boundary for Tier 3 Capital (e.g., 320k)
input double Base_Lots_Tier3     = 1.0;       // Maximum institutional lot size for Tier 3

input group "======== System Rigidity Execution Panel ========"
input int    Input_Slippage      = 3;     // Max allowable slippage points
input int    Max_Total_Positions = 3;     // Rigid structural capacity barrier
input int    Min_Retracement_Pips = 150;  // Spatial filter to eliminate small noise

input group "======== Matrix Logic Control Panel (Mock Placeholder Values) ========"
input int Filter_Alpha   = 15; // Mock Value for Macro Filter Anchor 1
input int Filter_Beta    = 10; // Mock Value for Macro Filter Anchor 2
input int Filter_Gamma   = 8;  // Mock Value for Macro Filter Anchor 3
input int Pivot_Gamma    = 5;  // Mock Value for Channel Pivot Mid-line
input int Micro_Sniper   = 2;  // Mock Value for High-Freq Scalp sniper

input group "======== Adjustable Audio Interface ========"
input int Alert_High     = 80; // Customizable upper ceiling alert boundary
input int Alert_Low      = 20; // Customizable lower floor alert boundary
input int Alert_Cooldown_Seconds = 60; // Rigid structural cooldown timestamp block

input group "======== Time & Cache Switch ========"
input int Friday_Close_Hour = 18; 
input int Friday_Close_Min  = 0;  
input int Min_History_Bars  = 150; // Safety barrier for 2-Second historical data warm-up

Responded

1
Developer 1
Rating
(262)
Projects
328
29%
Arbitration
36
25% / 61%
Overdue
10
3%
Loaded
2
Developer 2
Rating
(12)
Projects
16
25%
Arbitration
1
0% / 0%
Overdue
4
25%
Working
3
Developer 3
Rating
(1)
Projects
2
0%
Arbitration
0
Overdue
0
Free
4
Developer 4
Rating
(7)
Projects
7
29%
Arbitration
3
0% / 100%
Overdue
1
14%
Free

Project information

Budget
150+ USD
Deadline
to 3 day(s)

Customer

(1)
Placed orders2
Arbitrage count0