Pipsgrowth EX12042 MultiIndicatorConfluence
MT5 Expert Advisor (Open Source) · EURUSD · M5, H1
Pipsgrowth.com EX12042 EURUSD_1_41 — Adaptive AMA+RSI+ATR+MACD+Heiken Ashi scalper (BB off), full 12-layer stack.
Overview
Pipsgrowth EX12042 MultiIndicatorConfluence is the deliberately stripped-back production cut of the EX12 family — the .mq5 header flags it as Patch 1.41 with Bollinger Bands disabled by default, and the brief in the comment block reiterates the design choice: the full 62-input, 11-group parameter surface ships intact, the four native MT5 indicator handles (iRSI(14), iATR(14), iBands(20, 2.0) and iMACD(12, 26, 9)) are still created on init when the relevant flags fire, but the actual trade-decision path is reduced to one comparison: bar close versus an adaptive moving average, with a single RSI-corridor confirmation and a spread gate. Everything else in the input panel — BB strategies, MACD crossovers, HA confluence, dynamic profit lock, session windows — is present for inspection and for the user who wants to wire it back in, but the live code does not read those flags. This is the family member to choose when a trader wants the trend-MA core without paying the false-signal cost of the full multi-confirmation AND-stack on a choppy FX major.
The four handles are allocated conditionally, and the condition is what differentiates the live footprint from the apparent one. OnInit builds the iRSI handle only if UseRSIforEntrySignals || UseRSIforConfirmation is true (both default true, so the handle is created), the iATR handle only if UseATRforVolatilityFilter is true (default true), the iBands handle only if either UseBBforEntrySignals or UseBBforConfirmation flips on (both default false, so the iBands handle is not created in a default install), and the iMACD handle only if UseMACD_ForEntrySignals or UseMACD_ForConfirmation is true (both default true, so the MACD handle is created and refreshed on every tick even though the live signal path never consults macdMain, macdSignal or macdHistogram). The buffers rsiBuffer, atrBuffer, bbUpper/Middle/Lower, macdMain/Signal/Histogram are all 100-element arrays pre-populated to neutral zeros; the CalculateRSI / CalculateATR / CalculateBollingerBands / CalculateMACD functions run on every tick via UpdateAdaptiveIndicators() and stay live for back-test graph rendering and for the throttled Enable*_Debug logs, but their values do not feed GetBuySignal, GetSellSignal or GetConfirmationSignal in the entry pipeline.
The trend test is the entire entry decision. GetBuySignal returns true iff iClose(_Symbol, PERIOD_CURRENT, 0) is strictly greater than adaptiveMA[0], and GetSellSignal is the symmetric opposite. The adaptiveMA itself is a volatility-windowed simple moving average — not a Kaufman AMA despite the input name CalculateAdaptiveMA() — produced by summing the last adaptivePeriod closes and dividing by the valid-bar count, where adaptivePeriod is recomputed each tick by CalculateAdaptiveVolatility() as round(AdaptiveMA_Period / (1 + (volRatio - 1) * AdaptiveMA_Sensitivity)) and clamped to a 5–50 bar band. The defaults are AdaptiveMA_Period=14 and AdaptiveMA_Sensitivity=2.0, which means a quiet market widens the period (smooths the average) and a noisy one contracts it. Heiken Ashi is also built in code (haClose = (O+H+L+C)/4, haOpen[0] = (O+C)/2 then recursive, with the four arrays exposed for graphs), but the HA values are likewise never read by the entry functions. The HA arrays are kept warm for the throttled debug print and for back-test rendering only.
Confirmation is a single RSI corridor test. GetConfirmationSignal returns rsiBuffer[0] > RSI_Oversold (30.0 default) AND rsiBuffer[0] < RSI_Overbought (70.0 default). There is no crossover, no divergence, no multi-confirmation AND-stack — the inputs RSI_UseCrossoverSignals, RSI_UseDivergenceSignals, MACD_UseHistogramCrossover, MACD_UseSignalLineCrossover, BB_UseBreakoutStrategy and BB_UseMeanReversionStrategy are exposed in the input panel for surface parity with the rest of the EX12 family but are not consulted by the live code. IsMarketConditionsOK is a one-line function: it returns false iff SYMBOL_SPREAD in points exceeds MaxSpread (5.0 default) and otherwise lets the entry through. The header advertises an ATR volatility filter, but the live gate does not check atrBuffer[0] at all; the ATR handle is created and the buffer populated, but no minimum-volatility or maximum-volatility branch runs in the entry pipeline. VolatilityThreshold=0.3 is exposed and accepted, but the code that should consume it is absent.
Two of the filters that look active in the input panel are stubs. ManagePositions is a one-line wrapper: it checks EnableDynamicLockProfit and then does nothing — the comment in the source says 'Dynamic profit management would go here'. The watermark step-locking stop, the lastHighestProfit[] per-ticket array, the 30-pt step, the 15-pt buffer and the ratchet-only-tightens logic that the rest of the EX12 family implements are all absent from this build, so a trade that runs into profit will not get a tightened stop unless the trader manually intervenes. IsOptimalTradingSession is similarly stubbed: it honours the UseSessionFilter bool (default false), but inside the active branch it returns true unconditionally with the comment 'always return true for now'. The London 8-16 / NY 13-21 / Overlap 13-16 GMT definitions exist as inputs (TradeLondonSession, TradeNewYorkSession, TradeOverlapSession) but the code never reads them. The 24-hour trading window is a design choice of patch 1.41, not a bug — the trader is expected to apply the session filter at the broker side or to wire it up via a future patch.
Risk and position management are intact. The order ticket always carries an initial stop-loss at ask ± StopLossPoints * pointValue (50 pts default for 5-digit brokers, 500 pts raw for 4-digit) and a take-profit at the symmetric opposite (100 pts default, giving a 1:2 risk-to-reward ratio). MaxOpenTrades=5 by default applies per direction — CheckPositionTypes walks PositionsTotal() filtering by symbol and magic, and canAddBuy / canAddSell each independently gate on its own count, so up to 5 buys and 5 sells can coexist as long as the directional profitability condition is met. AllowOnlyProfitableAdditions=true by default and RequireToCheckForConfirmationBeforeAdding=true by default; together they require that any additional ticket in an existing direction be (a) preceded by GetConfirmationSignal returning true and (b) preceded by IsPositionDirectionProfitable() confirming that the existing same-direction tickets have an average profit >= MinProfitInPointsPerTradeToAdd * _Point (20 pts default). MaxDrawdownPercent is a hard cap of 10.0% on account equity, read from the input each tick. MaxRiskPerTrade is exposed at 2.0% but the actual lot sizing uses the fixed LotSize input (1.0 default) — the percentage risk field is informational only and is not consulted by the lot calculation.
The retry stack is the family-standard three helpers. TryClose_EX12042 wraps trade.PositionClose in a 3-attempt loop with a 200 ms Sleep on TRADE_RETCODE_REQUOTE / TIMEOUT / PRICE_OFF / PRICE_CHANGED. TryClosePartial_EX12042 does the same for trade.PositionClosePartial. TryModify_EX12042 wraps trade.PositionModify with a 100 ms Sleep on REQUOTE / TIMEOUT — the tighter window suits modification, which is more quote-sensitive than closing. All three return false after the third failure so the EA can fall back to a future tick. ErrorDescription is a hand-rolled switch on the standard MT5 error codes 131, 133, 134, 138, 146, 4106, 4107, 4108, 4109, 4110, 4051, 4075, 4076 plus a default 'Unknown error N' branch, and the failed-order branches in CheckForEntry print the human-readable string plus the account balance / free margin / required margin when the error is 134 or 4076 (not enough money). The OnTick flow is short and explicit: it returns early on EnableTrading=false or when iClose(0) is zero, detects a new bar by comparing totalBars to the current iBars count, calls UpdateAdaptiveIndicators() to refresh all five indicator buffers, calls ManagePositions() (the stub), and on a new bar calls CheckForEntry().
The right deployment for this EA is the trend-following use case the lean code was written for. EURUSD on M5 or H1, $100 minimum account, 0.01 lots on a no-dealing-desk broker with a raw-spread account where the spread stays comfortably under the 5-pt MaxSpread cap. A trader who wants the trailing stop, the BB breakout filter or the session window from the EX12 family should pick a non-Patch-1.41 variant instead — this build's input panel exposes those features for inspection and the handles stay warm for back-testing, but the live logic does not run them. The 10% MaxDrawdownPercent is the load-bearing safety net: with no watermark ratchet on individual trades, a sudden adverse move can only be limited by the ticket-level 50 pt SL, so the account-level drawdown cap is what keeps the strategy survivable through a fast-whip session.
Strategy Deep Dive
OnInit allocates up to four native MT5 indicator handles conditionally: iRSI(14) if UseRSIforEntrySignals or UseRSIforConfirmation is true (both default true), iATR(14) when UseATRforVolatilityFilter is true (default true), iBands(20, 2.0) only when a BB flag flips on (both default false, so the iBands handle is not created in a default install), and iMACD(12, 26, 9) when either MACD flag is true (both default true, so the MACD handle is allocated and refreshed even though the live signal path never reads macdMain, macdSignal or macdHistogram). The five Calculate* functions then run on every tick through UpdateAdaptiveIndicators(), keeping the buffers warm for back-test graph rendering and for the throttled debug logs, but feeding only one of them into the live decision. GetBuySignal returns currentPrice > adaptiveMA[0] and GetSellSignal returns currentPrice < adaptiveMA[0], where adaptiveMA is a volatility-windowed simple moving average produced by CalculateAdaptiveMA() with period recomputed each tick as round(AdaptiveMA_Period / (1 + (volRatio-1) * AdaptiveMA_Sensitivity)) clamped to 5-50. GetConfirmationSignal gates the entry with the single test rsiBuffer[0] > 30 AND rsiBuffer[0] < 70. IsMarketConditionsOK rejects only on spread > MaxSpread (5.0 default). The order ticket carries ask ± StopLossPoints*pointValue (50 pt default) and the symmetric TakeProfit (100 pt default). ManagePositions is a one-line stub for the dynamic profit lock, IsOptimalTradingSession is a one-line stub for the session filter, so the only exits are the ticket-level SL/TP and the 10% MaxDrawdownPercent cap. The 3 retry helpers (TryClose_EX12042 / TryClosePartial_EX12042 / TryModify_EX12042) handle REQUOTE / TIMEOUT / PRICE_OFF / PRICE_CHANGED on close (200 ms) and on modify (100 ms).
Long entries trigger when the bar close is strictly above the adaptive moving average; short entries trigger when the bar close is strictly below it. The only confirmation is the RSI corridor: rsiBuffer[0] must sit in the [RSI_Oversold=30.0, RSI_Overbought=70.0] band. The adaptiveMA is a volatility-windowed simple moving average whose period stretches 5–50 bars based on the volRatio of current vs average bar range (AdaptiveMA_Period=14, AdaptiveMA_Sensitivity=2.0). Spread must be at or below MaxSpread=5.0 points. Per-direction MaxOpenTrades=5; an additional ticket in an existing direction also requires RequireToCheckForConfirmationBeforeAdding=true and a positive average profit on the existing same-direction tickets (>= MinProfitInPointsPerTradeToAdd=20 pts).
Each ticket carries a fixed initial take-profit at 100 pts (TakeProfitPoints default) and a fixed initial stop-loss at 50 pts (StopLossPoints default), set on the order ticket. There is no opposite-signal close, no time-based exit, and no partial-close logic in the live path. The dynamic profit-lock input (EnableDynamicLockProfit=true default, 30-pt step, 15-pt buffer) is exposed in the input panel, but the ManagePositions function that should run it is a one-line stub that does nothing. Positions close only when the ticket-level SL or TP is hit, when the 10% MaxDrawdownPercent account cap triggers, or on a manual stop.
Per-trade initial stop-loss is fixed at 50 points (StopLossPoints * pointValue, where pointValue is _Point*10 on 5-digit / 3-digit brokers) on every order ticket. There is no ratchet, no break-even step and no watermark trailing — the dynamic profit-lock machinery is exposed in the input panel but the ManagePositions function that should run it is unimplemented. The 10% MaxDrawdownPercent acts as a hard account-level kill switch.
Per-trade take-profit is fixed at 100 points (TakeProfitPoints * pointValue), giving a 1:2 risk-to-reward ratio versus the 50-pt initial stop. The TP is set on the order ticket and is hit-or-miss — no scaling out, no partial close, no multi-target management in the live code path.
Built for EURUSD on M5 or H1, $100 minimum account, 0.01 lots on a no-dealing-desk broker with a raw-spread account and consistent sub-50ms round-trip latency. The Patch 1.41 lean core (bar close vs adaptive MA + RSI corridor) needs a quiet-to-moderate volatility regime to feed the trend signal cleanly — a chaotic ATR environment will contract the adaptive period toward 5 bars and produce whippy signals. The 50 pt SL / 100 pt TP / 1:2 RR profile fits a 100–150 pt per-session swing, so any broker time zone works as long as the spread stays comfortably under MaxSpread=5.0 points. Risk: MEDIUM. Not for accounts under $100, not for pairs outside EURUSD, not for traders who want the trailing watermark stop or the BB+MACD+HA confluence or the session window — those features are visible in the input panel but the live code does not run them.
Strategy Logic
Pipsgrowth EX12042 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)
Family: MultiIndicatorConfluence
Magic: 22212042
Version: 2.00
BRIEF:
Adaptive forex scalping EA combining AMA, RSI, ATR, Bollinger Bands (disabled), MACD and Heiken Ashi confluence. Supports MACD histogram and signal-line cross, dynamic profit locking, additional position management, session and volatility filters. Patch 1.41 variant with BB off by default. 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()TestTradeExecution()ErrorDescription()CheckTradingCapabilities()- ...and 13 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=22212042// Magic number - [=== Basic Settings ===]
InpTradeComment= "Psgrowth.com Expert_12042" // 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=false// Use Bollinger Bands for entry signals - [=== Bollinger Bands Settings ===]
UseBBforConfirmation=false// Use Bollinger Bands for confirmation - [=== Bollinger Bands Settings ===] BB_UseBreakoutStrategy =
false// 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 EX12042 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Adaptive forex scalping EA combining AMA, RSI, ATR, Bollinger Bands (disabled), MACD and Heiken Ashi confluence. Supports MACD histogram and signal-line cross, dynamic profit locking, additional position management, session and volatility filters. Patch 1.41 variant with BB off by default. 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 | 22212042 | Magic number |
| InpTradeComment | "Psgrowth.com Expert_12042" | 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 | false | Use Bollinger Bands for entry signals |
| UseBBforConfirmation | false | Use Bollinger Bands for confirmation |
| BB_UseBreakoutStrategy | false | 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 EX12042 EURUSD_1_41 — Adaptive AMA+RSI+ATR+MACD+Heiken Ashi scalper (BB off), 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 = 22212042; // Magic number
input string InpTradeComment = "Psgrowth.com Expert_12042"; // 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.