P
PipsGrowth
OtherOpen Source – Free

Pipsgrowth EX12008 MultiIndicatorConfluence

MT5 Expert Advisor (Open Source) · EURUSD, USDCAD · M5, H4

Pipsgrowth.com EX12008 MAAOS_XAUUSD_5M — 2MA + Andean Oscillator confluence, full 12-layer stack.

Overview

EX12008 is a multi-symbol trend-confirmation EA built on a three-stage agreement: a custom Andean Oscillator signal, a fast/slow moving-average regime, and a price-proximity filter around the fast MA. Rather than fire on a single crossover, it waits for the AOS bull (or bear) line to cross above its smoothed signal while the fast 50-period MA sits above the slow 200-period MA, and while the current ask price is within half the MA gap of the fast line. That last clause is what makes the strategy unusual: the EA does not chase breakouts, it waits for the market to come back to the fast MA before committing. Each symbol is scanned on a fixed 120-second timer, not every tick, which both throttles server load and prevents the kind of overtrading that pure tick-driven EAs suffer from.

The Andean Oscillator is implemented in-house rather than called as a separate indicator. The CAndeanOscillator class maintains four smoothed arrays — Up1, Up2, Dn1, Dn2 — and computes Bull as the square root of (Dn2 − Dn1²) and Bear as the square root of (Up2 − Up1²). A signal line is then produced as an EMA of the larger of the two. Inputs AosPeriod (default 50) and AosSignalPeriod (default 9) control the smoothing windows; both are tweakable from the panel. The 4-clause entry then becomes: AOS bull on bar 1 above its signal AND AOS bull on bar 1 above AOS bear AND fast MA on bar 1 above slow MA on bar 1 AND ask price within 0.5 × |fma1 − sma1| of the fast MA. The sell side is the mirror. All four clauses must be true on bar 1 of the symbol's timeframe; if any one fails, the EA skips that symbol and moves to the next in the rotation.

The EA is multi-symbol by default. Drop the file on any M5 chart, set MultipleSymbol = true, and the Symbols string "EURUSD, EURCAD, USDCAD" gets parsed into a rotation list. Each cycle walks the list and applies the same logic. Per-symbol protections include MinPosInterval = 6 (no new position on the same symbol for six candles after the last deal) and a SpreadLimit that, if enabled, blocks entries when the bid/ask gap exceeds the configured point count. hasDealRecently() enforces the cool-down; ea.OPTotal(s) prevents stacking positions on a single symbol even if the entry logic fires repeatedly. The combination means the EA will hold at most one position per symbol at any given time, but it can be long EURUSD, short EURCAD, and flat USDCAD simultaneously.

Stop-loss placement is swing-based, not fixed-pip. The SLType = SL_SWING input tells the EA to look back SLLookback = 10 bars for the most recent swing high (for sells) or swing low (for buys), then offset the SL by SLDev = 100 points. This adapts the stop to current volatility — wider in choppy markets, tighter in trending ones. The 100-point buffer prevents the stop from being parked exactly on a candle wick, where it would be tagged by noise. IgnoreSL = false is the default, so the SL is honored; set it to true and the EA closes positions only via trail, TP, or signal reversal. Take-profit is calculated as TPCoef × |entry − SL|, with the default TPCoef = 1.0 producing a 1:1 reward-to-risk ratio. However, IgnoreTP = true ships as the default, meaning the EA in its stock configuration is managed via trail, not TP — most positions are expected to close on the trailing stop or on a reverse AOS signal.

Trailing is the workhorse of the exit stack. Trail = true and TrailingStopLevel = 50 (interpreted as 0.5, since the EA multiplies by 0.01 in OnInit) engage an ATR-aware trail that ratchets the stop forward as price moves in the trade's favor. EquityDrawdownLimit = 0 keeps the global drawdown kill-switch off by default; turning it on (e.g. 30 for 30%) makes the EA flatten all positions and refuse new entries once equity drops that far from the high-water mark. A Grid mode is implemented but disabled by default; flipping it on activates a martingale-style layering with GridVolMult = 1.3 (each grid level is 1.3× the previous lot) and GridMaxLvl = 20 capping the depth. News filtering via the calendar is also off by default; NewsMinsBefore = 60 / NewsMinsAfter = 60 define a one-hour blackout window around medium-importance events when turned on.

Each entry attempt is followed by a 5-second sleep. The Sleep(5000) calls after BuyOpen and SellOpen are deliberate — they prevent the broker's order-acceptance throttle from rejecting rapid-fire requests when several symbols in the rotation fire on the same timer tick. Filling mode defaults to FILLING_DEFAULT; the EA inherits whatever the broker supports. Slippage is hardcoded at 30 points. The magic number 22212008 is used on every order; combined with the InpTradeComment of "Psgrowth.com Expert_12008", this isolates EX12008 from any other EAs or manual orders on the same account.

Risk sizing uses Risk = 5.5 (interpreted as 5.5% in RISK_DEFAULT mode), which is aggressive for a multi-symbol strategy — three symbols open simultaneously at 5.5% risk each is 16.5% account exposure per signal cluster. The GerEA framework handles the lot calculation from the swing SL distance. For accounts that want smaller exposure, drop Risk to 1.02.0 and the same SL placement will scale the position size down proportionally. Pair the 5.5% default with the recommended $100 minimum deposit and the EA will run on a micro lot, but a $500+ deposit is the honest starting point if all three symbols start firing on the same day.

The EA was designed for M5 primarily and works M5H4 according to the source header. The five-minute bar is short enough to catch the AOS cross + MA proximity in real time, and the 120-second timer interval aligns naturally with it. Higher timeframes (H1, H4) reduce signal frequency but keep the same logic intact — the AOS class recalculates on whatever timeframe the chart is set to. For backtesting, NewsStartYear = 0 disables historical news fetching; if you want to test the news filter behavior, set it to a year before your backtest start.

A practical backtest expectation: on EURUSD M5 over 2022–2024, expect roughly 200–400 trades per year with a moderate win rate. The 1:1 R:R plus trailing means wins are smaller than typical trend-followers, but the loss rate is also lower. The strategy underperforms during high-volatility news spikes (where the 4-clause filter fails to fire on time) and during extended ranging periods (where MA proximity whipsaws). It does best in trending sessions where the fast MA pulls away from the slow MA and price retraces cleanly to it — exactly the condition the third clause of the entry is designed to detect.

Strategy Deep Dive

The Andean Oscillator is implemented in-house via a CAndeanOscillator class that maintains four smoothed arrays (Up1, Up2, Dn1, Dn2) and produces Bull = √(Dn2 − Dn1²), Bear = √(Up2 − Up1²), and Signal = EMA of max(Bull, Bear). A 4-clause entry fires only when AOS bull crosses above signal, bull is above bear, fast MA is above slow MA, and price is within half the MA gap of the fast MA — a pull-back-to-fast-MA setup, not a breakout. Multi-symbol rotation walks EURUSD / EURCAD / USDCAD in 120-second cycles, with per-symbol gates (MinPosInterval = 6, SpreadLimit, MarginLimit = 5000%) preventing stacking. Order execution is followed by a 5-second Sleep to stay below broker request throttle, with 30-point slippage, magic 22212008, and FILLING_DEFAULT filling. Trail (TrailingStopLevel = 50, i.e. 0.5) handles the ratchet; reverse AOS signal handles the early exit; equity drawdown kill-switch is off by default but easy to enable.

Entry Signal

A buy is triggered when the Andean Oscillator bull line crosses above its smoothed signal on bar 1, the bull is above the bear, the 50-MA is above the 200-MA, and the ask price is within 0.5 × |fastMAslowMA| of the fast MA. The sell side mirrors all four clauses. Each symbol in the multi-symbol rotation is evaluated on the 120-second timer; if any clause fails the EA moves to the next symbol.

Exit Signal

Exits are handled by a 50%-of-ATR trailing stop and by a reverse AOS signal. IgnoreTP = true is the default, so the take-profit level is calculated but suppressed; most positions close on the ratcheting trail or on an opposing bull/bear cross. The 5-second sleep after each entry also acts as a de-facto per-symbol debounce.

Stop Loss

Stop-loss is swing-based, anchored to the most recent swing high (for sells) or swing low (for buys) over SLLookback = 10 bars, then offset by SLDev = 100 points to stay clear of candle wicks. IgnoreSL = false ships as default — the stop is honored unless explicitly disabled.

Take Profit

TP = TPCoef × |entry − SL|. With TPCoef = 1.0 default, the reward-to-risk ratio is 1:1 — small enough to be hit often. IgnoreTP = true ships as the default, so the TP is suppressed and management falls back to the trailing stop.

Best For

Best on EURUSD / EURCAD / USDCAD M5 charts. Default Risk = 5.5% is aggressive for a multi-symbol EA — three concurrent signals at 5.5% each = 16.5% account exposure; cut to 1–2% for safer runs. Minimum $100 deposit runs the EA on micro lots, but a $500+ deposit is the honest starting point when all three symbols fire on the same day. ECN or low-spread broker recommended so the spread filter (when enabled) does not block too many entries.

Strategy Logic

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

Family: MultiIndicatorConfluence Magic: 22212008 Version: 2.00

BRIEF: Two Moving Averages plus Andean Oscillator confluence EA. Bull/bear oscillator signals confirmed by fast/slow MA crossover and price proximity filter. Supports multi-symbol, swing-based SL, risk-based sizing, trailing, grid and news filter. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester

INDICATOR STACK:

  • Standard MT5 indicators

KEY FUNCTIONS:

  • MA()
  • AOS()
  • CheckForSignal()
  • OnTimer()
  • TryClose_EX12008()
  • TryClosePartial_EX12008()
  • TryModify_EX12008()

INTERNAL CONSTANTS (0 total):

INPUT PARAMETERS (39 total across 7 groups):

  • [=== Indicator Parameters ===] AosPeriod = 50 // Andean Oscillator Period
  • [=== Indicator Parameters ===] AosSignalPeriod = 9 // Andean Oscillator Signal Period
  • [=== Indicator Parameters ===] FastMaPeriod = 50 // Fast MA Period
  • [=== Indicator Parameters ===] SlowMaPeriod = 200 // Slow MA Period
  • [=== Indicator Parameters ===] MaMethod = MODE_SMA // MA Method
  • [=== Indicator Parameters ===] MaPrice = 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MA Price
  • [=== General ===] MultipleSymbol = true // Multiple Symbols
  • [=== General ===] Symbols = "EURUSD, EURCAD, USDCAD" // Symbols
  • [=== General ===] TPCoef = 1 // TP Coefficient
  • [=== General ===] SLType = SL_SWING // SL Type
  • [=== General ===] SLLookback = 10 // SL Look Back
  • [=== General ===] SLDev = 100 // SL Deviation (Points)
  • [=== General ===] MinPosInterval = 6 // Minimum New Position Interval
  • [=== General ===] Reverse = false // Reverse Signal
  • [=== Risk Management ===] Risk = 5.5 // Risk
  • [=== Risk Management ===] RiskMode = RISK_DEFAULT // Risk Mode
  • [=== Risk Management ===] IgnoreSL = false // Ignore SL
  • [=== Risk Management ===] IgnoreTP = true // Ignore TP
  • [=== Risk Management ===] Trail = true // Trailing Stop
  • [=== Risk Management ===] TrailingStopLevel = 50 // Trailing Stop Level (%) (0: Disable)
  • [=== Risk Management ===] EquityDrawdownLimit = 0 // Equity Drawdown Limit (%) (0: Disable)
  • [=== Strategy: Grid ===] Grid = false // Grid Enable
  • [=== Strategy: Grid ===] GridVolMult = 1.3 // Grid Volume Multiplier
  • [=== Strategy: Grid ===] GridTrailingStopLevel = 0 // Grid Trailing Stop Level (%) (0: Disable)
  • [=== Strategy: Grid ===] GridMaxLvl = 20 // Grid Max Levels
  • [=== News ===] News = false // News Enable
  • [=== News ===] NewsImportance = NEWS_IMPORTANCE_MEDIUM // News Importance
  • [=== News ===] NewsMinsBefore = 60 // News Minutes Before
  • [=== News ===] NewsMinsAfter = 60 // News Minutes After
  • [=== News ===] NewsStartYear = 0 // News Start Year to Fetch for Backtesting (0: Disable)
  • [=== Open Position Limit ===] OpenNewPos = true // Allow Opening New Position
  • [=== Open Position Limit ===] MultipleOpenPos = true // Allow Having Multiple Open Positions
  • [=== Open Position Limit ===] MarginLimit = 5000 // Margin Limit (%) (0: Disable)
  • [=== Open Position Limit ===] SpreadLimit = -1 // Spread Limit (Points) (-1: Disable)
  • [=== Auxiliary ===] Slippage = 30 // Slippage (Points)
  • [=== Auxiliary ===] TimerInterval = 120 // Timer Interval (Seconds)
  • [=== Auxiliary ===] InpMagicNumber = 22212008 // Magic Number
  • [=== Auxiliary ===] InpTradeComment = "Psgrowth.com Expert_12008" // Trade Comment
  • [=== Auxiliary ===] Filling = FILLING_DEFAULT // Order Filling
Pseudocode
// Pipsgrowth EX12008 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Two Moving Averages plus Andean Oscillator confluence EA. Bull/bear oscillator signals confirmed by fast/slow MA crossover and price proximity filter. Supports multi-symbol, swing-based SL, risk-based sizing, trailing, grid and news filter. 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:
EURUSDUSDCAD
Optimized Timeframes:
M5H4

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
AosPeriod50Andean Oscillator Period
AosSignalPeriod9Andean Oscillator Signal Period
FastMaPeriod50Fast MA Period
SlowMaPeriod200Slow MA Period
MaMethodMODE_SMAMA Method
MaPrice1Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MA Price
MultipleSymboltrueMultiple Symbols
Symbols"EURUSD, EURCAD, USDCAD"Symbols
TPCoef1TP Coefficient
SLTypeSL_SWINGSL Type
SLLookback10SL Look Back
SLDev100SL Deviation (Points)
MinPosInterval6Minimum New Position Interval
ReversefalseReverse Signal
Risk5.5Risk
RiskModeRISK_DEFAULTRisk Mode
IgnoreSLfalseIgnore SL
IgnoreTPtrueIgnore TP
TrailtrueTrailing Stop
TrailingStopLevel50Trailing Stop Level (%) (0: Disable)
EquityDrawdownLimit0Equity Drawdown Limit (%) (0: Disable)
GridfalseGrid Enable
GridVolMult1.3Grid Volume Multiplier
GridTrailingStopLevel0Grid Trailing Stop Level (%) (0: Disable)
GridMaxLvl20Grid Max Levels
NewsfalseNews Enable
NewsImportanceNEWS_IMPORTANCE_MEDIUMNews Importance
NewsMinsBefore60News Minutes Before
NewsMinsAfter60News Minutes After
NewsStartYear0News Start Year to Fetch for Backtesting (0: Disable)
OpenNewPostrueAllow Opening New Position
MultipleOpenPostrueAllow Having Multiple Open Positions
MarginLimit5000Margin Limit (%) (0: Disable)
SpreadLimit-1Spread Limit (Points) (-1: Disable)
Slippage30Slippage (Points)
TimerInterval120Timer Interval (Seconds)
InpMagicNumber22212008Magic Number
InpTradeComment"Psgrowth.com Expert_12008"Trade Comment
FillingFILLING_DEFAULTOrder Filling
Source Code (.mq5)Open Source
Pipsgrowth_com_EX12008.mq5
#property copyright "Pipsgrowth.com"
#property link      "https://pipsgrowth.com"
#property version   "2.00"
#property strict
#property description "Pipsgrowth.com EX12008 MAAOS_XAUUSD_5M — 2MA + Andean Oscillator confluence, full 12-layer stack."

#include <EAUtils.mqh>

enum ENUM_AOS_BI {
    AOS_BI_BULL,
    AOS_BI_BEAR,
    AOS_BI_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_MaPrice = PRICE_CLOSE;
input group "=== Indicator Parameters ==="
input int AosPeriod = 50; // Andean Oscillator Period
input int AosSignalPeriod = 9; // Andean Oscillator Signal Period
input int FastMaPeriod = 50; // Fast MA Period
input int SlowMaPeriod = 200; // Slow MA Period
input ENUM_MA_METHOD MaMethod = MODE_SMA; // MA Method
input int MaPrice = 1; // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MA Price

class CAndeanOscillator {
private:
    string m_symbol;
    ENUM_TIMEFRAMES m_period;
    int m_length;
    int m_sig_length;
    
    double Bull[];
    double Bear[];
    double Signal[];
    double Up1[], Up2[], Dn1[], Dn2[];
    
public:
    void Init(string symbol, ENUM_TIMEFRAMES period, int length, int sig_length) {
        m_symbol = symbol;
        m_period = period;
        m_length = length;
        m_sig_length = sig_length;
        
        ArraySetAsSeries(Bull, true);
        ArraySetAsSeries(Bear, true);
        ArraySetAsSeries(Signal, true);
        ArraySetAsSeries(Up1, true);

Full source code available on download

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

Tags:ex12008multiindicatorconfluencepipsgrowthfreemt5eurusdusdcad

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_EX12008.mq5
File Size18.8 KB
Versionv2.00
PlatformMetaTrader 5
File Type.mq5 Source
StrategyOther
Risk LevelMedium Risk
Timeframes
M5H4
Currency Pairs
EURUSDUSDCAD
Min. Deposit$100