Enkan Usdjpy Mean Reversion
- Experts
- Versione: 1.100
- Attivazioni: 5
Enkan USDJPY Mean Reversion
OVERVIEW
Enkan is a fixed-rule Expert Advisor designed for USDJPY on the M5 timeframe. It evaluates completed five-minute bars and looks for statistically extended price moves. When the entry conditions and filters are satisfied, it places a counter-trend order on the next eligible M5 bar.
The strategy combines deviation from SMA20, RSI14, Bollinger Band Z-score, ATR, SMA50/SMA200 trend conditions, bar-range filters and tick-volume activity. It does not use external AI, DLLs, WebRequest, external indicators, external files or external APIs.
Enkan uses a capped grid with a nominal 1.5x position-size progression. The Standard configuration allows a maximum of six levels. This structure can increase both exposure and floating drawdown during a sustained one-directional market move.
KEY FEATURES
• Decisions are made from completed M5 bars only.
• Counter-trend entries after statistically extended movement.
• Adaptive entry filtering using volatility, trend and market activity.
• Adaptive grid spacing that expands for later basket levels.
• Six-level maximum basket in the Standard configuration.
• Basket exit near the volume-weighted average entry after two or more levels.
• Common server-side stop placement plus a client-side time exit.
• UTC-based trading session and year-end entry pause.
• Fixed base lot: no automatic balance compounding.
• No external dependencies.
TRADING LOGIC
Signal calculation
A long setup begins when price moves sufficiently below SMA20 in ATR terms and RSI14 enters the lower extreme zone. A short setup uses the corresponding upper-side conditions. The strategy only responds to the first completed-bar crossing into the qualifying condition. Trend, shock-range and extreme Bollinger/trend combinations are used as additional filters. If the filters reject the setup, no new basket is opened.
Entry timing
After a valid completed-bar signal, the EA attempts the first order on the next eligible M5 bar. The actual fill depends on the first available tradable quote and should not be assumed to occur at the exact bar-open price.
New signals are limited to UTC 23:00-05:59. The broker server-to-UTC setting must therefore be configured correctly.
Adaptive basket spacing
When price moves against the first position, the EA can add positions in the same direction. The initial spacing is calculated from ATR14 and an activity factor that uses the signal-bar range, recent tick-volume activity and Bollinger Band width. The spacing is then expanded geometrically by 1.5 for each later level.
The Standard lot sequence is:
0.04 / 0.06 / 0.09 / 0.14 / 0.20 / 0.30 lot
The maximum Standard exposure is 0.83 lot across six levels.
EXIT RULES
When a basket contains two or more levels, the EA attempts to close the complete basket approximately 2 pips beyond its volume-weighted average entry price.
A one-level position has no fixed take-profit in the Standard configuration. It remains under the time-exit and hard-stop rules. The strategy should therefore not be understood as a system in which every trade closes after a quick 2-pip move.
A common server-side stop-loss is placed 750 pips from the initial entry-bar BID-open reference. The EA begins attempting a time-based close 720 hours after the initial M5 entry bar.
Market closure, insufficient liquidity or an unavailable execution route can delay the time-based close. The longest observed holding period in the long test was 765.83 hours.
New baskets are disabled from December 20 through January 7 on a UTC basis. Existing baskets continue to be managed during this period.
POSITION SIZING
The Standard configuration uses a fixed 0.04-lot base size. It does not automatically increase the base lot when the account balance grows. Published results apply to this fixed base volume.
LONG-PERIOD MT5 BACKTEST
• Broker data and conditions: Phillip Securities Japan
• Symbol and timeframe: USDJPY.ps01, M5
• Period: 7 March 2016 to 1 September 2026
• History quality: 95% real ticks
• Account currency / initial deposit: JPY / JPY 1,000,000
• Leverage: 1:25
• Base volume: fixed 0.04 lot, no compounding
• Net profit: JPY 938,671
• Final balance: JPY 1,938,671
• Profit factor: 2.54
• Maximum equity drawdown: JPY 309,639
• Maximum relative equity drawdown: 19%
• Recovery factor: 3.03
• Sharpe ratio: 0.97
• Position trades: 2,393
• Parsed baskets: 934
• Maximum observed basket: six levels / 0.83 lot
• Maximum observed holding period: 765.83 hours
When realized basket P/L is grouped by the month in which each basket was closed, 125 of 126 close-months were positive. This is not month-end equity and does not include unrealized P/L at each month-end.
One final single-position basket was still open at the end of the test. The Strategy Tester closed it at the test boundary, and its JPY 2,219 result is included above.
RECENT 100% REAL-TICK BACKTEST
• Broker data and conditions: Phillip Securities Japan
• Symbol and timeframe: USDJPY.ps01, M5
• Period: 1 August 2024 to 1 September 2026
• History quality: 100% real ticks
• Account currency / initial deposit: JPY / JPY 1,000,000
• Leverage: 1:25
• Base volume: fixed 0.04 lot
• Net profit: JPY 251,891
• Final balance: JPY 1,251,891
• Profit factor: 2.40
• Maximum equity drawdown: JPY 309,639
• Maximum relative equity drawdown: 27%
• Recovery factor: 0.81
• Sharpe ratio: 0.85
• Position trades: 497
• Parsed baskets: 200
• Maximum observed basket: six levels / 0.83 lot
• Maximum observed holding period: 764.50 hours
When realized basket P/L is grouped by close month, 25 of 25 close-months were positive. This is not a month-end equity calculation. The last single-position basket was closed at the test boundary, and its JPY 2,219 result is included above.
EXECUTION ASSUMPTIONS
The tests used historical variable spreads. Entry-spread median was 0.6 pips and the 90th percentile was 1.0 pip in both tests. Swap was included. The test account charged zero commission. No separate additional slippage penalty was added.
Spreads, commissions, swaps, order filling, stop levels, symbol specifications, margin calculations and server time differ between brokers. Results obtained on another account can therefore differ materially.
RECOMMENDED OPERATING ENVIRONMENT
• Platform: MetaTrader 5
• Instrument: USDJPY or a broker suffix variant identified by MT5 as USD/JPY
• Chart timeframe: M5
• Installation: one Enkan instance per account, symbol and Magic Number
• Validated base volume: 0.04 lot
• Maximum Standard order size: 0.30 lot
• Maximum Standard combined volume: 0.83 lot
• Signal session: UTC 23:00-05:59
• Continuous operation: recommended, especially while a basket is open
• External dependencies: none
The broker must support the complete Standard volume ladder. The historical tests used fixed-offset mode with UTC+9. The Market build defaults to European DST mode with winter UTC+2 and summer UTC+3; users of other server clocks must change these settings.
Use a demo account first. Confirm the symbol, M5 timeframe, server UTC setting, lot sequence, Magic Number and initialization messages before considering live operation. Do not install multiple copies with the same account, symbol and Magic Number. Avoid manual trades or other EA positions on the same USDJPY symbol, because foreign exposure on that symbol blocks a new Enkan basket.
Keep MetaTrader 5, the EA, the VPS or computer, and the network connection operational while positions are open. Do not remove the EA or change its settings during an active basket.
INPUT PARAMETERS
Operation
• InpMagicNumber = 26090986 — Unique identifier for Enkan orders and positions.
• InpBaseLot = 0.04 — Volume of the first basket position. Published results apply only to 0.04 lot.
• InpMaxDeviationPoints = 20 — Maximum order-price deviation in broker points.
• InpAllowNewEntries = true — Enables or disables new initial entries. Existing baskets remain managed.
• InpDiagnostics = true — Enables detailed Expert log messages.
• InpProductOrderComment = MQL5:ENKAN_USDJPY — Comment attached to Enkan orders.
Broker Server Time
• InpBrokerUTCOffsetMode = G61_UTC_EUROPE_DST — Server-time conversion mode. Fixed or European DST modes are available.
• InpBrokerUTCOffsetHours = 9 — Fixed number of hours added to UTC when fixed-offset mode is selected.
• InpBrokerWinterUTCOffsetHours = 2 — Winter server UTC offset in European DST mode.
• InpBrokerSummerUTCOffsetHours = 3 — Summer server UTC offset in European DST mode.
Strategy
• InpDeviationATRThreshold = 2.5 — Required SMA20 displacement in ATR14 units.
• InpRSIThreshold = 27.5 — Long-side RSI14 threshold; the corresponding short threshold is 72.5.
• InpTrendMaxATR = 4.0 — Maximum permitted absolute SMA50/SMA200 separation in ATR14 units.
• InpShockMaxATR = 3.0 — Maximum signal-bar range in ATR14 units.
• InpGateBBZThreshold = 3.8 — Absolute Bollinger Z-score component of the extreme-trend rejection rule.
• InpGateDirectionalTrendThreshold = -3.0 — Direction-adjusted trend component of the rejection rule.
• InpRSIReplayBars = 4096 — Historical bars used to reconstruct the internal RSI state after initialization.
Basket and Exits
• InpSpacingATRMultiplier = 1.25 — ATR multiplier for initial adaptive spacing.
• InpMaxLevels = 6 — Maximum positions in one basket.
• InpLotMultiplier = 1.5 — Nominal volume multiplier between basket levels; volume is rounded to broker lot steps.
• InpSpacingAcceleration = 1.5 — Geometric expansion factor for later grid intervals.
• InpBasketTargetPips = 2.0 — Basket-close target from the volume-weighted average entry price.
• InpTargetMinLevels = 2 — Minimum levels before the basket target becomes active.
• InpSoloTakeProfitPips = 0.0 — Fixed one-level take-profit; zero disables it.
• InpBasketStopPips = 750.0 — Common hard-stop distance from the first entry-bar reference. It is not a guaranteed maximum loss.
• InpMaxHoldHours = 720 — Time after which the EA begins attempting to close the basket.
Calendar
• InpPauseYearEndNewEntries = true — Suspends new baskets over the configured year-end period.
• InpYearEndPauseStartMonth = 12 and InpYearEndPauseStartDay = 20 — UTC pause start.
• InpYearEndPauseEndMonth = 1 and InpYearEndPauseEndDay = 7 — UTC pause end.
IMPORTANT RISK NOTICE
Enkan uses a grid and martingale-style lot progression. The Standard configuration can build up to six same-direction positions with a maximum combined volume of 0.83 lot. During a persistent directional move, the number of positions, required margin and floating loss can increase together.
The 750-pip stop is not a guaranteed maximum loss. Gaps, slippage, reduced liquidity, trading halts, communication failure and broker execution conditions may result in a closing price beyond the requested stop level.
The basket target, additional-level management and time exit require the EA and MetaTrader 5 terminal to remain operational. The server-side stop normally remains registered when the terminal is offline, but client-side basket management does not operate while the EA is stopped.
The published tests use a fixed 0.04-lot base size. Changing the lot size or strategy parameters changes exposure and invalidates a direct comparison with the published results.
The JPY 1,000,000 initial deposit shown in the tests is a test condition. It is not a guaranteed safe balance or a promise that the same balance will be sufficient under another broker or future market conditions.
Backtest results describe historical simulations and do not guarantee future profit, maximum loss or identical execution.
