Pipsgrowth EX12018 MultiIndicatorConfluence
MT5 Expert Advisor (Open Source) · XAUUSD · M5, H1
Pipsgrowth.com EX12018 Arttrader_v1_5 — EMA slope with candlestick confirmation, full 12-layer stack.
Overview
Arttrader v1.5 is a slope-band pullback EA built around a single design idea: an EMA(11) computed on the H1 chart, applied to PRICE_OPEN (not the more typical close), feeds a narrow slope window that the EA refuses to trade outside. The defaults demand a slope between +5 and +8 points (SLOPE_SMALL=5, SLOPE_LARGE=8) for longs, and between -5 and -8 for shorts. That window is the whole personality of the EA. A slope of 1 point is too flat — the trend is too weak to trust. A slope of 12 points is too steep — the move is overextended and the EMA has effectively become a momentum spike rather than a directional bias. Only slopes that look controlled, regular, and not in acceleration are allowed to arm a signal.
On every tick the EA pulls two recent values from the H1 EMA buffer (iMAGetArray loads positions 0 and 1, the current and the previous bar), takes the difference as ema_slope, then reads the last six bars of the current timeframe via CopyRates. Long entry requires ema_slope >= +5 and <= +8, AND the current bar must be a bearish pullback candle (rates[0].close <= rates[0].open) AND the close must be within SLIP_BEGIN points of the bar low (rates[0].close <= rates[0].low + ExtSLIP_BEGIN). The short mirror flips the polarity. This is the only confirmation layer the EA uses — there is no RSI, no MACD, no ATR filter, no higher timeframe sweep beyond the H1 EMA itself, and no volume gate on the entry side. Once a slope-band arm meets a counter-trend candle, the order is staged.
Two filters protect the entry from catching a spike that just hit the news. The first is BIG_JUMP, default 30 points: if the absolute gap between the open of the current bar and the open of any of the previous five bars reaches 30 points, both begin_buy_chance and begin_sell_chance are reset to 0. The check is performed five times, once per adjacent pair in the last five bars. The second is DOUBLE_JUMP, default 55 points, which checks non-adjacent pairs: bars 2↔0, 3↔1, 4↔2, 5↔3. If any of those spans opens with a 55-point gap, the signal is cancelled. This pattern is built to filter gap-driven breakouts that often retrace aggressively in the next bar.
A second gate is purely temporal. The OnTick handler reads TimeCurrent() and refuses to enter until the current bar is past the 25th minute (MINUTES_BEGIN=25). On M5 this means the EA only ever trades the second half of each candle, on the assumption that the first half is too noisy to read. The same minute threshold guards the smart-stop exit: a long position is only force-closed by the in-trade SL when the candle is past minute 25, the candle is bullish (close >= open), and the close is within SLIP_END of the bar high. By default MINUTES_END=25, SLIP_BEGIN=0, SLIP_END=0, so the exit logic simplifies to: if in-trade loss >= 20 points AND a confirming bar appears past the 25-minute mark, close.
Stop placement is unusual. The EA maintains two stops. The first is STOP_LOSS=20, which is the "smart SL" — it is a logical in-EA check, not an order parameter, and is what triggers the close described above. The second is EMERGENCY_LOSS=50, which IS the order parameter passed to m_trade.Buy / m_trade.Sell. The order-level hard stop is set at 50 points, but the EA actively tries to close at 20 if a confirming candle shows up in time. If neither happens, the broker closes at 50. On entry, the order's take profit is set to TAKE_PROFIT=25, a fixed 25-point target. There is no trailing stop, no break-even, no partial close, and no time-based exit other than the implicit expiry that the broker applies at 50.
A volume-collapse gate handles an edge case. After the entry logic runs, the EA checks iVolume(symbol, period, 1) — the volume of the previous bar — and if it is at or below MIN_VOLUME (default 0, so the gate is effectively off out of the box), any open position is force-closed. The default of 0 means the gate does nothing, but if a user sets MIN_VOLUME to a positive value, the EA exits when the market goes quiet, which on XAUUSD can flag session transitions or weekend drift before a gap.
The position-management layer is intentionally minimal. CalculateAllPositions scans PositionsTotal() and counts buys and sells filtered by symbol and magic 22212018. If count_buys + count_sells > 1, the EA calls CloseAllPositions() and returns — any state with two or more open positions is treated as an error and flattened immediately. This single-position-only rule is enforced even on a strategy where a real grid or martingale might want to add, and is the cleanest way to keep Arttrader behaving like a pure signal system rather than a money-management system. The constant m_slippage=10 is set as the deviation in points for every CTrade call; if the broker rejects for slippage, TryClose_EX12018 retries up to 3 times at 200ms intervals on REQUOTE / TIMEOUT / PRICE_OFF / PRICE_CHANGED codes, and TryModify_EX12018 retries 3 times at 100ms on REQUOTE / TIMEOUT only.
On entry, the EA stores an internal open_price that is rates[0].open shifted by ADJUST=1 point plus the bid-ask spread. This is the reference price used by the in-trade SL check, not the fill price. The comment describes it as a "strange but functional imaginary spread adjustment" — it is essentially a way to give the in-trade SL check a small extra buffer beyond the fill, configurable via the ADJUST input. The same adjustment applies symmetrically to longs and shorts.
The market-fit story is narrow. Arttrader v1.5 is designed for instruments with steady intraday trends and clean pullbacks. XAUUSD on M5 is the natural home because the H1 EMA(11) maps well to the cadence of gold's day-session moves, but the EA is portable to FX majors on M5–H1 provided the slope band of 5–8 points is rescaled to the symbol's average point value. The minimum recommended deposit is $100, set for a single 1.0-lot position on a $100 account, which means this is a contract-sized test profile rather than a long-term sizing profile. Risk level on the listing is MEDIUM because the 50-point emergency stop is tight enough to limit the catastrophic tail, but the 1.0-lot default combined with a 5-digit XAUUSD quote can produce a non-trivial per-trade loss in dollar terms. Anyone running this for real should treat the lot input as a function of account size, not a constant.
Strategy Deep Dive
On every tick the EA loads the H1 EMA(11) (computed on PRICE_OPEN) for the current and previous bar, takes the difference as the slope, and demands that slope fall inside the +5..+8 band for longs or -5..-8 for shorts. With the slope armed, it then looks for a pullback candle on the in-trade timeframe: a bearish bar (close <= open) closing near the bar low for longs, or the bullish mirror for shorts. BIG_JUMP=30 cancels the signal if any adjacent bar pair in the last five opens with a 30-point gap, and DOUBLE_JUMP=55 extends the same idea to non-adjacent pairs, filtering gap-driven breakouts. The OnTick handler also enforces a MINUTES_BEGIN=25 timer, refusing to enter before the bar is past the 25-minute mark, the same way it refuses to fire the 20-point smart SL until a confirming bar passes the same threshold. The order itself ships with a 50-point emergency SL and a 25-point TP, the only positive exit, while CalculateAllPositions enforces a strict single-position rule (count > 1 flattens everything). Closes retry up to 3 times at 200ms on requote/timeout/price-off/price-changed; modifies retry 3 times at 100ms on requote/timeout only, with the magic 22212018 stamped on every fill.
Long entry requires the H1 EMA(11) slope to fall inside the +5..+8 band (SLOPE_SMALL to SLOPE_LARGE) AND the current bar to be a bearish pullback candle (close <= open) with its close within SLIP_BEGIN points of the bar low. Short entry mirrors the polarity. The slope must be moderate — too flat or too steep, and the signal is rejected. Entries are blocked if any adjacent bar pair in the last five opens with a 30-point gap (BIG_JUMP) or any non-adjacent pair with a 55-point gap (DOUBLE_JUMP), and the EA will not fire before the current bar passes the 25-minute mark (MINUTES_BEGIN).
Exit runs on three paths. The "smart" path closes a long at 20 points of loss (STOP_LOSS) when the current bar is past the 25-minute mark and shows a bullish confirmation (close >= open with close within SLIP_END of the bar high); the mirror applies to shorts. The emergency path is the broker-side hard stop at EMERGENCY_LOSS=50 points, set on every order. The volume path forces a close when iVolume(bar-1) <= MIN_VOLUME — out of the box this is disabled (default 0). The fixed take profit at TAKE_PROFIT=25 is the only positive exit; there is no trailing stop, no break-even, and no time stop.
Two-tier stop loss. The actionable 20-point "smart SL" (STOP_LOSS) is a logical in-EA check that only fires when a confirming candle appears past the 25-minute mark, allowing a clean early exit on most losing trades. The 50-point EMERGENCY_LOSS is passed to every order as the broker-side hard stop, providing the catastrophic backstop if the EA stalls.
Fixed take profit at 25 points (TAKE_PROFIT), set on every order as the only positive exit. No partial close, no trailing TP, no break-even ratchet — the trade is binary: hit 25, hit 20, or hit 50.
XAUUSD M5 is the native target — the H1 EMA(11) cadence maps well to gold's day-session rhythm, and the 5–8 point slope band fits a 5-digit gold quote. The strategy also ports to FX majors on M5–H1 if you rescale SLOPE_SMALL / SLOPE_LARGE to the symbol's average pip value (treat them as raw points, not pips). Minimum recommended balance is $100 to clear the lot-step check; in practice, scale NUM_LOTS to roughly 0.01 per $200 of equity to keep the 50-point emergency stop in a tolerable dollar range. Run on an ECN/RAW-spread account — the slope band is sensitive to gap noise, and the spread buffer (ADJUST=1 point) is too tight to absorb a wide variable spread. Active London + New York overlap is the cleanest session, when pullback candles form on M5 inside a stable H1 trend; thin Asia tends to violate the SLOPE_SMALL floor.
Strategy Logic
Pipsgrowth EX12018 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)
Family: MultiIndicatorConfluence
Magic: 22212018
Version: 2.00
BRIEF:
Arttrader v1.5 uses EMA slope analysis with candlestick pattern confirmation to enter trades, filtering big jumps. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
OnTradeTransaction()RefreshRates()CheckVolumeValue()iMAGetArray()CalculateAllPositions()CloseAllPositions()OpenBuy()OpenSell()PrintResultTrade()TryClose_EX12018()TryClosePartial_EX12018()TryModify_EX12018()
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (17 total across 2 groups):
- [=== Identity ===]
InpTradeComment= "Psgrowth.com Expert_12018" // TradeComment - [=== Identity ===]
m_magic=22212018// magic number - [=== Trade Parameters ===]
NUM_LOTS=1.0// How many lots to deal with (may be less than one) - [=== Trade Parameters ===]
EMA_SPEED=11.0// The period for the averager - [=== Trade Parameters ===]
BIG_JUMP=30.0// Check for too-big candlesticks (avoid them) - [=== Trade Parameters ===]
DOUBLE_JUMP=55.0// Check for pairs of big candlesticks - [=== Trade Parameters ===]
STOP_LOSS=20.0// A smart stop-loss - [=== Trade Parameters ===]
EMERGENCY_LOSS=50.0// The trade's stop loss in case of program error - [=== Trade Parameters ===]
TAKE_PROFIT=25.0// The trade's take profit - [=== Trade Parameters ===]
SLOPE_SMALL=5.0// The minimumEMAslope to enter a trade - [=== Trade Parameters ===]
SLOPE_LARGE=8.0// The maximumEMAslope to enter a trade - [=== Trade Parameters ===]
MINUTES_BEGIN=25.0// Wait this long to determine candlestick lows/highs - [=== Trade Parameters ===]
MINUTES_END=25.0// Wait this long to determine candlestick lows/highs - [=== Trade Parameters ===]
SLIP_BEGIN=0.0// An allowance between the close and low/high price - [=== Trade Parameters ===]
SLIP_END=0.0// An allowance between the close and low/high price - [=== Trade Parameters ===]
MIN_VOLUME=0.0// If the previous volume is not above this, exit the trade - [=== Trade Parameters ===]
ADJUST=1.0// A strange but functional imaginary spread adjustment
// Pipsgrowth EX12018 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Arttrader v1.5 uses EMA slope analysis with candlestick pattern confirmation to enter trades, filtering big jumps. 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
How to Install This EA on MT5
- 1Download the .mq5 file using the button above
- 2Open MetaTrader 5 on your computer
- 3Click File → Open Data Folder in the top menu
- 4Navigate to MQL5 → Experts and paste the .mq5 file there
- 5In MT5, right-click Expert Advisors in the Navigator panel → Refresh
- 6Drag the EA onto a chart matching the recommended timeframe
- 7Configure parameters according to the table on this page
- 8Enable Allow Algo Trading and click OK
EA Parameters
| Parameter | Default | Description |
|---|---|---|
| InpTradeComment | "Psgrowth.com Expert_12018" | Trade Comment |
| m_magic | 22212018 | magic number |
| NUM_LOTS | 1.0 | How many lots to deal with (may be less than one) |
| EMA_SPEED | 11.0 | The period for the averager |
| BIG_JUMP | 30.0 | Check for too-big candlesticks (avoid them) |
| DOUBLE_JUMP | 55.0 | Check for pairs of big candlesticks |
| STOP_LOSS | 20.0 | A smart stop-loss |
| EMERGENCY_LOSS | 50.0 | The trade's stop loss in case of program error |
| TAKE_PROFIT | 25.0 | The trade's take profit |
| SLOPE_SMALL | 5.0 | The minimum EMA slope to enter a trade |
| SLOPE_LARGE | 8.0 | The maximum EMA slope to enter a trade |
| MINUTES_BEGIN | 25.0 | Wait this long to determine candlestick lows/highs |
| MINUTES_END | 25.0 | Wait this long to determine candlestick lows/highs |
| SLIP_BEGIN | 0.0 | An allowance between the close and low/high price |
| SLIP_END | 0.0 | An allowance between the close and low/high price |
| MIN_VOLUME | 0.0 | If the previous volume is not above this, exit the trade |
| ADJUST | 1.0 | A strange but functional imaginary spread adjustment |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX12018 Arttrader_v1_5 — EMA slope with candlestick confirmation, full 12-layer stack."
//---
#include <Trade\PositionInfo.mqh>
#include <Trade\Trade.mqh>
#include <Trade\SymbolInfo.mqh>
#include <Trade\AccountInfo.mqh>
#include <Trade\DealInfo.mqh>
#include <Trade\OrderInfo.mqh>
#include <Expert\Money\MoneyFixedMargin.mqh>
CPositionInfo m_position; // trade position object
CTrade m_trade; // trading object
CSymbolInfo m_symbol; // symbol info object
CAccountInfo m_account; // account info wrapper
CDealInfo m_deal; // deals object
COrderInfo m_order; // pending orders object
CMoneyFixedMargin *m_money;
//--- input parameters
//--- variables that can be changed outside the program code, even optimized
input group "=== Identity ==="
input string InpTradeComment = "Psgrowth.com Expert_12018"; // Trade Comment
input ulong m_magic = 22212018; // magic number
input group "=== Trade Parameters ==="
input double NUM_LOTS = 1.0; // How many lots to deal with (may be less than one)
input int EMA_SPEED = 11.0; // The period for the averager
input ushort BIG_JUMP = 30.0; // Check for too-big candlesticks (avoid them)
input ushort DOUBLE_JUMP = 55.0; // Check for pairs of big candlesticks
input ushort STOP_LOSS = 20.0; // A smart stop-loss
input ushort EMERGENCY_LOSS = 50.0; // The trade's stop loss in case of program error
input ushort TAKE_PROFIT = 25.0; // The trade's take profit
input ushort SLOPE_SMALL = 5.0; // The minimum EMA slope to enter a trade
input ushort SLOPE_LARGE = 8.0; // The maximum EMA slope to enter a trade
input int MINUTES_BEGIN = 25.0; // Wait this long to determine candlestick lows/highs
input int MINUTES_END = 25.0; // Wait this long to determine candlestick lows/highs
input ushort SLIP_BEGIN = 0.0; // An allowance between the close and low/high price
input ushort SLIP_END = 0.0; // An allowance between the close and low/high price
input long MIN_VOLUME = 0.0; // If the previous volume is not above this, exit the trade
input ushort ADJUST = 1.0; // A strange but functional imaginary spread adjustment
//---
ulong m_slippage=10; // slippage
double ExtBIG_JUMP=0.0;
double ExtDOUBLE_JUMP=0.0;
double ExtSTOP_LOSS=0.0;
double ExtEMERGENCY_LOSS=0.0;
double ExtTAKE_PROFIT=0.0;
double ExtSLOPE_SMALL=0.0;
double ExtSLOPE_LARGE=0.0;
double ExtSLIP_BEGIN=0.0;
double ExtSLIP_END=0.0;
double ExtADJUST=0.0;
int handle_iMA; // variable for storing the handle of the iMA indicator
double m_adjusted_point; // point value adjusted for 3 or 5 points
//+------------------------------------------------------------------+
Full source code available on download
Educational purposes only. Do NOT use with real money. Test on demo accounts only.
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
Markets.com
Exness
IC Markets
Similar Expert Advisors
View All Expert AdvisorsMore Other strategy EAs from our library
Pipsgrowth EX01007 Adaptive
Pipsgrowth.com EX01007 Adaptive XAUUSD 5M — multi-indicator signal scorer with regime filter, full 12-layer stack, configurable timeframe, trailing/BE/profit-lock toggles, pyramid gate, spread filter, new-bar gate, filling mode detection.
Pipsgrowth EX01019 Adaptive
Pipsgrowth.com EX01019 Self-Adaptive Market EA Fixed — multi-regime adaptive EA, full 12-layer stack.
Pipsgrowth EX15029 SMC-OrderBlock
Pipsgrowth.com EX15029 SMCBreakoutEA — SMC breakout CHOCH/liquidity sweep EA, full 12-layer stack.
Community
Educational purposes only. Do NOT use with real money. Test on demo accounts only.