Pipsgrowth EX16061 Trend
MT5 Expert Advisor (Open Source) · XAUUSD · M5
Pipsgrowth.com EX16061 OptimizedEA -- Optimized multi-indicator EA with RSI, MBS, Magic indicator and adaptive confirmation, full 12-layer stack.
Overview
Pipsgrowth EX16061 Trend is built around a single, almost stubborn idea: the only setups worth trading are the ones where structure, momentum, and volatility all line up at the same bar. Most indicator systems treat signals as independent votes. EX16061 treats them as a chain — one indicator proposes, the next filter checks whether the proposal is credible, the third filter verifies the market is actually moving, and only then does the EA risk a position. The proposal/filter/verify logic is what the source code calls a 12-layer architecture: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, and OnTester fitness.
Out of the box, only two of those indicator layers are actually switched on for entry. The Momentum Breakout Structure (MBS) layer has both MBS_EntrySignal_BUY and MBS_EntrySignal_SELL enabled. The Donchian Channel layer also has both DC_EntrySignal_BUY and DC_EntrySignal_SELL enabled. Every other entry layer — RSI, HMA (Hull Moving Average), and the proprietary Magic indicator — is shipped disabled. The 182 input parameters let the trader wake any of those layers up and decide whether each one votes as an entry signal, a confirmation, an exit trigger, or an exit confirmation. By default the EA therefore opens on a Donchian channel breakout that the MBS layer has signed off on, with no further confirmations required.
The MBS layer (MBS_Decision()) reads its own Higher Timeframe through g_MBS_Timeframe, looks back MBS_LookbackBars bars for structure, and only fires when a breakout is at least MBS_MinBreakoutSize points. It then checks momentum (MBS_MomentumThreshold, default 0.7) and trend strength (MBS_TrendStrengthMin, default 0.6) before the signal becomes a candidate. Volume has to spike by MBS_VolumeMultiplier (1.5x) and the breakout has to clear an ATR filter based on MBS_ATRPeriod (14) and MBS_ATRMultiplier (1.0). The Donchian layer (DonchianChannel_Decision()) reads DC_ChannelPeriod (20) bars of high/low and only accepts breakouts that exceed DC_MinBreakoutPoints (10) with DC_ConfirmationBars (2) bars of confirmation. A pullback filter (DC_MinPullbackPoints) and a minimum channel range (DC_MinRangePoints, 20 points) prevent the EA from trading in noise.
Every new bar the EA re-evaluates the whole chain. ProcessTradingLogic() first calls ClassifyRegime() to decide whether the chart is trending, ranging, or volatile. If the regime does not pass, the entry is rejected before any signal is generated. The No-Trade Gate then runs through IsMarketOpen(), IsSpreadAcceptable() (rejects if MaxSpread = 30.0 is breached), IsWithinSession() (London 8–17 and New York 13–22 by default, both UseSessionLondon and UseSessionNewYork true), the MaxOpenTrades cap (5), the MaxDrawdownPercent (10.0%) hard stop, and the MaxRiskPerTrade (2.0%) per-trade cap. A KillSwitch and consecutive-loss counter add an extra safety layer if a streak of losses occurs.
Position sizing uses a fixed LotSize of 0.01 — the EA does not derive lot from the risk percentage, the MaxRiskPerTrade input is a guardrail rather than a sizing formula. The ExecuteTrade() function hands the order to the standard CTrade instance with ORDER_FILLING_FOK, 3 points of slippage, and the magic number 22216061 hard-coded as the MagicNumber input and also burned into the g_MagicNumber constant. Each open gets the comment Psgrowth.com Expert_16061 so it is easy to filter in the terminal.
The 12-layer architecture is more than a marketing label. Look at the function list: the time subsystem is its own layer (10 functions: GetAdjustedTime(), IsWithinSession(), IsSessionActive(), IsSessionOverlap(), IsEndOfDayTime(), IsEndOfWeekTime(), IsTradingDay(), IsNewsTime(), IsTimeBasedEntryPaused(), IsTimeFilterValid(), plus ManageEODPositions() and ManageEOWPositions() for forced closes). The signal subsystem is another layer (RSI_Decision(), MBS_Decision(), DonchianChannel_Decision(), HMA_Decision(), plus a parallel Magic_Decision() plus CheckRSIConfirmation(), CheckMBSConfirmation(), CheckDCConfirmation(), CheckHMAConfirmation(), CheckMagicConfirmation()). The trade-management layer runs the profit lock — EnableDynamicLockProfit (true by default) means LockProfitEvery_X_Points (30.0) the EA ratchets the stop by LockMinusBuffer (15.0) points behind the current price, every 30 points of profit. A CanAddNewPosition() gate enforces the AllowOnlyProfitableAdditions rule: the EA will only pyramid onto an existing position if every other open position is already at least MinProfitInPointsPerTradeToAdd (20) points in profit.
The Magic indicator deserves a special note. It is the EA's own custom signal: GetMagicBandsBuffer() returns a volatility envelope, GetMagicATR() reads its ATR, GetMagicEMA_HTF() reads a higher-timeframe EMA, and MagicFilter() decides whether price action is inside the bands or breaking out. The UseAutoFilter switch (true by default) lets the bands adapt to the symbol's recent volatility instead of using fixed distances. Even with UseMagic_Decision enabled, the Magic indicator's individual buy/sell flags are off by default — turning them on lets Magic act as an entry signal of its own. The same is true for RSI (period 14, oversold 30, overbought 70) and the HMA (period 21, ATR noise filter at 1.5×). Each of these can vote as a signal, a confirmation, an exit trigger, or an exit confirmation — the trader chooses the role.
A real-world setup usually looks like this: leave MBS and Donchian as your entry triggers (the defaults), turn on RSI_Confirm_BUY so a long only fires when RSI(14) on the chosen higher timeframe is above 50, turn on HMA_Confirm_BUY so the HMA(21) slope is positive, leave the Magic indicator as a confirmation-only filter via UseMagic_Decision, and let the trailing profit lock manage the exit. The result is an EA that opens a handful of high-conviction positions per session instead of dozens of marginal ones. If you want more signals, enable RSI entries and disable the Donchian ones; if you want fewer but cleaner signals, add a 1-bar delay via EnableDelayFilter (off by default) and require pullback confirmation in the Donchian filter.
The OnTester() block is the last layer. It builds a custom fitness function that weights Recovery Factor, ROI, Profit Factor, trade count, Sharpe ratio, and inverse drawdown, so the MT5 Strategy Tester's optimization pass ranks parameter combinations by a composite score rather than raw profit. That is the practical reason there are 182 inputs — the file is built to be optimized, not to be hand-tuned on a live chart. For live use, the safer move is to lock the inputs the tester found and disable EnableTrading only when you are not actively monitoring the EA.
Because the EA has a 10% hard drawdown cap and a 2% per-trade risk ceiling, the recommended capital is at least 1,000 USD on a micro-lot account so the first losing streak does not threaten the 10% floor. The default LotSize = 0.01 keeps margin usage small on FX majors and moderate on XAUUSD. Slippage is set to 3 points and the magic number 22216061 is reserved, so the EA can run alongside other PipsGrowth EX-series EAs without position-accounting collisions. The comment string Psgrowth.com Expert_16061 makes it easy to filter the trade history by EA in the MT5 terminal.
Strategy Deep Dive
On every new bar the EA re-evaluates the full 12-layer chain. ProcessTradingLogic() calls ClassifyRegime() first — if the chart is not in a confirmed trend or high-volatility breakout state, the rest of the chain is skipped. The No-Trade Gate then checks IsMarketOpen(), IsSpreadAcceptable() against MaxSpread (30 points), IsWithinSession() (London 8–17 + New York 13–22 GMT by default), MaxOpenTrades (5), the 10% drawdown cap, and the 2% per-trade risk ceiling. The two active entry layers — MBS_Decision() and DonchianChannel_Decision() — then vote; both must agree on direction for a signal to become a candidate, and any optional confirmations (RSI, HMA, Magic — all default off) can be layered on top. Sizing uses a fixed LotSize (0.01) and orders are sent via ExecuteTrade() with ORDER_FILLING_FOK and 3 points of slippage. Open positions are managed tick-by-tick by ManageOpenPositions(): the dynamic profit-lock ratchets the stop every 30 points, and the time subsystem runs ManageEODPositions() / ManageEOWPositions() for forced closes if those filters are enabled. The OnTester() block builds a composite fitness score (weighted Recovery Factor, ROI, Profit Factor, trade count, Sharpe, inverse drawdown) so MT5's optimizer ranks parameter sets by a balanced score rather than raw profit.
On every new bar the EA re-runs the 12-layer chain. The default-on entry layers are MBS (Momentum Breakout Structure) and Donchian Channel. A long entry requires the MBS layer to confirm a structure breakout of at least MBS_MinBreakoutSize (50) points with momentum above 0.7 and trend strength above 0.6, while the Donchian layer must validate a 20-bar channel breakout exceeding DC_MinBreakoutPoints (10) with 2 bars of confirmation. The No-Trade Gate must pass: market open, spread below MaxSpread (30 points), session active, fewer than MaxOpenTrades (5) positions, drawdown below MaxDrawdownPercent (10.0%), and per-trade risk below MaxRiskPerTrade (2.0%).
Exit is governed by either a reverse-signal flip from the active entry layer (MBS or Donchian printing against the open position) or by the dynamic profit-lock ratchet in ManageOpenPositions(). The ratchet is on by default: every 30 points of unrealized profit (LockProfitEvery_X_Points) the stop is pulled to price minus LockMinusBuffer (15) points. Optional exit triggers from RSI, HMA, MBS, Donchian, and Magic layers (all default off) can be turned on to fire additional closes, and the time subsystem will force-close all positions via ManageEODPositions() or ManageEOWPositions() if the relevant end-of-day or end-of-week filter is enabled.
Initial stop-loss is fixed at StopLossPoints (100 points, equivalent to $1.00 on a 0.01-lot XAUUSD position) and is attached at entry. A 10.0% hard drawdown cap (MaxDrawdownPercent) acts as the global account-level stop, and the 2.0% per-trade risk ceiling (MaxRiskPerTrade) prevents any single position from jeopardizing the equity curve. Once the trade is in profit, the dynamic lock ratchets the stop every 30 points to lock in gains without cutting the move short.
There is no fixed take-profit level — TakeProfitPoints (200 points) is declared in the input block but the EA's management philosophy is to let winners run. The dynamic profit-lock ratchet (LockProfitEvery_X_Points = 30, LockMinusBuffer = 15) is the primary exit mechanism, effectively behaving as a chandelier trailing stop. The pyramid guard AllowOnlyProfitableAdditions and the MinProfitInPointsPerTradeToAdd (20-point) gate let the EA add to a position only when the existing trade is already in profit, scaling into strength rather than into weakness.
Best deployed on XAUUSD M5 with the default 0.01-lot sizing. Minimum recommended balance is $1,000 to absorb a realistic losing streak before the 10% drawdown cap triggers; the platform's hard $100 minimum is too thin for the EA's 100-point initial stop and 2% per-trade risk. Use a low-spread ECN broker with sub-1-pip spreads on gold (or sub-0.5 pip on the major FX pairs the file is portable to) so the 30-point MaxSpread does not block the majority of breakouts. The default-active London 8–17 + New York 13–22 GMT session window is the right trading window for XAUUSD — outside those hours the structure-breakout rate drops and the Donchian filter starts producing false positives. The MEDIUM risk label is honest: with MaxRiskPerTrade = 2.0% and MaxDrawdownPercent = 10.0% the EA is not a low-risk grid, but the per-trade ceiling plus the profit-lock ratchet make it considerably calmer than a martingale or uncontrolled breakout EA.
Strategy Logic
Pipsgrowth EX16061 Trend — Strategy Logic Analysis (from .mq5 source)
Family: Trend
Magic: 22216061
Version: 2.00
BRIEF:
Optimized Expert Advisor addressing 100+ performance and structure issues, combining RSI entry signals, Momentum Breakout Structure (MBS), Magic indicator and adaptive confirmation for USDJPY with dynamic profit management. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
GetAdjustedTime()ValidateTimeInputs()IsWithinSession()IsSessionActive()IsSessionOverlap()IsEndOfDayTime()IsEndOfWeekTime()IsTradingDay()IsNewsTime()IsTimeBasedEntryPaused()IsTimeFilterValid()ManageEODPositions()- ...and 51 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (182 total across 21 groups):
- [===
BASICSETTINGS===]EnableTrading=true// Enable trading - [===
BASICSETTINGS===]EnableDebug=false// Enable debug logging - [===
BASICSETTINGS===]LotSize=0.01// Fixed lot size - [===
BASICSETTINGS===]MagicNumber=22216061// Magic number - [===
BASICSETTINGS===]InpTradeComment= "Psgrowth.com Expert_16061" // Trade comment - [===
BASICSETTINGS===] Slippage = 3 // Slippage in points - [===
RISKMANAGEMENT===]MaxSpread=30.0// Maximum spread in points - [===
RISKMANAGEMENT===]MaxDrawdownPercent=10.0// Maximum drawdown percentage - [===
RISKMANAGEMENT===]MaxRiskPerTrade=2.0// Maximum risk per trade % - [===
RISKMANAGEMENT===]MaxOpenTrades= 5 // Maximum open trades - [===
RISKMANAGEMENT===]StopLossPoints=100.0// Stop loss in points - [===
RISKMANAGEMENT===]TakeProfitPoints=200.0// Take profit in points - [===
DYNAMICPROFITMANAGEMENT===]EnableDynamicLockProfit=true// Enable dynamic profit locking - [===
DYNAMICPROFITMANAGEMENT===]LockProfitEvery_X_Points=30.0// Step: every X points profit - [===
DYNAMICPROFITMANAGEMENT===]LockMinusBuffer=15.0// Lock profit minus X point buffer - [===
POSITIONMANAGEMENT===]AllowOnlyProfitableAdditions=true// Only allow adding positions if existing trades are profitable - [===
POSITIONMANAGEMENT===]MinProfitInPointsPerTradeToAdd=20.0// Minimum profit required per existing trade in points - [===
RSISETTINGS===] RSI_EntrySignal_BUY =false// EnableRSIBUYentry signal - [===
RSISETTINGS===] RSI_EntrySignal_SELL =false// EnableRSISELLentry signal - [===
RSISETTINGS===] RSI_Confirm_BUY =false// RequireRSIBUYconfirmation - [===
RSISETTINGS===] RSI_Confirm_SELL =false// RequireRSISELLconfirmation - [===
RSISETTINGS===] RSI_ExitTrigger_BUY =false// EnableRSIBUYexit trigger - [===
RSISETTINGS===] RSI_ExitTrigger_SELL =false// EnableRSISELLexit trigger - [===
RSISETTINGS===] RSI_ExitConfirm_BUY =false// RequireRSIBUYexit confirmation - [===
RSISETTINGS===] RSI_ExitConfirm_SELL =false// RequireRSISELLexit confirmation - [===
RSISETTINGS===]RSI_TF= 0 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Timeframe forRSI - [===
RSISETTINGS===] RSI_Period = 14 //RSIperiod - [===
RSISETTINGS===] RSI_Price = 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Applied price forRSI - [===
RSISETTINGS===] RSI_Overbought =70.0//RSIoverboughtlevel - [===
RSISETTINGS===] RSI_Oversold =30.0//RSIoversoldlevel - [===
RSISETTINGS===] RSI_SignalShift = 0 // Shift forRSIsignal line - [===
RSISETTINGS===] RSI_Midline = 50 //RSImidlinelevel - [===
RSISETTINGS===] RSI_ExtremeBuffer = 5 // Buffer for extreme levels - [===
RSISETTINGS===] RSI_MinRange =5.0// MinimumRSIrange for valid signal - [===
RSISETTINGS===] RSI_MinVolatility =2.0// Minimum volatility threshold - [===
RSISETTINGS===] RSI_MomentumBars = 3 // Bars for momentum confirmation - [===
RSISETTINGS===] RSI_DeadZoneSize =5.0// Dead zone around midline - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_EntrySignal_BUY =true// EnableMBSBUYentry signal - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_EntrySignal_SELL =true// EnableMBSSELLentry signal - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_Confirm_BUY =false// RequireMBSBUYconfirmation - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_Confirm_SELL =false// RequireMBSSELLconfirmation - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_ExitTrigger_BUY =false// EnableMBSBUYexit trigger - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_ExitTrigger_SELL =false// EnableMBSSELLexit trigger - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_ExitConfirm_BUY =false// RequireMBSBUYexit confirmation - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_ExitConfirm_SELL =false// RequireMBSSELLexit confirmation - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_Timeframe = 0 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Timeframe for analysis - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_LookbackBars = 20 // Lookback period for structure analysis - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_MinBreakoutSize = 50 // Minimum breakout size in points - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_MomentumThreshold =0.7// Momentum strength threshold (0-1) - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_ConfirmationBars = 2 // Bars needed for confirmation - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_VolatilityFilter =1.5// Volatility filter multiplier - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_TrendStrengthMin =0.6// Minimum trend strength (0-1) - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_RequireVolumeSpike =true// Require volume confirmation - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_VolumeMultiplier =1.5// Volume spike multiplier - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_ATRPeriod = 14 //ATRperiod for volatility - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_ATRMultiplier =1.0//ATRmultiplier for breakout validation - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_EMAPeriod = 21 //EMAperiod for trend direction - [===
MOMENTUM+STRUCTUREBREAKOUTSETTINGS===] MBS_MinPriceMovement =0.0001// Minimum price movement for signal - [===
DONCHIANCHANNELSETTINGS===] DC_EntrySignal_BUY =true// Enable Donchian ChannelBUYentry signal - [===
DONCHIANCHANNELSETTINGS===] DC_EntrySignal_SELL =true// Enable Donchian ChannelSELLentry signal - [===
DONCHIANCHANNELSETTINGS===] DC_Confirm_BUY =false// Require Donchian ChannelBUYconfirmation - [===
DONCHIANCHANNELSETTINGS===] DC_Confirm_SELL =false// Require Donchian ChannelSELLconfirmation - [===
DONCHIANCHANNELSETTINGS===] DC_ExitTrigger_BUY =false// Enable Donchian ChannelBUYexit trigger - [===
DONCHIANCHANNELSETTINGS===] DC_ExitTrigger_SELL =false// Enable Donchian ChannelSELLexit trigger - [===
DONCHIANCHANNELSETTINGS===] DC_ExitConfirm_BUY =false// Require Donchian ChannelBUYexit confirmation - [===
DONCHIANCHANNELSETTINGS===] DC_ExitConfirm_SELL =false// Require Donchian ChannelSELLexit confirmation - [===
DONCHIANCHANNELSETTINGS===] DC_Timeframe = 0 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Timeframe for Donchian Channel - [===
DONCHIANCHANNELSETTINGS===] DC_ChannelPeriod = 20 // Lookback period for channel - [===
DONCHIANCHANNELSETTINGS===] DC_ConfirmationBars = 2 // Bars needed for confirmation - [===
DONCHIANCHANNELSETTINGS===] DC_MinBreakoutPoints = 10 // Minimum breakout size in points - [===
DONCHIANCHANNELSETTINGS===] DC_ATRMultiplier =1.0//ATRmultiplier for volatility filter - [===
DONCHIANCHANNELSETTINGS===] DC_ATRPeriod = 14 //ATRperiod for volatility - [===
DONCHIANCHANNELSETTINGS===] DC_RequireVolumeSpike =false// Require volume spike confirmation - [===
DONCHIANCHANNELSETTINGS===] DC_VolumeMultiplier =1.5// Volume spike multiplier - [===
DONCHIANCHANNELSETTINGS===] DC_MinPullbackPoints = 5 // Minimum pullback before breakout - [===
DONCHIANCHANNELSETTINGS===] DC_MinRangePoints = 20 // Minimum channel range to avoid chop - [===
HULLMOVINGAVERAGESETTINGS===] HMA_EntrySignal_BUY =false// EnableHMABUYentry signal - [===
HULLMOVINGAVERAGESETTINGS===] HMA_EntrySignal_SELL =false// EnableHMASELLentry signal - [===
HULLMOVINGAVERAGESETTINGS===] HMA_Confirm_BUY =false// RequireHMABUYconfirmation - [===
HULLMOVINGAVERAGESETTINGS===] HMA_Confirm_SELL =false// RequireHMASELLconfirmation - [===
HULLMOVINGAVERAGESETTINGS===] HMA_ExitTrigger_BUY =false// EnableHMABUYexit trigger - [===
HULLMOVINGAVERAGESETTINGS===] HMA_ExitTrigger_SELL =false// EnableHMASELLexit trigger - [===
HULLMOVINGAVERAGESETTINGS===] HMA_ExitConfirm_BUY =false// RequireHMABUYexit confirmation - [===
HULLMOVINGAVERAGESETTINGS===] HMA_ExitConfirm_SELL =false// RequireHMASELLexit confirmation - [===
HULLMOVINGAVERAGESETTINGS===] HMA_Timeframe = 0 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Timeframe forHMAanalysis - [===
HULLMOVINGAVERAGESETTINGS===] HMA_Period = 21 //HMAperiod - [===
HULLMOVINGAVERAGESETTINGS===] HMA_ConfirmationBars = 2 // Bars needed for confirmation - [===
HULLMOVINGAVERAGESETTINGS===] HMA_MinSlopeAngle =0.0001// Minimum slope angle for trend detection - [===
HULLMOVINGAVERAGESETTINGS===] HMA_MinMomentumPoints = 5 // Minimum momentum in points - [===
HULLMOVINGAVERAGESETTINGS===] HMA_RequirePriceAbove =true// Require price aboveHMAfor buy - [===
HULLMOVINGAVERAGESETTINGS===] HMA_RequirePriceBelow =true// Require price belowHMAfor sell - [===
HULLMOVINGAVERAGESETTINGS===] HMA_FilterATRMultiplier =1.5//ATRmultiplier for noise filter - [===
HULLMOVINGAVERAGESETTINGS===] HMA_FilterATRPeriod = 14 //ATRperiod for volatility filter - [===
HULLMOVINGAVERAGESETTINGS===] HMA_TrendStrengthMin =0.7// Minimum trend strength (0-1) - [===
HULLMOVINGAVERAGESETTINGS===] HMA_SmoothingBars = 3 // Bars forHMAsmoothing validation - [===
HULLMOVINGAVERAGESETTINGS===] HMA_MinPriceDistance = 2 // Minimum distance fromHMAin points - [===
ADDITIONALFILTERS===]EnableDelayFilter=false// Enable N-bar delay confirmation filter - [===
ADDITIONALFILTERS===]BarDelay= 1 // Number of bars delay required for signal confirmation - [===
ADDITIONALFILTERS===]EntryDelayBars= 1 // Wait this many full new bars before placing a new entry - [===
MAGICINDICATORSETTINGS===]UseMagic_Decision=true// Master switch for Magic Decision - [===
MAGICINDICATORSETTINGS===] Magic_EntrySignal_BUY =false// Enable MagicBUYentry signal - [===
MAGICINDICATORSETTINGS===] Magic_EntrySignal_SELL =false// Enable MagicSELLentry signal - [===
MAGICINDICATORSETTINGS===] Magic_Confirm_BUY =false// Require MagicBUYconfirmation - [===
MAGICINDICATORSETTINGS===] Magic_Confirm_SELL =false// Require MagicSELLconfirmation - [===
MAGICINDICATORSETTINGS===] Magic_ExitTrigger_BUY =false// Enable MagicBUYexit trigger - [===
MAGICINDICATORSETTINGS===] Magic_ExitTrigger_SELL =false// Enable MagicSELLexit trigger - [===
MAGICINDICATORSETTINGS===] Magic_ExitConfirm_BUY =false// Require MagicBUYexit confirmation - [===
MAGICINDICATORSETTINGS===] Magic_ExitConfirm_SELL =false// Require MagicSELLexit confirmation - [===
MAGICINDICATORSETTINGS===]UseAutoFilter=true// Use automatic filter tuning - [===
MAGICINDICATORSETTINGS===] Length = 10 // Magic indicator length - [===
MAGICINDICATORSETTINGS===]DistanceMultiplier=0.85// Distance multiplier for bands - [===
MAGICINDICATORSETTINGS===] Timeframe = 0 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Magic indicator timeframe - [===
MAGICINDICATORSETTINGS===]TrendFilterTF= 6 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend filter timeframe - [===
MAGICINDICATORSETTINGS===]TrendEMA= 50 // TrendEMAperiod - [===
MAGICINDICATORSETTINGS===]MinATR=0.03// MinimumATRvalue - [===
MAGICINDICATORSETTINGS===]MinBreakDistance=0.3// Minimum break distance - [===
TIMEZONESETTINGS===] GMT_Offset = 0 //GMToffset for all time filters (hours, +/- fromGMT) - [===
TIMEZONESETTINGS===]UseBrokerTime=false// Use broker time instead ofGMT(NOTRECOMMENDED) - [===
BASICTIMEFILTERS===]UseTimeFilter=false// Use basic time filter - [===
BASICTIMEFILTERS===]StartHour= 8 // Start trading hour (GMT+ offset) - [===
BASICTIMEFILTERS===]StartMinute= 0 // Start trading minute - [===
BASICTIMEFILTERS===]EndHour= 18 // End trading hour (GMT+ offset) - [===
BASICTIMEFILTERS===]EndMinute= 0 // End trading minute - [===
TRADINGSESSIONFILTERS===]UseSessionFilter=false// Enable trading session filtering - [===
TRADINGSESSIONFILTERS===]UseSessionOverlapOnly=false// Trade only during session overlaps - [=== London Session ===]
UseSessionLondon=true// Trade London session - [=== London Session ===]
LondonStartHour= 8 // London session start hour (GMT+ offset) - [=== London Session ===]
LondonStartMinute= 0 // London session start minute - [=== London Session ===]
LondonEndHour= 17 // London session end hour (GMT+ offset) - [=== London Session ===]
LondonEndMinute= 0 // London session end minute - [=== New York Session ===]
UseSessionNewYork=true// Trade New York session - [=== New York Session ===]
NewYorkStartHour= 13 // New York session start hour (GMT+ offset) - [=== New York Session ===]
NewYorkStartMinute= 0 // New York session start minute - [=== New York Session ===]
NewYorkEndHour= 22 // New York session end hour (GMT+ offset) - [=== New York Session ===]
NewYorkEndMinute= 0 // New York session end minute - [=== Tokyo Session ===]
UseSessionTokyo=false// Trade Tokyo session - [=== Tokyo Session ===]
TokyoStartHour= 0 // Tokyo session start hour (GMT+ offset) - [=== Tokyo Session ===]
TokyoStartMinute= 0 // Tokyo session start minute - [=== Tokyo Session ===]
TokyoEndHour= 9 // Tokyo session end hour (GMT+ offset) - [=== Tokyo Session ===]
TokyoEndMinute= 0 // Tokyo session end minute - [=== Sydney Session ===]
UseSessionSydney=false// Trade Sydney session - [=== Sydney Session ===]
SydneyStartHour= 22 // Sydney session start hour (GMT+ offset) - [=== Sydney Session ===]
SydneyStartMinute= 0 // Sydney session start minute - [=== Sydney Session ===]
SydneyEndHour= 7 // Sydney session end hour (GMT+ offset) - [=== Sydney Session ===]
SydneyEndMinute= 0 // Sydney session end minute - [=== Custom Sessions ===]
UseCustomSession1=false// Enable custom session 1 - [=== Custom Sessions ===]
Custom1StartHour= 10 // Custom session 1 start hour (GMT+ offset) - [=== Custom Sessions ===]
Custom1StartMinute= 0 // Custom session 1 start minute - [=== Custom Sessions ===]
Custom1EndHour= 16 // Custom session 1 end hour (GMT+ offset) - [=== Custom Sessions ===]
Custom1EndMinute= 0 // Custom session 1 end minute - [=== Custom Sessions ===]
UseCustomSession2=false// Enable custom session 2 - [=== Custom Sessions ===]
Custom2StartHour= 15 // Custom session 2 start hour (GMT+ offset) - [=== Custom Sessions ===]
Custom2StartMinute= 0 // Custom session 2 start minute - [=== Custom Sessions ===]
Custom2EndHour= 21 // Custom session 2 end hour (GMT+ offset) - [=== Custom Sessions ===]
Custom2EndMinute= 0 // Custom session 2 end minute - [===
END-OF-DAYFILTERS===]UseEndOfDayFilter=false// Enable end-of-day position management - [===
END-OF-DAYFILTERS===] EODCloseHour = 22 // End-of-day close hour (GMT+ offset) - [===
END-OF-DAYFILTERS===] EODCloseMinute = 0 // End-of-day close minute - [===
END-OF-DAYFILTERS===]PauseNewTradesBeforeEOD=true// Pause new trades beforeEOD - [===
END-OF-DAYFILTERS===]PauseMinutesBeforeEOD= 30 // Minutes beforeEODto pause new trades - [===
END-OF-DAYFILTERS===] EODCloseMode =EOD_CLOSE_NONE//EODposition closing mode - [===
END-OF-DAYFILTERS===]ForceCloseMinutesBeforeEOD= 5 // Minutes beforeEODto force close trades - [===
END-OF-WEEKFILTERS===]UseEndOfWeekFilter=false// Enable end-of-week position management - [===
END-OF-WEEKFILTERS===] EOWCloseDay = 5 // End-of-week day (1=Monday, 5=Friday) - [===
END-OF-WEEKFILTERS===] EOWCloseHour = 21 // End-of-week close hour (GMT+ offset) - [===
END-OF-WEEKFILTERS===] EOWCloseMinute = 0 // End-of-week close minute - [===
END-OF-WEEKFILTERS===]PauseNewTradesBeforeEOW=true// Pause new trades beforeEOW - [===
END-OF-WEEKFILTERS===]PauseMinutesBeforeEOW= 60 // Minutes beforeEOWto pause new trades - [===
END-OF-WEEKFILTERS===] EOWCloseMode =EOW_CLOSE_NONE//EOWposition closing mode - [===
END-OF-WEEKFILTERS===]ForceCloseMinutesBeforeEOW= 15 // Minutes beforeEOWto force close trades - [===
TIME-BASEDENTRYCONTROL===]UseTimeBasedEntryPause=false// Enable time-based entry pause - [===
TIME-BASEDENTRYCONTROL===]EntryPauseAfterPositionClose= 5 // Minutes to pause entries after position close - [===
TIME-BASEDENTRYCONTROL===]AvoidMajorNewsTime=false// Avoid trading during major news - [===
TIME-BASEDENTRYCONTROL===]NewsAvoidanceMinutes= 30 // Minutes to avoid before/after news - [===
TIME-BASEDENTRYCONTROL===]UseDayOfWeekFilter=false// Enable day of week filter - [===
TIME-BASEDENTRYCONTROL===]TradeMonday=true// Trade on Monday - [===
TIME-BASEDENTRYCONTROL===]TradeTuesday=true// Trade on Tuesday - [===
TIME-BASEDENTRYCONTROL===]TradeWednesday=true// Trade on Wednesday - [===
TIME-BASEDENTRYCONTROL===]TradeThursday=true// Trade on Thursday - [===
TIME-BASEDENTRYCONTROL===]TradeFriday=true// Trade on Friday - [===
TIME-BASEDENTRYCONTROL===]AvoidFridayAfterHour=false// Avoid Friday trading after specific hour - [===
TIME-BASEDENTRYCONTROL===]FridayAvoidAfterHour= 16 // Hour to stop Friday trading (GMT+ offset)
// Pipsgrowth EX16061 Trend — Execution Flow (from source analysis)
// Family: Trend
// Optimized Expert Advisor addressing 100+ performance and structure issues, combining RSI entry signals, Momentum Breakout Structure (MBS), Magic indicator and adaptive confirmation for USDJPY with dynamic profit management. 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 an H4 or Daily chart for best results
- 7Configure EMA periods, ADX threshold, and lot size in the dialog
- 8Enable Allow Algo Trading and click OK
EA Parameters
| Parameter | Default | Description |
|---|---|---|
| EnableTrading | true | Enable trading |
| EnableDebug | false | Enable debug logging |
| LotSize | 0.01 | Fixed lot size |
| MagicNumber | 22216061 | Magic number |
| InpTradeComment | "Psgrowth.com Expert_16061" | Trade comment |
| Slippage | 3 | Slippage in points |
| MaxSpread | 30.0 | Maximum spread in points |
| MaxDrawdownPercent | 10.0 | Maximum drawdown percentage |
| MaxRiskPerTrade | 2.0 | Maximum risk per trade % |
| MaxOpenTrades | 5 | Maximum open trades |
| StopLossPoints | 100.0 | Stop loss in points |
| TakeProfitPoints | 200.0 | Take profit in points |
| EnableDynamicLockProfit | true | Enable dynamic profit locking |
| LockProfitEvery_X_Points | 30.0 | Step: every X points profit |
| LockMinusBuffer | 15.0 | Lock profit minus X point buffer |
| AllowOnlyProfitableAdditions | true | Only allow adding positions if existing trades are profitable |
| MinProfitInPointsPerTradeToAdd | 20.0 | Minimum profit required per existing trade in points |
| RSI_EntrySignal_BUY | false | Enable RSI BUY entry signal |
| RSI_EntrySignal_SELL | false | Enable RSI SELL entry signal |
| RSI_Confirm_BUY | false | Require RSI BUY confirmation |
| RSI_Confirm_SELL | false | Require RSI SELL confirmation |
| RSI_ExitTrigger_BUY | false | Enable RSI BUY exit trigger |
| RSI_ExitTrigger_SELL | false | Enable RSI SELL exit trigger |
| RSI_ExitConfirm_BUY | false | Require RSI BUY exit confirmation |
| RSI_ExitConfirm_SELL | false | Require RSI SELL exit confirmation |
| RSI_TF | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Timeframe for RSI |
| RSI_Period | 14 | RSI period |
| RSI_Price | 1 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Applied price for RSI |
| RSI_Overbought | 70.0 | RSI overbought level |
| RSI_Oversold | 30.0 | RSI oversold level |
| RSI_SignalShift | 0 | Shift for RSI signal line |
| RSI_Midline | 50 | RSI midline level |
| RSI_ExtremeBuffer | 5 | Buffer for extreme levels |
| RSI_MinRange | 5.0 | Minimum RSI range for valid signal |
| RSI_MinVolatility | 2.0 | Minimum volatility threshold |
| RSI_MomentumBars | 3 | Bars for momentum confirmation |
| RSI_DeadZoneSize | 5.0 | Dead zone around midline |
| MBS_EntrySignal_BUY | true | Enable MBS BUY entry signal |
| MBS_EntrySignal_SELL | true | Enable MBS SELL entry signal |
| MBS_Confirm_BUY | false | Require MBS BUY confirmation |
| MBS_Confirm_SELL | false | Require MBS SELL confirmation |
| MBS_ExitTrigger_BUY | false | Enable MBS BUY exit trigger |
| MBS_ExitTrigger_SELL | false | Enable MBS SELL exit trigger |
| MBS_ExitConfirm_BUY | false | Require MBS BUY exit confirmation |
| MBS_ExitConfirm_SELL | false | Require MBS SELL exit confirmation |
| MBS_Timeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Timeframe for analysis |
| MBS_LookbackBars | 20 | Lookback period for structure analysis |
| MBS_MinBreakoutSize | 50 | Minimum breakout size in points |
| MBS_MomentumThreshold | 0.7 | Momentum strength threshold (0-1) |
| MBS_ConfirmationBars | 2 | Bars needed for confirmation |
| MBS_VolatilityFilter | 1.5 | Volatility filter multiplier |
| MBS_TrendStrengthMin | 0.6 | Minimum trend strength (0-1) |
| MBS_RequireVolumeSpike | true | Require volume confirmation |
| MBS_VolumeMultiplier | 1.5 | Volume spike multiplier |
| MBS_ATRPeriod | 14 | ATR period for volatility |
| MBS_ATRMultiplier | 1.0 | ATR multiplier for breakout validation |
| MBS_EMAPeriod | 21 | EMA period for trend direction |
| MBS_MinPriceMovement | 0.0001 | Minimum price movement for signal |
| DC_EntrySignal_BUY | true | Enable Donchian Channel BUY entry signal |
| DC_EntrySignal_SELL | true | Enable Donchian Channel SELL entry signal |
| DC_Confirm_BUY | false | Require Donchian Channel BUY confirmation |
| DC_Confirm_SELL | false | Require Donchian Channel SELL confirmation |
| DC_ExitTrigger_BUY | false | Enable Donchian Channel BUY exit trigger |
| DC_ExitTrigger_SELL | false | Enable Donchian Channel SELL exit trigger |
| DC_ExitConfirm_BUY | false | Require Donchian Channel BUY exit confirmation |
| DC_ExitConfirm_SELL | false | Require Donchian Channel SELL exit confirmation |
| DC_Timeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Timeframe for Donchian Channel |
| DC_ChannelPeriod | 20 | Lookback period for channel |
| DC_ConfirmationBars | 2 | Bars needed for confirmation |
| DC_MinBreakoutPoints | 10 | Minimum breakout size in points |
| DC_ATRMultiplier | 1.0 | ATR multiplier for volatility filter |
| DC_ATRPeriod | 14 | ATR period for volatility |
| DC_RequireVolumeSpike | false | Require volume spike confirmation |
| DC_VolumeMultiplier | 1.5 | Volume spike multiplier |
| DC_MinPullbackPoints | 5 | Minimum pullback before breakout |
| DC_MinRangePoints | 20 | Minimum channel range to avoid chop |
| HMA_EntrySignal_BUY | false | Enable HMA BUY entry signal |
| HMA_EntrySignal_SELL | false | Enable HMA SELL entry signal |
| HMA_Confirm_BUY | false | Require HMA BUY confirmation |
| HMA_Confirm_SELL | false | Require HMA SELL confirmation |
| HMA_ExitTrigger_BUY | false | Enable HMA BUY exit trigger |
| HMA_ExitTrigger_SELL | false | Enable HMA SELL exit trigger |
| HMA_ExitConfirm_BUY | false | Require HMA BUY exit confirmation |
| HMA_ExitConfirm_SELL | false | Require HMA SELL exit confirmation |
| HMA_Timeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Timeframe for HMA analysis |
| HMA_Period | 21 | HMA period |
| HMA_ConfirmationBars | 2 | Bars needed for confirmation |
| HMA_MinSlopeAngle | 0.0001 | Minimum slope angle for trend detection |
| HMA_MinMomentumPoints | 5 | Minimum momentum in points |
| HMA_RequirePriceAbove | true | Require price above HMA for buy |
| HMA_RequirePriceBelow | true | Require price below HMA for sell |
| HMA_FilterATRMultiplier | 1.5 | ATR multiplier for noise filter |
| HMA_FilterATRPeriod | 14 | ATR period for volatility filter |
| HMA_TrendStrengthMin | 0.7 | Minimum trend strength (0-1) |
| HMA_SmoothingBars | 3 | Bars for HMA smoothing validation |
| HMA_MinPriceDistance | 2 | Minimum distance from HMA in points |
| EnableDelayFilter | false | Enable N-bar delay confirmation filter |
| BarDelay | 1 | Number of bars delay required for signal confirmation |
| EntryDelayBars | 1 | Wait this many full new bars before placing a new entry |
| UseMagic_Decision | true | Master switch for Magic Decision |
| Magic_EntrySignal_BUY | false | Enable Magic BUY entry signal |
| Magic_EntrySignal_SELL | false | Enable Magic SELL entry signal |
| Magic_Confirm_BUY | false | Require Magic BUY confirmation |
| Magic_Confirm_SELL | false | Require Magic SELL confirmation |
| Magic_ExitTrigger_BUY | false | Enable Magic BUY exit trigger |
| Magic_ExitTrigger_SELL | false | Enable Magic SELL exit trigger |
| Magic_ExitConfirm_BUY | false | Require Magic BUY exit confirmation |
| Magic_ExitConfirm_SELL | false | Require Magic SELL exit confirmation |
| UseAutoFilter | true | Use automatic filter tuning |
| Length | 10 | Magic indicator length |
| DistanceMultiplier | 0.85 | Distance multiplier for bands |
| Timeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Magic indicator timeframe |
| TrendFilterTF | 6 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend filter timeframe |
| TrendEMA | 50 | Trend EMA period |
| MinATR | 0.03 | Minimum ATR value |
| MinBreakDistance | 0.3 | Minimum break distance |
| GMT_Offset | 0 | GMT offset for all time filters (hours, +/- from GMT) |
| UseBrokerTime | false | Use broker time instead of GMT (NOT RECOMMENDED) |
| UseTimeFilter | false | Use basic time filter |
| StartHour | 8 | Start trading hour (GMT + offset) |
| StartMinute | 0 | Start trading minute |
| EndHour | 18 | End trading hour (GMT + offset) |
| EndMinute | 0 | End trading minute |
| UseSessionFilter | false | Enable trading session filtering |
| UseSessionOverlapOnly | false | Trade only during session overlaps |
| UseSessionLondon | true | Trade London session |
| LondonStartHour | 8 | London session start hour (GMT + offset) |
| LondonStartMinute | 0 | London session start minute |
| LondonEndHour | 17 | London session end hour (GMT + offset) |
| LondonEndMinute | 0 | London session end minute |
| UseSessionNewYork | true | Trade New York session |
| NewYorkStartHour | 13 | New York session start hour (GMT + offset) |
| NewYorkStartMinute | 0 | New York session start minute |
| NewYorkEndHour | 22 | New York session end hour (GMT + offset) |
| NewYorkEndMinute | 0 | New York session end minute |
| UseSessionTokyo | false | Trade Tokyo session |
| TokyoStartHour | 0 | Tokyo session start hour (GMT + offset) |
| TokyoStartMinute | 0 | Tokyo session start minute |
| TokyoEndHour | 9 | Tokyo session end hour (GMT + offset) |
| TokyoEndMinute | 0 | Tokyo session end minute |
| UseSessionSydney | false | Trade Sydney session |
| SydneyStartHour | 22 | Sydney session start hour (GMT + offset) |
| SydneyStartMinute | 0 | Sydney session start minute |
| SydneyEndHour | 7 | Sydney session end hour (GMT + offset) |
| SydneyEndMinute | 0 | Sydney session end minute |
| UseCustomSession1 | false | Enable custom session 1 |
| Custom1StartHour | 10 | Custom session 1 start hour (GMT + offset) |
| Custom1StartMinute | 0 | Custom session 1 start minute |
| Custom1EndHour | 16 | Custom session 1 end hour (GMT + offset) |
| Custom1EndMinute | 0 | Custom session 1 end minute |
| UseCustomSession2 | false | Enable custom session 2 |
| Custom2StartHour | 15 | Custom session 2 start hour (GMT + offset) |
| Custom2StartMinute | 0 | Custom session 2 start minute |
| Custom2EndHour | 21 | Custom session 2 end hour (GMT + offset) |
| Custom2EndMinute | 0 | Custom session 2 end minute |
| UseEndOfDayFilter | false | Enable end-of-day position management |
| EODCloseHour | 22 | End-of-day close hour (GMT + offset) |
| EODCloseMinute | 0 | End-of-day close minute |
| PauseNewTradesBeforeEOD | true | Pause new trades before EOD |
| PauseMinutesBeforeEOD | 30 | Minutes before EOD to pause new trades |
| EODCloseMode | EOD_CLOSE_NONE | EOD position closing mode |
| ForceCloseMinutesBeforeEOD | 5 | Minutes before EOD to force close trades |
| UseEndOfWeekFilter | false | Enable end-of-week position management |
| EOWCloseDay | 5 | End-of-week day (1=Monday, 5=Friday) |
| EOWCloseHour | 21 | End-of-week close hour (GMT + offset) |
| EOWCloseMinute | 0 | End-of-week close minute |
| PauseNewTradesBeforeEOW | true | Pause new trades before EOW |
| PauseMinutesBeforeEOW | 60 | Minutes before EOW to pause new trades |
| EOWCloseMode | EOW_CLOSE_NONE | EOW position closing mode |
| ForceCloseMinutesBeforeEOW | 15 | Minutes before EOW to force close trades |
| UseTimeBasedEntryPause | false | Enable time-based entry pause |
| EntryPauseAfterPositionClose | 5 | Minutes to pause entries after position close |
| AvoidMajorNewsTime | false | Avoid trading during major news |
| NewsAvoidanceMinutes | 30 | Minutes to avoid before/after news |
| UseDayOfWeekFilter | false | Enable day of week filter |
| TradeMonday | true | Trade on Monday |
| TradeTuesday | true | Trade on Tuesday |
| TradeWednesday | true | Trade on Wednesday |
| TradeThursday | true | Trade on Thursday |
| TradeFriday | true | Trade on Friday |
| AvoidFridayAfterHour | false | Avoid Friday trading after specific hour |
| FridayAvoidAfterHour | 16 | Hour to stop Friday trading (GMT + offset) |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX16061 OptimizedEA -- Optimized multi-indicator EA with RSI, MBS, Magic indicator and adaptive confirmation, full 12-layer stack."
#include <Trade/Trade.mqh>
#include <Trade/PositionInfo.mqh>
#include <Trade/OrderInfo.mqh>
//+------------------------------------------------------------------+
//| Input Parameters - Organized and Validated |
//+------------------------------------------------------------------+
ENUM_TIMEFRAMES MapTimeframeInt(int tf)
{
switch(tf)
{
case 1: return PERIOD_M1;
case 2: return PERIOD_M5;
case 3: return PERIOD_M15;
case 4: return PERIOD_M30;
case 5: return PERIOD_H1;
case 6: return PERIOD_H4;
case 7: return PERIOD_D1;
default: return PERIOD_H1;
}
}
ENUM_APPLIED_PRICE MapAppliedPriceInt(int ap)
{
switch(ap)
{
case 1: return PRICE_CLOSE;
case 2: return PRICE_OPEN;
case 3: return PRICE_HIGH;
case 4: return PRICE_LOW;
case 5: return PRICE_MEDIAN;
case 6: return PRICE_TYPICAL;
case 7: return PRICE_WEIGHTED;
default: return PRICE_CLOSE;
}
}
ENUM_TIMEFRAMES g_RSI_TF = PERIOD_H1;
ENUM_TIMEFRAMES g_MBS_Timeframe = PERIOD_H1;
ENUM_TIMEFRAMES g_DC_Timeframe = PERIOD_H1;
ENUM_TIMEFRAMES g_HMA_Timeframe = PERIOD_H1;
ENUM_TIMEFRAMES g_Timeframe = PERIOD_H1;
ENUM_TIMEFRAMES g_TrendFilterTF = PERIOD_H1;
ENUM_APPLIED_PRICE g_RSI_Price = PRICE_CLOSE;
input group "=== BASIC SETTINGS ==="
input bool EnableTrading = true; // Enable trading
input bool EnableDebug = false; // Enable debug logging
input double LotSize = 0.01; // Fixed lot size
input int MagicNumber = 22216061; // Magic number
input string InpTradeComment = "Psgrowth.com Expert_16061"; // Trade comment
input int Slippage = 3; // Slippage in points
ENUM_TIMEFRAMES MapTimeframeInt(int tf)
{
switch(tf)
{
case 1: return PERIOD_M1;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 Trend Following strategy EAs from our library
Pipsgrowth EX16080 Trend
Pipsgrowth.com EX16080 EURUSDTrendFollower — triple-EMA H4 trend follower, full 12-layer stack.
Pipsgrowth EX16081 Trend
Pipsgrowth.com EX16081 GoldTrendEA — XAUUSD H4 EMA cross with Fib targets, full 12-layer stack.
Pipsgrowth EX16033 Trend
Pipsgrowth.com EX16033 EA_Price_Action — price-action grid scalper, full 12-layer stack.
Community
Educational purposes only. Do NOT use with real money. Test on demo accounts only.