P
PipsGrowth
OtherOpen Source – Free

Pipsgrowth EX12033 MultiIndicatorConfluence

MT5 Expert Advisor (Open Source) · XAUUSD · M5, H1

Pipsgrowth.com EX12033 EA3 — DEMA/RSI confluence EA with PSAR trailing and fixed-lot management, full 12-layer stack.

Overview

Pipsgrowth EX12033 EA3 is the smallest, cleanest member of the MultiIndicatorConfluence family built directly on MetaTrader's standard CExpert base class. Where most EAs in this family hand-roll their own signal engine in OnTick, EX12033 leans entirely on the wizard-generated CExpertSignal/CExpertSignal filter pattern: two indicator filters contribute a strength score on every bar, the platform sums the weighted scores, and a position opens when the combined direction crosses the configured threshold. There is no custom multi-timeframe matrix, no Kelly-style position scaling, no news filter. What the .mq5 actually contains is 335 lines organised around four input groups and three retry helpers — a deliberately lean implementation meant to be a portable starting point rather than a fully opinionated system.

The signal stack is two filters, both running on the chart timeframe. The first is a Double Exponential Moving Average with period 12, applied to the close, weighted 1.0; the second is an 8-period Relative Strength Index on the close, also weighted 1.0. Each filter returns a per-bar direction vote in the -100 to +100 range that the standard MQL5 SignalDEMA and SignalRSI classes are designed to produce. CExpertSignal aggregates those votes: a long is opened when the aggregate strength reaches or exceeds Signal_ThresholdOpen (default 10), and a short is opened when the aggregate strength is ≤-10. The same threshold gate is mirrored for exits in Signal_ThresholdClose (default 10). Because both filters carry the same weight, the threshold of 10 in practice requires at least one filter to be confidently directional — a setup in which both filters disagree tends to fall short of 10 in absolute value and produces no entry. The 8-period RSI is unusually fast; in combination with a 12-period DEMA this EA reacts to short-term momentum shifts, not the slower regime changes a 70/290 EMA pair would highlight.

Risk on the open is governed by Signal_StopLevel and Signal_TakeLevel, both defaulted to 50 points. With XAUUSD on a 2-decimal broker those 50 points are 5 pips; on a 3-decimal broker they are 0.5 pip. The 1:1 reward-to-risk ratio is intentionally narrow — it reflects the EA's short-horizon view. A wider stop would not help here because the position is expected to either work quickly (the 1:1 TP fires) or to be ratcheted out by the trailing stop before the SL is ever tested. The pending-order mechanism (Signal_PriceLevel, Signal_Expiration=4 bars) is wired through CExpert but disabled at the default PriceLevel=0.0; if a trader sets PriceLevel to a non-zero value, the EA will route signals through limit/stop pending orders with a 4-bar expiry instead of firing market orders directly.

Position management uses CTrailingPSAR, the standard Parabolic SAR trailing class. Step defaults to 0.02 and Maximum to 0.2 — the textbook values for a SAR applied to a 4–5 digit broker, fast enough to lock profits within a few bars of an SAR flip. Because Parabolic SAR trailing operates on the SAR dot, the stop only ever moves in the trade's favour, never backwards. On XAUUSD M5 this means a tight ratchet: as soon as price extends by roughly 0.02 * ATR beyond the most recent SAR dot, the new SAR dot becomes the new stop. Combined with the 1:1 fixed TP, most profitable trades close either on the TP fill or the PSAR trail, with very few hitting a true SL. Money management is delegated to CMoneyFixedLot: the trade size is 0.1 lot by default, and Money_FixLot_Percent (10.0) is the platform's margin-percent clamp that caps the notional relative to free margin — it does not size the lot dynamically. To change position size the trader changes Money_FixLot_Lots directly.

The header describes a 12-layer stack (REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester) but in the source code the actual wired layers are SIGNAL, SIZING, MANAGE and EXIT — six of the twelve are placeholders. There is no regime classifier, no news filter, no scaling-in, no OnTester formula, no equity cap. This is worth knowing up front: a backtest will look like a pure DEMA+RSI crossover system with PSAR trailing, and that is exactly what the strategy is. Anyone who wants regime detection, news avoidance, or scaling-in should look at the heavier MultiIndicatorConfluence variants in this family (e.g. EX12010's Ehlers Gaussian or EX12020's directional grid).

Symbol and timeframe portability is one of EX12033's strengths. The CExpert framework abstracts the symbol away: the only symbol-specific code is Symbol() in OnInit. The DEMA(12) and RSI(8) parameters that work on a 2-decimal gold feed will need different point interpretations on EURUSD (50 points = 0.5 pip) or USDJPY (50 points ≈ 5 pips on a 3-digit broker), so the trader is responsible for scaling Signal_StopLevel and Signal_TakeLevel when moving the EA across symbol classes. Timeframes M5 through H1 are the suggested range — lower than M5 and the 8-period RSI starts to lose its meaning; higher than H1 and the 12-period DEMA becomes too smoothed for the threshold-10 logic to fire often enough.

The three helper functions at the bottom of the file — TryClose_EX12033, TryClosePartial_EX12033, TryModify_EX12033 — wrap a CTrade object with up to 3 retries and 100–200 ms sleeps on the standard transient retcodes (REQUOTE, TIMEOUT, PRICE_OFF, PRICE_CHANGED). TryModify uses a tighter retcode set (REQUOTE/TIMEOUT only) than TryClose (which includes PRICE_OFF and PRICE_CHANGED), reflecting that a price-change rejection on a modify is usually a broker-quote issue, not a transient one. The trade wrappers are not invoked from the EA's main path (the CExpert framework calls the trade object directly); they exist as drop-in helpers for any custom modification a developer wants to add later.

In backtest this EA is a fast-cycle DEMA/RSI system: many small trades, frequent PSAR flips, a 1:1 RR that wins roughly as often as the underlying signal quality. The lack of regime filter means it will trade in both trending and ranging markets; on a tight range it will whipsaw around SAR flips. Traders who see a flat or sideways backtest curve should not be surprised — that is the EA's natural behaviour with these parameters. To reduce whipsaw, raise Signal_ThresholdOpen to 20 or 30 (forcing stronger filter agreement), increase the DEMA period from 12 to 18 or 21, or push the SAR step from 0.02 to 0.03 for a slower ratchet.

Strategy Deep Dive

On every tick, the CExpert framework calls SignalDEMA and SignalRSI on the chart timeframe; each filter returns a -100..+100 direction score weighted by Signal_DEMA_Weight=1.0 and Signal_RSI_Weight=1.0. CExpertSignal sums those scores and compares the aggregate against Signal_ThresholdOpen=10 (entry) and Signal_ThresholdClose=10 (exit). When the threshold is crossed, the trade object (CMoneyFixedLot, default 0.1 lot) opens at market or routes through a 4-bar-expiry pending order if Signal_PriceLevel is non-zero. Once a position exists, CTrailingPSAR with step 0.02 / max 0.2 ratchets the stop behind the SAR dot every bar the SAR flips; the 50/50 fixed SL and TP act as outer guard rails. The three TryClose/TryClosePartial/TryModify helpers wrap a CTrade object with 3 retries at 100–200 ms sleeps on the standard transient retcodes (TryModify skips PRICE_OFF/PRICE_CHANGED that TryClose accepts), but they are not invoked from the main CExpert path — they exist as drop-in helpers for any custom modification a developer might add. The header claims a 12-layer stack; in code only SIGNAL, SIZING, MANAGE and EXIT are wired — no regime filter, no news filter, no scaling-in, no OnTester formula.

Entry Signal

EX12033 opens a long when the CExpertSignal aggregate of DEMA(12) and RSI(8) per-bar strength votes reaches or exceeds Signal_ThresholdOpen=10 (with both filters weighted 1.0 by default), and a short when the aggregate falls to or below -10. Price level, expiration, and signal weight per filter are all configurable; a non-zero Signal_PriceLevel routes entries through 4-bar-expiry pending orders instead of market orders.

Exit Signal

Exits trigger on the same DEMA+RSI aggregate crossing the Signal_ThresholdClose=-10/+10 boundary in the opposite direction, on a Parabolic SAR trailing flip that pulls the stop past the entry, on the 50-point TP fill, or on the 50-point SL fill. PSAR trailing is the dominant exit in trending moves because it ratchets the stop behind the SAR dot before the fixed SL is ever tested.

Stop Loss

Hard SL is fixed at Signal_StopLevel=50.0 points (5 pips on a 2-decimal XAUUSD quote, 0.5 pip on a 3-decimal broker), symmetric with the TP. Parabolic SAR trailing ratchets the stop tighter as the trade moves in favour — a 0.02 step / 0.2 max SAR is the default — so the effective SL in live trading is usually the SAR dot, not the original 50-point level.

Take Profit

Fixed TP at Signal_TakeLevel=50.0 points, equal to the SL — a deliberate 1:1 R:R. Because the TP distance matches the SL distance, the strategy's expectancy is driven entirely by the signal hit-rate above 50%, not by any asymmetric payoff. PSAR trail typically closes the position before the 50-point TP fires when the move is strong.

Best For

Best deployed on XAUUSD M5 with a low-spread ECN broker (the 50-point SL/TP translates to roughly 5 pips on a 2-decimal gold quote and a wide spread eats the edge); M15 and H1 also work for slower cycles. Minimum recommended balance is $100 with the default 0.1 lot; raise Money_FixLot_Lots cautiously because there is no equity cap or risk-percent sizing in the code. Because the 8-period RSI is fast and the 1:1 RR is tight, this EA suits traders who want a small, transparent CExpert-based system to study the framework, not a black-box portfolio piece — expect frequent small trades, a 1:1 payoff, and visible PSAR flips on the chart as the primary exit driver.

Strategy Logic

Pipsgrowth EX12033 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)

Family: MultiIndicatorConfluence Magic: 22212033 Version: 2.00

BRIEF: Wizard-generated EA combining DEMA and RSI signals with the standard CExpert framework. Uses Parabolic SAR trailing and fixed-lot money management with threshold-based entry/exit logic for multi-indicator confluence trading. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester

INDICATOR STACK:

  • Standard MT5 indicators

KEY FUNCTIONS:

  • OnTrade()
  • OnTimer()
  • TryClose_EX12033()
  • TryClosePartial_EX12033()
  • TryModify_EX12033()

INTERNAL CONSTANTS (0 total):

INPUT PARAMETERS (19 total across 4 groups):

  • [=== Identity ===] Expert_Title = "EA3" // Document name
  • [=== Identity ===] InpTradeComment = "Psgrowth.com Expert_12033" // Trade comment
  • [=== Signal ===] Signal_ThresholdOpen = 10 // Signal threshold value to open [0...100]
  • [=== Signal ===] Signal_ThresholdClose = 10 // Signal threshold value to close [0...100]
  • [=== Signal ===] Signal_PriceLevel = 0.0 // Price level to execute a deal
  • [=== Signal ===] Signal_StopLevel = 50.0 // Stop Loss level (in points)
  • [=== Signal ===] Signal_TakeLevel = 50.0 // Take Profit level (in points)
  • [=== Signal ===] Signal_Expiration = 4 // Expiration of pending orders (in bars)
  • [=== Signal ===] Signal_DEMA_PeriodMA = 12 // Double Exponential Moving Average Period of averaging
  • [=== Signal ===] Signal_DEMA_Shift = 0 // Double Exponential Moving Average Time shift
  • [=== Signal ===] Signal_DEMA_Applied = 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Double Exponential Moving Average Prices series
  • [=== Signal ===] Signal_DEMA_Weight = 1.0 // Double Exponential Moving Average Weight [0...1.0]
  • [=== Signal ===] Signal_RSI_PeriodRSI = 8 // Relative Strength Index(8,...) Period of calculation
  • [=== Signal ===] Signal_RSI_Applied = 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Relative Strength Index(8,...) Prices series
  • [=== Signal ===] Signal_RSI_Weight = 1.0 // Relative Strength Index(8,...) Weight [0...1.0]
  • [=== Manage ===] Trailing_ParabolicSAR_Step = 0.02 // Speed increment
  • [=== Manage ===] Trailing_ParabolicSAR_Maximum = 0.2 // Maximum rate
  • [=== Sizing ===] Money_FixLot_Percent = 10.0 // Percent
  • [=== Sizing ===] Money_FixLot_Lots = 0.1 // Fixed volume
Pseudocode
// Pipsgrowth EX12033 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Wizard-generated EA combining DEMA and RSI signals with the standard CExpert framework. Uses Parabolic SAR trailing and fixed-lot money management with threshold-based entry/exit logic for multi-indicator confluence trading. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester

ON_INIT:
    Create indicator handles: standard set
    Initialize state variables
    Detect broker GMT offset

ON_TICK:
    1. Refresh indicator buffers (closed-bar shift=1)
    2. Manage existing positions:
       - Break-even check
       - ATR trailing stop
       - Profit lock ratchet
       - Time-based exit
       - Opposite-signal exit
    3. If new bar:
       a. ClassifyRegime() — ADX/ATR/BB regime detection
       b. NoTradeGate() checks:
          - Market open + session filter
          - Spread limit
          - Cooldown after loss
          - Consecutive loss limit
          - Kill switch
          - Max drawdown
          - Max concurrent positions
          - Daily/weekly loss limits
       c. GenerateSignal() — strategy-specific entry logic
       d. CheckConfirm() — HTF alignment + R:R + ADX minimum
       e. Calculate position size from risk %
       f. Execute with retry logic
       g. Mark bar to prevent duplicates

ON_TESTER:
    Custom fitness = weighted(RecoveryFactor, ROI, ProfitFactor, TradeCount, Sharpe, Drawdown)

Optimization Profile

Optimized Brokers:
ExnessIC Markets
Optimized Symbols:
XAUUSD
Optimized Timeframes:
M5H1

How to Install This EA on MT5

  1. 1Download the .mq5 file using the button above
  2. 2Open MetaTrader 5 on your computer
  3. 3Click File → Open Data Folder in the top menu
  4. 4Navigate to MQL5 → Experts and paste the .mq5 file there
  5. 5In MT5, right-click Expert Advisors in the Navigator panel → Refresh
  6. 6Drag the EA onto a chart matching the recommended timeframe
  7. 7Configure parameters according to the table on this page
  8. 8Enable Allow Algo Trading and click OK

EA Parameters

ParameterDefaultDescription
Expert_Title"EA3"Document name
InpTradeComment"Psgrowth.com Expert_12033"Trade comment
Signal_ThresholdOpen10Signal threshold value to open [0...100]
Signal_ThresholdClose10Signal threshold value to close [0...100]
Signal_PriceLevel0.0Price level to execute a deal
Signal_StopLevel50.0Stop Loss level (in points)
Signal_TakeLevel50.0Take Profit level (in points)
Signal_Expiration4Expiration of pending orders (in bars)
Signal_DEMA_PeriodMA12Double Exponential Moving Average Period of averaging
Signal_DEMA_Shift0Double Exponential Moving Average Time shift
Signal_DEMA_Applied1Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Double Exponential Moving Average Prices series
Signal_DEMA_Weight1.0Double Exponential Moving Average Weight [0...1.0]
Signal_RSI_PeriodRSI8Relative Strength Index(8,...) Period of calculation
Signal_RSI_Applied1Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Relative Strength Index(8,...) Prices series
Signal_RSI_Weight1.0Relative Strength Index(8,...) Weight [0...1.0]
Trailing_ParabolicSAR_Step0.02Speed increment
Trailing_ParabolicSAR_Maximum0.2Maximum rate
Money_FixLot_Percent10.0Percent
Money_FixLot_Lots0.1Fixed volume
Source Code (.mq5)Open Source
Pipsgrowth_com_EX12033.mq5
#property copyright "Pipsgrowth.com"
#property link      "https://pipsgrowth.com"
#property version   "2.00"
#property strict
#property description "Pipsgrowth.com EX12033 EA3 — DEMA/RSI confluence EA with PSAR trailing and fixed-lot management, full 12-layer stack."
#include <Expert\Expert.mqh>
//--- available signals
#include <Expert\Signal\SignalDEMA.mqh>
#include <Expert\Signal\SignalRSI.mqh>
//--- available trailing
#include <Expert\Trailing\TrailingParabolicSAR.mqh>
//--- available money management
#include <Expert\Money\MoneyFixedLot.mqh>
//+------------------------------------------------------------------+
//| Inputs                                                           |
//+------------------------------------------------------------------+
//--- inputs for expert
ENUM_APPLIED_PRICE MapAppliedPriceInt(int ap)
{
   switch(ap)
   {
      case 1: return PRICE_CLOSE;
      case 2: return PRICE_OPEN;
      case 3: return PRICE_HIGH;
      case 4: return PRICE_LOW;
      case 5: return PRICE_MEDIAN;
      case 6: return PRICE_TYPICAL;
      case 7: return PRICE_WEIGHTED;
      default: return PRICE_CLOSE;
   }
}
ENUM_APPLIED_PRICE g_Signal_DEMA_Applied = PRICE_CLOSE;
ENUM_APPLIED_PRICE g_Signal_RSI_Applied = PRICE_CLOSE;
input group "=== Identity ==="
input string             Expert_Title                 ="EA3";       // Document name
input string             InpTradeComment              ="Psgrowth.com Expert_12033"; // Trade comment
ulong                    Expert_MagicNumber           =22212033;    // Magic number
bool                     Expert_EveryTick             =false;       // Process every tick
//--- inputs for main signal
ENUM_APPLIED_PRICE MapAppliedPriceInt(int ap)
{
   switch(ap)
   {
      case 1: return PRICE_CLOSE;
      case 2: return PRICE_OPEN;
      case 3: return PRICE_HIGH;
      case 4: return PRICE_LOW;
      case 5: return PRICE_MEDIAN;
      case 6: return PRICE_TYPICAL;
      case 7: return PRICE_WEIGHTED;
      default: return PRICE_CLOSE;
   }
}
ENUM_APPLIED_PRICE g_Signal_DEMA_Applied = PRICE_CLOSE;
ENUM_APPLIED_PRICE g_Signal_RSI_Applied = PRICE_CLOSE;
input group "=== Signal ==="
input int                Signal_ThresholdOpen         =10;          // Signal threshold value to open [0...100]
input int                Signal_ThresholdClose        =10;          // Signal threshold value to close [0...100]
input double             Signal_PriceLevel            =0.0;         // Price level to execute a deal
input double             Signal_StopLevel             =50.0;        // Stop Loss level (in points)

Full source code available on download

Educational purposes only. Do NOT use with real money. Test on demo accounts only.

Tags:ex12033multiindicatorconfluencepipsgrowthfreemt5xauusd

Clear Warning: Educational Purposes Only

Clear Warning: This Expert Advisor is for educational and testing purposes only. Do NOT use it with real money. Test only on demo accounts. Trading with real money involves substantial risk of capital loss. This does not constitute investment advice.

Recommended Brokers for This EA

These EAs run on MT5 — use a regulated broker with fast execution and tight spreads

Community

Sign in to contributeSign In

Educational purposes only. Do NOT use with real money. Test on demo accounts only.

File NamePipsgrowth_com_EX12033.mq5
File Size13.5 KB
Versionv2.00
PlatformMetaTrader 5
File Type.mq5 Source
StrategyOther
Risk LevelMedium Risk
Timeframes
M5H1
Currency Pairs
XAUUSD
Min. Deposit$100