P
PipsGrowth
OtherOpen Source – Free

Pipsgrowth EX12080 MultiIndicatorConfluence

MT5 Expert Advisor (Open Source) · XAUUSD · M1

Pipsgrowth.com EX12080 ic_gold — Multi-indicator confluence gold scalper, full 12-layer stack.

Overview

Pipsgrowth EX12080 runs as a strict, all-or-nothing multi-indicator confluence engine on XAUUSD M1. It is not a scoring system and it does not count votes — the moment any one of the seven enabled filters fails to clear, the trade is rejected. The default config has every filter on, which means the EA will only fire when Heiken Ashi color, the EMA-8/21/50 ribbon, RSI(14), MACD(12,26,9), tick-volume spike, Bollinger Band width expansion, and an inline SuperTrend all agree on direction. Every one of those gates is independently togglable, so the operator can thin the stack down to a one-filter pass-through or stack it up to full confluence, but the binary verdict at the end of the chain never changes: requiredCount is incremented when a filter is enabled, passCount is incremented when its condition holds, and the entry is allowed only if passCount == requiredCount. There is no weighted scoring, no confidence output, and no per-filter precedence — the gate is a logical AND across whatever is enabled.

The signal stack pulls from eight native indicator handles created in OnInit: iATR(14) for both the SL/TP distance and the inline SuperTrend, three iMA handles (8/21/50 EMA ribbon on PRICE_CLOSE), iBands(20, 2.0) for squeeze expansion, iRSI(14), iMACD(12,26,9), and iVolumes on VOLUME_TICK. The SuperTrend is not loaded as an indicator — UpdateSuperTrend() recomputes it every tick from ATR plus the current high/low: the upper band is hl2 + InpSuperTrendMult(3.0) * atr, the lower band is hl2 - 3.0 * atr, and superTrendDir becomes 1 when close is above the upper band and -1 when close is below the lower band. This keeps the indicator footprint light (8 handles, not 9) and makes the multiplier and ATR period directly editable in inputs.

For a long entry, every enabled check must hold: the Heiken Ashi approximation (haClose = average of open/close/high/low > haOpen = average of prior open/close) is bullish, EMA-8 > EMA-21 > EMA-50 in strict ascending order, RSI(14) > 55, MACD main line above its signal and above zero, current tick volume > 1.5x the 20-bar average, the current Bollinger width (upper - lower) is wider than the previous bar's width (squeeze-to-expansion), and superTrendDir == 1. Sell is the mirror: haClose < haOpen, EMA-8 < EMA-21 < EMA-50, RSI < 45, MACD main below signal and below zero, volume spike still required, BB still expanding, superTrendDir == -1. The asymmetric RSI thresholds (55/45 instead of 50/50) push entries away from the midline noise and into confirmed momentum, while the MACD above/below zero requirement filters out counter-trend crossovers happening on the wrong side of the histogram.

OnTick is layered defensively. It calls UpdateDailyStats() to detect a new trading day, then bails if IsTradingSession() returns false (London and NY windows only, plus Friday-after-18 block and full weekend off), then bails if IsSpreadAcceptable() reports a spread wider than InpSpreadThreshold (20 points on a 5-digit gold quote), then bails if ManageRisk() reports either the daily loss limit (5% of dayStartBalance) or the max drawdown (15% of balance) has been breached. Only after all four gates clear does the EA copy 2-3 bars from each indicator, run UpdateSuperTrend(), and ask CheckBuySignal() / CheckSellSignal() for a verdict. ManagePositions() then walks all open positions for the magic number 22212080, and finally PlaceOrder() opens a new trade if the side passes and CountOpenPositions() is below InpMaxOpenTrades (1 per direction by default).

Position management is ATR-anchored. SL sits at entry minus InpATRMulSL(1.5) * ATR(14) for longs (mirror for shorts), and TP sits at entry plus InpATRMulTP(2.5) * ATR(14) — a 1.5:2.5 risk-to-reward ratio that adapts to current volatility. Once profit reaches InpLockProfitPoints (150 points, 15 pips on a 5-digit broker), ManagePositions() ratchets the stop to entry + 10 points (a true breakeven-plus lock, not just breakeven) and after that the trailing math takes over: newSL = bid - (bid - openPrice) * InpTrailPercent(0.5%), so the stop chases price at half the speed of the move. The trailing condition requires the new stop to be above the existing stop AND below the current bid, so it can only ever tighten. The TP is never moved — it stays anchored at the original 2.5 ATR target, so the trade either hits the original target or gets stopped at the ratcheted level.

The position-counting and risk layer are explicit and do not rely on MagicNumber-agnostic functions. CountOpenPositions(ENUM_POSITION_TYPE) iterates PositionsTotal and matches both _Symbol and InpMagic (22212080), so a chart with multiple EAs on different magic numbers will not double-count. ManageRisk() reads dayStartBalance (captured at the start of each calendar day in UpdateDailyStats) and computes dayLossPct = (dayStartBalance - equity) / dayStartBalance * 100 — when this hits InpDailyLossLimit (5%), the EA simply stops looking for new entries for the rest of the day, leaving existing positions to the trailing logic. The 15% max drawdown uses balance-vs-equity: a floating drawdown that large is treated as a halt condition. InpMaxTradesPerDay (10) caps the entry count independently. The lot sizing path in CalcAutoLot() reads tickValue and tickSize, computes lossPerLot from the ATR-implied SL distance, and floors to the broker's lot step before clamping to min/max — a clean risk-percent formula that defaults to InpFixedLot(0.10) when InpUseAutoLot is false.

Trade execution is wrapped in three retry helpers that handle the usual broker requote/timeout/price-changed dance. TryClose_EX12080 and TryClosePartial_EX12080 loop up to three times with a 200ms sleep between attempts, retrying on TRADE_RETCODE_REQUOTE / TIMEOUT / PRICE_OFF / PRICE_CHANGED. TryModify_EX12080 has a tighter 100ms sleep and only retries on REQUOTE / TIMEOUT (price-changed modifications are treated as final and the loop breaks). The three helpers are defined but their use in this build is limited — PlaceOrder() goes straight through trade.Buy / trade.Sell, and the live modifications in ManagePositions() call TryModify_EX12080 directly. The retry cadence is not dramatic, so the EA still expects an ECN-style broker with a low average requote rate; on a slow retail broker the 3-attempt cap will surface as occasional failed trailing-stop updates rather than missed entries.

A few operational notes from the source. InpSymbol is declared as a string input defaulted to "XAUUSD" but every indicator and price request in the EA uses _Symbol, not InpSymbol — so the EA will trade whatever symbol is on the chart, regardless of the InpSymbol value. InpTimeframe is also a label: g_InpTimeframe is set from it via MapTimeframeInt(), which maps 1→M1, 2→M5, …, 7→D1. The 1 default maps to PERIOD_M1, so the M1 scalping behavior described above is the default. The source also has a few duplicate declarations of the MapTimeframeInt / MapAppliedPriceInt / g_InpTimeframe triplets in the file body — the MQL5 compiler will accept these, but the runtime behavior is determined by the last declaration in scope. None of this affects the trading logic; it is an artifact of the source's verbose input scaffolding.

In practical terms, run this EA on XAUUSD M1 with a low-spread ECN broker whose typical spread on gold sits below 20 points (about 0.2 USD per ounce). The London 8-12 GMT window is the most active for gold, and the NY 13-17 GMT window adds the second cluster — between them, the EA stays out of the 12-13 GMT dead zone. The daily loss limit and max drawdown together act as a portfolio-wide circuit breaker; once either trips, the EA stops opening new positions for the day or the session, but does not force-close open trades. Use the fixed 0.10 lot for testing, then enable InpUseAutoLot with 1% risk for production.

Strategy Deep Dive

Pipsgrowth EX12080 keeps a portfolio of eight native indicator handles — iATR(14), three iMA(8/21/50), iBands(20, 2.0), iRSI(14), iMACD(12,26,9), and iVolumes — and lets the operator toggle each of seven filter categories on or off, then refuses to open a trade unless every enabled filter passes in the same direction. The SuperTrend itself is computed inline in UpdateSuperTrend() from ATR and the current high/low rather than loaded as a separate indicator, keeping the handle count tight. OnTick is layered as a defensive stack: it calls UpdateDailyStats() to refresh dayStartBalance, then bails on IsTradingSession() (London 8-12 GMT and NY 13-17 GMT only, with Friday-after-18 and weekend blocks), IsSpreadAcceptable() (rejects above 20 points), and ManageRisk() (5% daily loss or 15% max drawdown circuit breaker) before pulling any buffers or running UpdateSuperTrend() — so on a quiet spread day the EA does effectively nothing rather than fire on stale or out-of-session data. New entries are capped at one per direction and ten per day, with the lot sized either fixed at InpFixedLot(0.10) or via CalcAutoLot() on 1% balance-at-risk. Once in a trade, ManagePositions() walks PositionsTotal and applies the breakeven-plus lock at 150 points and a 0.5%-of-gain trailing stop, with TryModify_EX12080 retrying on REQUOTE / TIMEOUT (100ms back-off) for the live modifications. The execution stack is small and explicit — there is no signal-flip exit, no time stop, and no equity-stop beyond the 15% drawdown circuit breaker in ManageRisk().

Entry Signal

Long entries require every enabled filter to pass simultaneously: Heiken Ashi candle approximation bullish, EMA-8 > EMA-21 > EMA-50 in strict ascending order, RSI(14) > 55, MACD(12,26,9) main line above signal and above zero, current tick volume > 1.5x the 20-bar average, Bollinger Band width expanding versus the prior bar, and the inline SuperTrend direction equal to 1. Short entries mirror all seven conditions. The gate is a strict logical AND (passCount == requiredCount), not a vote count — no single filter can be missed.

Exit Signal

Exits are managed by ManagePositions() on every tick. Once profit reaches InpLockProfitPoints (150 points), the stop is ratcheted to entry + 10 points (breakeven-plus lock) and trailing takes over with newSL = bid - (bid - openPrice) * 0.5% for longs (mirrored for shorts). The original TP is never moved. There is no signal-flip exit and no time-based exit — the trade closes when it hits the locked trailing stop or the original 2.5*ATR target.

Stop Loss

Stop loss is anchored to ATR(14) on the entry bar: SL = entry ± InpATRMulSL(1.5) * ATR(14), so the stop distance auto-adapts to current volatility. After profit exceeds 150 points, the stop ratchets to entry + 10 points (true breakeven-plus lock) and then trails at 0.5% of gain, always tightening — never widening.

Take Profit

Take profit is fixed at entry ± InpATRMulTP(2.5) * ATR(14) — a 1.5:2.5 risk-to-reward ratio that scales with the ATR on the entry bar. The TP is never moved by ManagePositions(); the trade either hits the original 2.5*ATR target or is stopped at the ratcheted trailing level.

Best For

Run Pipsgrowth EX12080 on XAUUSD M1 with a low-spread ECN broker whose typical gold spread sits under 20 points (about 0.2 USD/oz). Minimum recommended balance is $100 — the 0.10 default lot plus 1.5 ATR stop on gold implies roughly $1.50 per pip risk at the smallest deposit, so a $300-$500 balance gives the daily 5% loss cap meaningful breathing room. The active windows are London 8-12 GMT and New York 13-17 GMT, with the EA automatically disabled over the 12-13 GMT dead zone, on Friday after 18 GMT, and across the weekend. Sub-30ms VPS latency is recommended since the trailing-stop modifications and signal checks run every tick.

Strategy Logic

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

Family: MultiIndicatorConfluence Magic: 22212080 Version: 2.00

BRIEF: Advanced gold scalping EA using multi-indicator confluence: Heiken Ashi, EMA ribbon (8/21/50), RSI, MACD, volume spike, Bollinger Bands squeeze and SuperTrend. Session filters for London and NY. ATR-based SL/TP with profit locking and trailing. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester

INDICATOR STACK:

  • Standard MT5 indicators

KEY FUNCTIONS:

  • UpdateSuperTrend()
  • CheckBuySignal()
  • CheckSellSignal()
  • PlaceOrder()
  • CalcAutoLot()
  • ManagePositions()
  • CountOpenPositions()
  • IsTradingSession()
  • IsSpreadAcceptable()
  • ManageRisk()
  • UpdateDailyStats()
  • TryClose_EX12080()
  • ...and 2 more

INTERNAL CONSTANTS (0 total):

INPUT PARAMETERS (42 total across 6 groups):

  • [=== General Settings ===] InpSymbol = "XAUUSD" // Trading symbol
  • [=== General Settings ===] InpTimeframe = 1 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Main timeframe
  • [=== Session & Time Filters ===] InpEnableLondon = true // Enable London session
  • [=== Session & Time Filters ===] InpLondonStartHour = 8 // London start hour (GMT)
  • [=== Session & Time Filters ===] InpLondonEndHour = 12 // London end hour (GMT)
  • [=== Session & Time Filters ===] InpEnableNY = true // Enable NY session
  • [=== Session & Time Filters ===] InpNYStartHour = 13 // NY start hour (GMT)
  • [=== Session & Time Filters ===] InpNYEndHour = 17 // NY end hour (GMT)
  • [=== Session & Time Filters ===] InpAvoidFridaysAfter18 = true // Avoid Fridays after 18:00 GMT
  • [=== Indicator Filter Settings ===] InpEnableHeikenAshi = true // Heiken Ashi filter
  • [=== Indicator Filter Settings ===] InpEnableEMA = true // EMA Ribbon filter
  • [=== Indicator Filter Settings ===] InpEMAPeriod1 = 8 // EMA fast
  • [=== Indicator Filter Settings ===] InpEMAPeriod2 = 21 // EMA mid
  • [=== Indicator Filter Settings ===] InpEMAPeriod3 = 50 // EMA slow
  • [=== Indicator Filter Settings ===] InpEnableRSI = true // RSI filter
  • [=== Indicator Filter Settings ===] InpRSIPeriod = 14 // RSI period
  • [=== Indicator Filter Settings ===] InpRSILevel = 55.0 // RSI level
  • [=== Indicator Filter Settings ===] InpEnableMACD = true // MACD filter
  • [=== Indicator Filter Settings ===] InpMACDFast = 12 // MACD fast
  • [=== Indicator Filter Settings ===] InpMACDSlow = 26 // MACD slow
  • [=== Indicator Filter Settings ===] InpMACDSignal = 9 // MACD signal
  • [=== Indicator Filter Settings ===] InpEnableVolumeSpike = true // Volume spike filter
  • [=== Indicator Filter Settings ===] InpVolumePeriod = 20 // Volume period
  • [=== Indicator Filter Settings ===] InpEnableBollSqueeze = true // Bollinger Squeeze filter
  • [=== Indicator Filter Settings ===] InpEnableSupertrend = true // Supertrend filter
  • [=== Indicator Filter Settings ===] InpSuperTrendPeriod = 10 // Supertrend ATR period
  • [=== Indicator Filter Settings ===] InpSuperTrendMult = 3.0 // Supertrend multiplier
  • [=== Trade & Risk Management ===] InpFixedLot = 0.10 // Fixed lot size
  • [=== Trade & Risk Management ===] InpUseAutoLot = false // Use dynamic lot size
  • [=== Trade & Risk Management ===] InpRiskPercent = 1.0 // Risk % per trade
  • [=== Trade & Risk Management ===] InpMaxOpenTrades = 1 // Max open trades per direction
  • [=== Trade & Risk Management ===] InpMaxTradesPerDay = 10 // Max trades per day
  • [=== Trade & Risk Management ===] InpDailyLossLimit = 5.0 // Daily loss limit %
  • [=== Trade & Risk Management ===] InpMaxDrawdown = 15.0 // Max drawdown %
  • [=== Execution & Order Settings ===] InpSpreadThreshold = 20.0 // Max spread (points)
  • [=== Execution & Order Settings ===] InpATRPeriod = 14 // ATR period
  • [=== Execution & Order Settings ===] InpATRMulSL = 1.5 // ATR SL multiplier
  • [=== Execution & Order Settings ===] InpATRMulTP = 2.5 // ATR TP multiplier
  • [=== Execution & Order Settings ===] InpLockProfitPoints = 150 // Lock profit after X points
  • [=== Execution & Order Settings ===] InpTrailPercent = 0.5 // Trail SL at % gain
  • [=== Identity ===] InpMagic = 22212080 // Magic Number
  • [=== Identity ===] InpTradeComment = "Psgrowth.com Expert_12080" // Trade Comment
Pseudocode
// Pipsgrowth EX12080 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Advanced gold scalping EA using multi-indicator confluence: Heiken Ashi, EMA ribbon (8/21/50), RSI, MACD, volume spike, Bollinger Bands squeeze and SuperTrend. Session filters for London and NY. ATR-based SL/TP with profit locking and trailing. 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:
M1

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
InpSymbol"XAUUSD"Trading symbol
InpTimeframe1Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Main timeframe
InpEnableLondontrueEnable London session
InpLondonStartHour8London start hour (GMT)
InpLondonEndHour12London end hour (GMT)
InpEnableNYtrueEnable NY session
InpNYStartHour13NY start hour (GMT)
InpNYEndHour17NY end hour (GMT)
InpAvoidFridaysAfter18trueAvoid Fridays after 18:00 GMT
InpEnableHeikenAshitrueHeiken Ashi filter
InpEnableEMAtrueEMA Ribbon filter
InpEMAPeriod18EMA fast
InpEMAPeriod221EMA mid
InpEMAPeriod350EMA slow
InpEnableRSItrueRSI filter
InpRSIPeriod14RSI period
InpRSILevel55.0RSI level
InpEnableMACDtrueMACD filter
InpMACDFast12MACD fast
InpMACDSlow26MACD slow
InpMACDSignal9MACD signal
InpEnableVolumeSpiketrueVolume spike filter
InpVolumePeriod20Volume period
InpEnableBollSqueezetrueBollinger Squeeze filter
InpEnableSupertrendtrueSupertrend filter
InpSuperTrendPeriod10Supertrend ATR period
InpSuperTrendMult3.0Supertrend multiplier
InpFixedLot0.10Fixed lot size
InpUseAutoLotfalseUse dynamic lot size
InpRiskPercent1.0Risk % per trade
InpMaxOpenTrades1Max open trades per direction
InpMaxTradesPerDay10Max trades per day
InpDailyLossLimit5.0Daily loss limit %
InpMaxDrawdown15.0Max drawdown %
InpSpreadThreshold20.0Max spread (points)
InpATRPeriod14ATR period
InpATRMulSL1.5ATR SL multiplier
InpATRMulTP2.5ATR TP multiplier
InpLockProfitPoints150Lock profit after X points
InpTrailPercent0.5Trail SL at % gain
InpMagic22212080Magic Number
InpTradeComment"Psgrowth.com Expert_12080"Trade Comment
Source Code (.mq5)Open Source
Pipsgrowth_com_EX12080.mq5
#property copyright "Pipsgrowth.com"
#property link      "https://pipsgrowth.com"
#property version   "2.00"
#property strict
#property description "Pipsgrowth.com EX12080 ic_gold — Multi-indicator confluence gold scalper, full 12-layer stack."

#include <Trade\Trade.mqh>
#include <Trade\PositionInfo.mqh>
#include <Trade\SymbolInfo.mqh>

CTrade        trade;
CPositionInfo posInfo;
CSymbolInfo   symInfo;

//+------------------------------------------------------------------+
//| Inputs                                                             |
//+------------------------------------------------------------------+
ENUM_TIMEFRAMES MapTimeframeInt(int tf)
{
   switch(tf)
   {
      case 1: return PERIOD_M1;
      case 2: return PERIOD_M5;
      case 3: return PERIOD_M15;
      case 4: return PERIOD_M30;
      case 5: return PERIOD_H1;
      case 6: return PERIOD_H4;
      case 7: return PERIOD_D1;
      default: return PERIOD_H1;
   }
}

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_TIMEFRAMES g_InpTimeframe = PERIOD_H1;
input group "=== General Settings ==="
input string          InpSymbol          = "XAUUSD";       // Trading symbol
input int InpTimeframe = 1; // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)      // Main timeframe

ENUM_TIMEFRAMES MapTimeframeInt(int tf)
{
   switch(tf)
   {
      case 1: return PERIOD_M1;
      case 2: return PERIOD_M5;
      case 3: return PERIOD_M15;
      case 4: return PERIOD_M30;
      case 5: return PERIOD_H1;

Full source code available on download

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

Tags:ex12080multiindicatorconfluencepipsgrowthfreemt5xauusd

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_EX12080.mq5
File Size28.2 KB
Versionv2.00
PlatformMetaTrader 5
File Type.mq5 Source
StrategyOther
Risk LevelMedium Risk
Timeframes
M1
Currency Pairs
XAUUSD
Min. Deposit$100