Pipsgrowth EX12041 MultiIndicatorConfluence
MT5 Expert Advisor (Open Source) · EURUSD · M5, H1
Pipsgrowth.com EX12041 EURUSD_1_41 — Adaptive AMA+RSI+ATR+BB+MACD+Heiken Ashi scalper, full 12-layer stack.
Overview
Pipsgrowth EX12041 is the patch 1.41 refinement of the EX12 MultiIndicatorConfluence family — the source file's header lists twelve layers (REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester) and the code actually wires up enough of them to be auditable, which is the main reason this version exists. The brief calls it an 'adaptive forex scalping EA' for EURUSD, but the operative word is 'confluence': the EA does not let any single indicator carry a trade. Four native indicator handles are mounted in OnInit (iRSI(_Symbol, PERIOD_CURRENT, RSI_Period=14, PRICE_CLOSE), iATR(_Symbol, PERIOD_CURRENT, ATR_Period=14), iBands(_Symbol, PERIOD_CURRENT, BB_Period=20, BB_Deviation=2.0, 0, PRICE_CLOSE), and iMACD(_Symbol, PERIOD_CURRENT, MACD_FastEMA=12, MACD_SlowEMA=26, MACD_SignalPeriod=9, PRICE_CLOSE)) and four manually-populated arrays (adaptiveMA, volatility, the Heiken Ashi OHLC group, and the macdMain / macdSignal / macdHistogram group) carry everything else, with the so-called 'adaptive MA' being a volatility-windowed SMA in disguise (period 5 to 50, base 14, sensitivity 2.0, derived from a 20-bar volatility ratio against the 14-bar period input). Sixty-two input parameters in eleven groups drive the whole stack.
The decision pipeline starts on every tick with UpdateAdaptiveIndicators, which calls six calculators (volatility, ATR, adaptive MA, RSI, Heiken Ashi, Bollinger Bands, MACD — yes, seven, because the 'adaptive MA' is its own function even though it is just a windowed SMA), and then ManagePositions runs unconditionally to ratchet stops on live tickets via ManageDynamicStopLoss. Entry evaluation, however, only fires when a new bar is detected (the if(newBar) CheckForEntry() gate in OnTick), which means a 1-trade-per-bar ceiling is baked in regardless of what the indicator stack agrees on. CheckForEntry chains three pre-filters before it ever asks whether the EA wants to buy or sell: IsMarketConditionsOK enforces the spread gate (current spread ≤ MaxSpread * pointValue = 5 points by default, with a hard rejection at 5 * MaxSpread = 25 points for spike protection) and a 10% account-drawdown hard block, plus a separate ATR floor (atrBuffer[0] ≥ VolatilityThreshold * pointValue = 0.3 * pointValue) when UseATRforVolatilityFilter is on; IsPositionManagementOK returns true immediately for an empty book, returns true unconditionally if AllowOnlyProfitableAdditions is false, and otherwise walks every open position to verify each is at least MinProfitInPointsPerTradeToAdd (20 points default) in profit before greenlighting a pyramid; IsOptimalTradingSession short-circuits to true in the strategy tester (isTester flag set from MQLInfoInteger(MQL_TESTER)) and, when the filter is on, accepts London 8-16 GMT, New York 13-21 GMT, or the 13-16 GMT overlap window.
GetBuySignal and GetSellSignal are the only places a trade idea can actually form. The five-way AND core is the same for both directions: price above (or below) adaptiveMA, current candle bullish (or bearish) via iClose > iOpen, the ATR volatility gate (atrBuffer[0] > ATR_VolatilityMultiplier * VolatilityThreshold * pointValue, with a non-ATR fallback to the manual volatility[] array when the ATR handle is disabled), the Bollinger band position trigger (long on iClose > bbUpper in BB_UseBreakoutStrategy mode, long on iClose < bbLower in BB_UseMeanReversionStrategy mode, mirrored for sells), and the macdOK gate. The macdOK gate is the patch 1.41 piece: it requires either MACD_UseHistogramCrossover (macdHistogram[1] < 0 && macdHistogram[0] > 0) or MACD_UseSignalLineCrossover (macdMain[1] < macdSignal[1] && macdMain[0] > macdSignal[0]) when both flags are on, with the boolean operator OR-ing the two so a histogram zero-cross alone is sufficient. Two optional add-ons close the entry: UseRSIforEntrySignals (true default) demands rsiBuffer[1] < RSI_Oversold && rsiBuffer[0] > RSI_Oversold for longs, and UseHeikenAshi (true default) demands haClose[0] > haOpen[0].
GetConfirmationSignal is a second-pass verification that re-runs the same stack with a different logical frame. The selector chooses one of four branches based on the RSI method toggles: if both RSI_UseCrossoverSignals and RSI_UseDivergenceSignals are on, the branch becomes (crossover OR divergence) AND volume AND bbConfirm AND haConfirm AND macdConfirm; crossover-only drops the divergence clause; divergence-only drops the crossover clause; neither enabled falls back to rsiNotInExtremeZones (rsiBuffer[0] strictly between 30 and 70) AND volume AND bbConfirm AND haConfirm AND macdConfirm. The haConfirm requirement is the patch 1.41 design call: Heiken Ashi confirmation is not satisfied by a single bullish bar, it requires two consecutive same-direction HA candles (haUptrend = haClose[0] > haOpen[0] && haClose[1] > haOpen[1]; haDowntrend = the mirror). The bbConfirm requirement in breakout mode is the priceToBBUpperRatio = (currentPrice - bbMiddle[0]) / (bbUpper[0] - bbMiddle[0]) check needing to be greater than 0.8, or its lower-band mirror greater than 0.8 — i.e. price has to be sitting in the outer 20% of the band envelope. The macdConfirm requirement is the most permissive of the three: macdBullish (main > 0 OR two-bar up-trend in main), macdBearish (mirror), or histogramTrendOK (histogram rising into positive or falling into negative) — any of the three passes. RSI divergence, when enabled, scans a five-bar lookback for price/RSI disagreement (bullish: price1 < price2 && rsiBuffer[1] > rsiBuffer[5]; bearish: the mirror).
Position management follows the same pattern as the rest of the EX12 family. The order ticket is submitted with a fixed 50-point stop (StopLossPoints = 50 * pointValue, with pointValue multiplied ×10 for 5/3-digit brokers) and a fixed 100-point target (TakeProfitPoints = 100 * pointValue), giving a 1:2 initial RR. The pyramid-into-winners policy has three coupled toggles: AllowOnlyProfitableAdditions (true default) requires every existing same-direction ticket to clear the 20-point minimum-profit floor before another can attach; MaxOpenTrades = 5 per direction (so 5 buys + 5 sells can sit simultaneously); RequireToCheckForConfirmationBeforeAdding (true default) means every additional ticket has to clear GetConfirmationSignal a second time. The dynamic stop-lock is a per-ticket watermark in ManageDynamicStopLoss: lastHighestProfit[] tracks the peak, lockSteps = floor(peak / 30), and newSL = priceOpen + (lockSteps * 30 - 15) * pointValue (mirrored for sells), and the modify only fires when the new SL is strictly tighter than the current one. There is no opposite-signal exit and no time-based exit — the position lives until either the TP or the ratcheted stop takes it out. Three retry helpers (TryClose_EX12041, TryClosePartial_EX12041, TryModify_EX12041) handle broker REQUOTE / TIMEOUT / PRICE_OFF / PRICE_CHANGED with three attempts and 100-200 ms back-off between retries, which is what makes the 50/100 point initial ticket compatible with the ECN/RAW broker the rest of the stack assumes. The OnTester formula is the family default (the source file does not override it), so optimizer passes rank by the standard custom-criterion scoring.
In practice, the EA is a EURUSD M5 or H1 trend-day scalper. The 50/100 stop/target and the watermark step-locking assume the pair trends for 30+ points within the same trading day often enough for the ratchet to actually trigger; the 5-position per-direction cap with the 20-point directional profitability gate assumes a continuation pattern, not a mean-reversion chop. The Heiken Ashi two-candle confirmation and the bbConfirm outer-20% band check both bias entries toward momentum persistence rather than turning points, which is consistent with the breakout default in BB_UseBreakoutStrategy = true. The MACD block contributes two things: a hard entry trigger (histogram or signal-line cross) and a softer confirmation (any-direction trend witness), so MACD never blocks a signal but can fire one. The session filter is opt-in for live deployment and forced off in tester, so backtests run over the full week and live accounts can dial down to London only or to the 13-16 GMT overlap for the volatility window.
Strategy Deep Dive
Pipsgrowth EX12041's 24 functions and 62 inputs split into three pre-filters, two signal generators, and a confirmation gate. The pre-filters run inside CheckForEntry: IsMarketConditionsOK rejects the tick if current spread exceeds 5 points (or 25 points on a 5x spike), if account drawdown has crossed the 10% cap, or if the 14-bar ATR has fallen below the 0.3-point volatility floor; IsPositionManagementOK returns true for an empty book, returns true unconditionally when AllowOnlyProfitableAdditions is off, and otherwise walks every open position to confirm each is at least 20 points in profit before a pyramid; IsOptimalTradingSession short-circuits to true in the strategy tester and accepts London / New York / overlap windows when the session filter is enabled. Only then do GetBuySignal and GetSellSignal run, both AND-gating five core conditions (price vs the volatility-windowed adaptive MA, current candle direction, ATR volatility threshold, Bollinger band breakout/mean-reversion position, MACD histogram-or-signal cross) plus the optional RSI crossover and Heiken Ashi add-ons. A second pass through GetConfirmationSignal re-validates the stack with a four-branch selector — (crossover OR divergence) AND volume AND bbConfirm AND haConfirm AND macdConfirm, or the simpler variants when only one RSI method is on, falling back to the RSI-in-30-to-70 corridor check when neither is — where haConfirm requires two consecutive same-direction Heiken Ashi candles, bbConfirm demands the close sit in the outer 20% of the band envelope, and macdConfirm is the most permissive (any direction of trend witness passes). Position management runs every tick via ManagePositions → ManageDynamicStopLoss, which tracks the per-ticket lastHighestProfit watermark and steps the stop up every 30 points of peak profit, minus a 15-point buffer, never loosening. The pyramid-into-winners policy caps same-direction exposure at MaxOpenTrades = 5 and requires every additional ticket to clear the same confirmation gate plus the directional profitability check before attaching. Three retry helpers (TryClose_EX12041, TryClosePartial_EX12041, TryModify_EX12041) handle broker requotes and price-changed responses with three attempts and 100-200 ms back-off, which is what keeps the 50/100-point initial ticket compatible with an ECN/RAW execution venue.
Long entries require the close to be above the volatility-windowed adaptive MA, a bullish current candle, ATR above the 0.3-point volatility threshold, a Bollinger band position trigger (close > bbUpper in breakout mode, close < bbLower in mean-reversion mode), and an MACD trigger (histogram crossing above zero OR main line crossing above signal line). With UseRSIforEntrySignals on (default) an RSI crossover up through 30 is also required; with UseHeikenAshi on, the current HA candle must close above its open. Shorts mirror the same stack with inverted thresholds.
Exits are limited to the initial 100-point take-profit being hit, the ratcheted dynamic stop being run over, or a margin call. There is no opposite-signal exit path and no time-based exit — both directions can sit at the 5-per-direction cap simultaneously. The dynamic stop-lock ratchets the stop every 30 points of peak profit minus a 15-point buffer, never loosening once it has moved.
Each order gets a fixed 50-point stop (StopLossPoints = 50 * pointValue, with pointValue multiplied ×10 for 5/3-digit brokers) set on the ticket at submission. ManageDynamicStopLoss then ratchets it upward as profit grows (lockSteps = floor(peak / 30), newSL = priceOpen + (lockSteps * 30 - 15) * pointValue for buys, mirrored for sells), and the modify only fires when the new SL is strictly tighter than the current one.
Each order gets a fixed 100-point take-profit (TakeProfitPoints = 100 * pointValue) set on the ticket at submission — a 1:2 risk-to-reward ratio against the 50-point initial stop. The TP does not move; the dynamic ratchet acts on the stop side only, never the target side, and there is no basket TP or partial-TP ladder.
EURUSD on M5 or H1 only — the four-handle stack is tuned for that pair on those timeframes. Minimum recommended balance is $100 with the default 0.01 lot scaled up only after the 5-point MaxSpread filter and the 10% drawdown cap prove themselves on your broker. Run on a low-spread ECN or RAW venue (IC Markets, Pepperstone, Exness) where typical EURUSD spread sits inside the filter. Turn UseSessionFilter on for London-only or 13-16 GMT overlap operation, leave it off for full-week backtests and continuous-trading live accounts. The 1:2 RR plus the 30-point watermark step means the EA wants trend-day conditions; the 5-per-direction cap with the 20-point directional profitability gate means it scales exposure into winners rather than firing repeatedly into chop.
Strategy Logic
Pipsgrowth EX12041 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)
Family: MultiIndicatorConfluence
Magic: 22212041
Version: 2.00
BRIEF:
Adaptive forex scalping EA combining AMA, RSI, ATR, Bollinger Bands, MACD and Heiken Ashi confluence. Supports BB breakout/mean-reversion, MACD histogram and signal-line cross, dynamic profit locking, additional position management, session and volatility filters. Patch 1.41 refinements. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
UpdateAdaptiveIndicators()CalculateAdaptiveVolatility()CalculateAdaptiveMA()CalculateRSI()CalculateHeikenAshi()CalculateATR()CalculateBollingerBands()CalculateMACD()CheckForEntry()GetBuySignal()GetSellSignal()GetConfirmationSignal()- ...and 12 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (62 total across 11 groups):
- [=== Basic Settings ===]
EnableTrading=true// Enable trading - [=== Basic Settings ===]
EnableDebug=false// Enable debug logging - [=== Basic Settings ===]
AllowBuys=true// Allow opening buy orders - [=== Basic Settings ===]
AllowSells=true// Allow opening sell orders - [=== Basic Settings ===]
LotSize=1.0// Fixed lot size (0.01,0.01,2.0) - [=== Basic Settings ===]
MagicNumber=22212041// Magic number - [=== Basic Settings ===]
InpTradeComment= "Psgrowth.com Expert_12041" // Trade comment - [=== Basic Settings ===] Slippage = 3 // Slippage in points (1,1,10)
- [=== Risk Management ===]
MaxSpread=5.0// Maximum spread in points (1.0,0.5,10.0) - [=== Risk Management ===]
MaxDrawdownPercent=10.0// Maximum drawdown percentage (5.0,1.0,20.0) - [=== Risk Management ===]
MaxRiskPerTrade=2.0// Maximum risk per trade % (0.5,0.5,5.0) - [=== Risk Management ===]
MaxOpenTrades= 5 // Maximum open trades (1,1,10) - [=== Risk Management ===]
StopLossPoints=50.0// Stop loss in points (20.0,5.0,150.0) - [=== Risk Management ===]
TakeProfitPoints=100.0// Take profit in points (40.0,10.0,300.0) - [=== Dynamic Profit Management ===]
EnableDynamicLockProfit=true// Enable dynamic profit locking - [=== Dynamic Profit Management ===]
LockProfitEvery_X_Points=30.0// Step: every X points profit (10.0,5.0,50.0) - [=== Dynamic Profit Management ===]
LockMinusBuffer=15.0// Lock profit minus X point buffer (5.0,2.0,30.0) - [=== Dynamic Profit Management ===]
EnableDynamicProfitManagementDebug=false// Enable debug logging for dynamic profit management - [=== Additional Position Management ===]
AllowOnlyProfitableAdditions=true// Only allow adding positions if existing trades are profitable - [=== Additional Position Management ===]
MinProfitInPointsPerTradeToAdd=20.0// Minimum profit required per existing trade in points (10.0,5.0,50.0) - [=== Additional Position Management ===]
RequireToCheckForConfirmationBeforeAdding=true// Require to check active confirmation before adding new positions - [=== Additional Position Management ===]
EnableAdditionalPositionManagementDebug=false// Enable debug logging for additional position management - [=== Adaptive Indicators ===]
EnableIndicatorDebug=false// Enable debug logging for indicators - [=== Adaptive Indicators ===]
UseAMAforEntrySignals=true// UseAMAfor entry signals - [=== Adaptive Indicators ===]
UseAMAforConfirmation=true// UseAMAfor confirmation - [=== Adaptive Indicators ===]
UseRSIforEntrySignals=true// UseRSIfor entry signals - [=== Adaptive Indicators ===]
UseRSIforConfirmation=true// UseRSIfor confirmation - [=== Adaptive Indicators ===]
AdaptiveMA_Period= 14 // Adaptive MA base period (8,2,30) - [=== Adaptive Indicators ===]
AdaptiveMA_Sensitivity=2.0// Adaptive sensitivity multiplier (1.0,0.5,5.0) - [===
RSISettings ===] RSI_Period = 14 //RSIperiod (7,1,21) - [===
RSISettings ===] RSI_Oversold =30.0//RSIoversoldlevel(20.0,1.0,40.0) - [===
RSISettings ===] RSI_Overbought =70.0//RSIoverboughtlevel(60.0,1.0,80.0) - [===
RSISettings ===] RSI_UseCrossoverSignals =true// UseRSIcrossover signals - [===
RSISettings ===] RSI_UseDivergenceSignals =false// UseRSIdivergence signals - [===
RSISettings ===]EnableRSI_Debug=false// EnableRSIdebug logging - [===
ATRSettings ===] ATR_Period = 14 //ATRperiod (7,1,28) - [===
ATRSettings ===]UseATRforVolatilityFilter=true// UseATRfor volatility filtering - [===
ATRSettings ===] ATR_VolatilityMultiplier =1.0//ATRvolatility multiplier (0.5,0.1,3.0) - [===
ATRSettings ===]EnableATR_Debug=false// EnableATRdebug logging - [=== Bollinger Bands Settings ===] BB_Period = 20 // Bollinger Bands period (10,5,50)
- [=== Bollinger Bands Settings ===] BB_Deviation =
2.0// Standard deviation multiplier (1.0,0.1,3.0) - [=== Bollinger Bands Settings ===]
UseBBforEntrySignals=true// Use Bollinger Bands for entry signals - [=== Bollinger Bands Settings ===]
UseBBforConfirmation=true// Use Bollinger Bands for confirmation - [=== Bollinger Bands Settings ===] BB_UseBreakoutStrategy =
true// Use breakout strategy - [=== Bollinger Bands Settings ===] BB_UseMeanReversionStrategy =
false// Use mean reversion strategy - [=== Bollinger Bands Settings ===]
EnableBB_Debug=false// Enable Bollinger Bands debug logging - [===
MACDSettings ===] MACD_FastEMA = 12 //MACDFastEMAperiod (8,1,24) - [===
MACDSettings ===] MACD_SlowEMA = 26 //MACDSlowEMAperiod (16,2,48) - [===
MACDSettings ===] MACD_SignalPeriod = 9 //MACDSignal line period (5,1,18) - [===
MACDSettings ===]UseMACD_ForEntrySignals=true// UseMACDfor entry signals - [===
MACDSettings ===]UseMACD_ForConfirmation=true// UseMACDfor confirmation - [===
MACDSettings ===] MACD_UseHistogramCrossover =true// UseMACDhistogram crossover for signals - [===
MACDSettings ===] MACD_UseSignalLineCrossover =true// UseMACDsignal line crossover for signals - [===
MACDSettings ===]EnableMACD_Debug=false// EnableMACDdebug logging - [=== Additional Indicators ===]
UseHeikenAshi=true// Use Heiken Ashi for entry signals - [=== Additional Indicators ===]
UseHeikenAshiForConfirmation=true// Use Heiken Ashi for confirmation - [=== Additional Indicators ===]
UseVolatilityFilter=true// Use volatility filter for entries - [=== Additional Indicators ===]
VolatilityThreshold=0.3// Minimum volatility threshold in points (0.1,0.1,1.0) - [=== Session Filter ===]
UseSessionFilter=false// Use trading session filter - [=== Session Filter ===]
TradeLondonSession=true// Trade during London session (8-16GMT) - [=== Session Filter ===]
TradeNewYorkSession=true// Trade during New York session (13-21GMT) - [=== Session Filter ===]
TradeOverlapSession=true// Trade during London/NY overlap (13-16GMT)
// Pipsgrowth EX12041 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Adaptive forex scalping EA combining AMA, RSI, ATR, Bollinger Bands, MACD and Heiken Ashi confluence. Supports BB breakout/mean-reversion, MACD histogram and signal-line cross, dynamic profit locking, additional position management, session and volatility filters. Patch 1.41 refinements. 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 |
|---|---|---|
| EnableTrading | true | Enable trading |
| EnableDebug | false | Enable debug logging |
| AllowBuys | true | Allow opening buy orders |
| AllowSells | true | Allow opening sell orders |
| LotSize | 1.0 | Fixed lot size (0.01,0.01,2.0) |
| MagicNumber | 22212041 | Magic number |
| InpTradeComment | "Psgrowth.com Expert_12041" | Trade comment |
| Slippage | 3 | Slippage in points (1,1,10) |
| MaxSpread | 5.0 | Maximum spread in points (1.0,0.5,10.0) |
| MaxDrawdownPercent | 10.0 | Maximum drawdown percentage (5.0,1.0,20.0) |
| MaxRiskPerTrade | 2.0 | Maximum risk per trade % (0.5,0.5,5.0) |
| MaxOpenTrades | 5 | Maximum open trades (1,1,10) |
| StopLossPoints | 50.0 | Stop loss in points (20.0,5.0,150.0) |
| TakeProfitPoints | 100.0 | Take profit in points (40.0,10.0,300.0) |
| EnableDynamicLockProfit | true | Enable dynamic profit locking |
| LockProfitEvery_X_Points | 30.0 | Step: every X points profit (10.0,5.0,50.0) |
| LockMinusBuffer | 15.0 | Lock profit minus X point buffer (5.0,2.0,30.0) |
| EnableDynamicProfitManagementDebug | false | Enable debug logging for dynamic profit management |
| AllowOnlyProfitableAdditions | true | Only allow adding positions if existing trades are profitable |
| MinProfitInPointsPerTradeToAdd | 20.0 | Minimum profit required per existing trade in points (10.0,5.0,50.0) |
| RequireToCheckForConfirmationBeforeAdding | true | Require to check active confirmation before adding new positions |
| EnableAdditionalPositionManagementDebug | false | Enable debug logging for additional position management |
| EnableIndicatorDebug | false | Enable debug logging for indicators |
| UseAMAforEntrySignals | true | Use AMA for entry signals |
| UseAMAforConfirmation | true | Use AMA for confirmation |
| UseRSIforEntrySignals | true | Use RSI for entry signals |
| UseRSIforConfirmation | true | Use RSI for confirmation |
| AdaptiveMA_Period | 14 | Adaptive MA base period (8,2,30) |
| AdaptiveMA_Sensitivity | 2.0 | Adaptive sensitivity multiplier (1.0,0.5,5.0) |
| RSI_Period | 14 | RSI period (7,1,21) |
| RSI_Oversold | 30.0 | RSI oversold level (20.0,1.0,40.0) |
| RSI_Overbought | 70.0 | RSI overbought level (60.0,1.0,80.0) |
| RSI_UseCrossoverSignals | true | Use RSI crossover signals |
| RSI_UseDivergenceSignals | false | Use RSI divergence signals |
| EnableRSI_Debug | false | Enable RSI debug logging |
| ATR_Period | 14 | ATR period (7,1,28) |
| UseATRforVolatilityFilter | true | Use ATR for volatility filtering |
| ATR_VolatilityMultiplier | 1.0 | ATR volatility multiplier (0.5,0.1,3.0) |
| EnableATR_Debug | false | Enable ATR debug logging |
| BB_Period | 20 | Bollinger Bands period (10,5,50) |
| BB_Deviation | 2.0 | Standard deviation multiplier (1.0,0.1,3.0) |
| UseBBforEntrySignals | true | Use Bollinger Bands for entry signals |
| UseBBforConfirmation | true | Use Bollinger Bands for confirmation |
| BB_UseBreakoutStrategy | true | Use breakout strategy |
| BB_UseMeanReversionStrategy | false | Use mean reversion strategy |
| EnableBB_Debug | false | Enable Bollinger Bands debug logging |
| MACD_FastEMA | 12 | MACD Fast EMA period (8,1,24) |
| MACD_SlowEMA | 26 | MACD Slow EMA period (16,2,48) |
| MACD_SignalPeriod | 9 | MACD Signal line period (5,1,18) |
| UseMACD_ForEntrySignals | true | Use MACD for entry signals |
| UseMACD_ForConfirmation | true | Use MACD for confirmation |
| MACD_UseHistogramCrossover | true | Use MACD histogram crossover for signals |
| MACD_UseSignalLineCrossover | true | Use MACD signal line crossover for signals |
| EnableMACD_Debug | false | Enable MACD debug logging |
| UseHeikenAshi | true | Use Heiken Ashi for entry signals |
| UseHeikenAshiForConfirmation | true | Use Heiken Ashi for confirmation |
| UseVolatilityFilter | true | Use volatility filter for entries |
| VolatilityThreshold | 0.3 | Minimum volatility threshold in points (0.1,0.1,1.0) |
| UseSessionFilter | false | Use trading session filter |
| TradeLondonSession | true | Trade during London session (8-16 GMT) |
| TradeNewYorkSession | true | Trade during New York session (13-21 GMT) |
| TradeOverlapSession | true | Trade during London/NY overlap (13-16 GMT) |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX12041 EURUSD_1_41 — Adaptive AMA+RSI+ATR+BB+MACD+Heiken Ashi scalper, full 12-layer stack."
#include <Trade/Trade.mqh>
#include <Trade/PositionInfo.mqh>
#include <Trade/AccountInfo.mqh>
//--- Global objects
CTrade trade;
CPositionInfo position;
CAccountInfo account;
//--- Input parameters
input group "=== Basic Settings ==="
input bool EnableTrading = true; // Enable trading
input bool EnableDebug = false; // Enable debug logging
input bool AllowBuys = true; // Allow opening buy orders
input bool AllowSells = true; // Allow opening sell orders
input double LotSize = 1.0; // Fixed lot size (0.01,0.01,2.0)
input int MagicNumber = 22212041; // Magic number
input string InpTradeComment = "Psgrowth.com Expert_12041"; // Trade comment
input int Slippage = 3; // Slippage in points (1,1,10)
input group "=== Risk Management ==="
input double MaxSpread = 5.0; // Maximum spread in points (1.0,0.5,10.0)
input double MaxDrawdownPercent = 10.0; // Maximum drawdown percentage (5.0,1.0,20.0)
input double MaxRiskPerTrade = 2.0; // Maximum risk per trade % (0.5,0.5,5.0)
input int MaxOpenTrades = 5; // Maximum open trades (1,1,10)
input double StopLossPoints = 50.0; // Stop loss in points (20.0,5.0,150.0)
input double TakeProfitPoints = 100.0; // Take profit in points (40.0,10.0,300.0)
input group "=== Dynamic Profit Management ==="
input bool EnableDynamicLockProfit = true; // Enable dynamic profit locking
input double LockProfitEvery_X_Points = 30.0; // Step: every X points profit (10.0,5.0,50.0)
input double LockMinusBuffer = 15.0; // Lock profit minus X point buffer (5.0,2.0,30.0)
input bool EnableDynamicProfitManagementDebug = false; // Enable debug logging for dynamic profit management
input group "=== Additional Position Management ==="
input bool AllowOnlyProfitableAdditions = true; // Only allow adding positions if existing trades are profitable
input double MinProfitInPointsPerTradeToAdd = 20.0; // Minimum profit required per existing trade in points (10.0,5.0,50.0)
input bool RequireToCheckForConfirmationBeforeAdding = true; // Require to check active confirmation before adding new positions
input bool EnableAdditionalPositionManagementDebug = false; // Enable debug logging for additional position management
input group "=== Adaptive Indicators ==="
input bool EnableIndicatorDebug = false; // Enable debug logging for indicators
input bool UseAMAforEntrySignals = true; // Use AMA for entry signals
input bool UseAMAforConfirmation = true; // Use AMA for confirmation
input bool UseRSIforEntrySignals = true; // Use RSI for entry signals
input bool UseRSIforConfirmation = true; // Use RSI for confirmation
input int AdaptiveMA_Period = 14; // Adaptive MA base period (8,2,30)
input double AdaptiveMA_Sensitivity = 2.0; // Adaptive sensitivity multiplier (1.0,0.5,5.0)
input group "=== RSI Settings ==="
input int RSI_Period = 14; // RSI period (7,1,21)
input double RSI_Oversold = 30.0; // RSI oversold level (20.0,1.0,40.0)
input double RSI_Overbought = 70.0; // RSI overbought level (60.0,1.0,80.0)
input bool RSI_UseCrossoverSignals = true; // Use RSI crossover signals
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.