Job finished
Specification
Platform: MT5 ==> With Source. Experienced Dev required. EA Written for Exness XAUUSD
Platform: MT5
Version: Final
1. System Overview
NovaShield EA is a Directional Trend Grid Trading System.
The EA trades in only one direction, determined exclusively by the EMA trend:
-
If price is above the 200 EMA → EA opens BUY-only trades
-
If price is below the 200 EMA → EA opens SELL-only trades
All modules—entries, martingale, pyramiding, break-even, trailing, and protection—must strictly follow this direction.
2. Indicator Filters
2.1 EMA Trend Filter (Directional Control)
Directional Rule:
2.2 RSI Filter
Used for additional entry filtering if RSI filtering is enabled.
2.3 EMA Distance Filter
If the price is farther than the allowed distance → no new trades.
3. Entry Logic
A new position is allowed only if ALL filters pass:
-
EMA direction filter
-
Spread filter
-
Time session filter
-
News filter
-
RSI filter (optional)
-
EMA distance filter (optional)
-
Anti-order-spam delay (developer must implement)
Initial Lot
4. Position Management Engines
NovaShield EA uses two engines, both strictly following the EMA direction:
-
Martingale Averaging Down Engine
-
Pyramiding Averaging Up Engine
4.1 Martingale Engine (Averaging Down)
Parameters
Three-Phase Lot Scaling
| Phase | Levels | Lot Multiplier |
|---|---|---|
| Phase 1 | Level 2–35 | ×1.1 |
| Phase 2 | Level 36–100 | ×1.0 |
| Phase 3 | Level 101+ | ×1.1 |
Martingale Condition
Note:
-
Pip calculation must adapt to symbol Digits (XAUUSD vs XAUUSDc).
-
EA must never open opposite-direction martingale.
4.2 Pyramiding Engine (Averaging Up)
Parameters
EnablePyramiding = true PyramidingTriggerPips = 30 PyramidingMultiplier = 1.0 PyramidingMaxOrders = 100
Pyramiding Condition
5. Safety & Protection Systems
5.1 Group Break-Even
When total floating profit ≥ Trigger →
Move SL of all positions to +10 pips.
5.2 Group Trailing Stop
When total floating profit ≥ 80 pips → activate group trailing.
5.3 Global Equity Protection (Cut-Loss Shield)
If account equity ≤ CutLossEquity:
→ Close ALL orders immediately
→ Block new entries until equity rises above threshold.
6. Trading Filters
6.1 Time Session Filter
Outside this window → no new trades.
6.2 Spread & Slippage Filter
If spread > MaxSpreadPips → block entry.
6.3 Leverage Filter
If account leverage < RequiredLeverage → block entry.
6.4 High-Impact News Filter
EnableNewsFilter = true PauseBeforeNewsHrs = 2 PauseAfterNewsHrs = 1
During the news lock window:
-
No new trades
-
No martingale
-
No pyramiding
-
Break-Even / Trailing / SL / Cut-Loss still active
News Source:
MQL5 built-in Economic Calendar (recommended)
7. Order Execution Flow (For Developer)
✅ Hidden Stop Loss (Stealth SL) – Technical Specification (Add-on)
Purpose
A hidden stop-loss system that closes trades internally without placing SL values on the server, preventing brokers from hunting visible stops.
Hidden SL Module – Parameters
Hidden SL – Operational Logic
Hidden SL should:
-
NOT set any visible SL on orders sent to the server.
→ All SL logic must be internal inside the EA. -
Continuously check floating loss:
If (Current Floating Loss in pips ≥ HiddenSL_Pips) → Close the individual position immediately
-
“Pips” must be calculated using the correct Digits of the symbol (XAUUSD vs XAUUSDc).
-
The module must work independently of:
-
Break-even
-
Trailing stop
-
Equity Cut Loss
-
Applies to every single order individually:
-
Should NOT trigger during:
-
News Lock
-
Time Filter lock
(because those filters block entries, not exits)
Hidden SL must always remain active to protect the account.
Hidden SL – Example Logic (Pseudocode)
for each order in Orders: profitPips = CalculatePips(order.open_price, current_price) if (EnableHiddenSL == true) if (profitPips <= -HiddenSL_Pips) CloseOrder(order)
Interaction With Other Modules
Works alongside:
-
Martingale Engine
-
Pyramiding Engine
-
EMA Direction filter
-
Group BE & Trailing
-
Equity Cut-Loss shield
Priority:
If multiple exit conditions trigger simultaneously:
-
Equity Cut Loss (highest priority)
-
Hidden SL
-
Group BE / Trailing Stop
-
Take Profit
Notes for Developer
-
Must NOT send SL to server.
-
Must NOT modify SL value through OrderModify.
-
Close trades only through internal logic.
-
Must avoid repeated close signals (add small cooldown per order).
-
Works on OnTick (recommended) or timer.
8. Developer Notes
-
Must handle pip/point calculations correctly depending on symbol Digits
-
Must implement retry logic for OrderSend/OrderModify errors
-
Must use SymbolInfo* functions (no deprecated MarketInfo)
-
Must prevent order spamming (minimum tick/time delay between trades)
-
Must ensure compatibility with real ticks & backtesting
-
All trade operations must strictly follow EMA directional filter