Yen Range Breakout MT4
- Uzmanlar
- Sürüm: 1.20
OVERVIEW
Yen Range Breakout is an H1 breakout Expert Advisor for USDJPY and GBPJPY. It builds the range of the Asian-session hours and, when the bar that confirms the end of that session closes outside the range, it enters in the direction of the breakout. A trade is taken only when the range was wide enough compared with the recent daily volatility. One position per symbol, fixed stop loss and take profit. No martingale, no grid, no averaging down.
HOW IT WORKS
1. The EA converts New York time to your broker's server time by itself (GMT offset and US/EU daylight saving are detected automatically), so the same bar is used on any broker, all year round.
2. When the confirming bar closes, the EA compares its close with the high/low of the preceding Asian-session bars.
3. If the close is above the range, it buys; if below, it sells. The order is sent at market right after the bar has closed. Unfinished bars are never used, so there is no repainting and no look-ahead.
4. A range-width filter skips days when the Asian range was narrow relative to the last completed daily ATR.
5. Fixed stop loss and take profit are set from the actual entry price. Stop levels respect the broker's minimum distance.
Only one position per symbol is held at a time. The decision is made once per new bar.
KEY FEATURES
- Confirmed-bar logic: no repainting, no look-ahead
- Automatic server-time conversion, including daylight saving changes
- Range-width filter based on the daily ATR
- Fixed lot size, or an optional risk-percent lot size based on the stop distance
- Lot size is adjusted to the broker's min, max and step; orders are skipped when free margin is insufficient
- Price levels follow the symbol's tick size
INPUT PARAMETERS
SessionHours: Number of H1 bars that form the range
CheckHourNY: New York hour of the confirming bar
MinRangeATR: Minimum range width as a multiple of the daily ATR (0 = filter off)
StopPips: Stop loss in pips
TakePips: Take profit in pips
Lots: Fixed lot size (used when RiskPercent is 0)
RiskPercent: If above 0, the lot size is set so that the stop loss risks this percent of equity
MagicNumber: Identifier of this EA's positions
Slippage: Maximum slippage in points
ManualCheckHourOverride: -1 = automatic; 0-23 = fixed server hour (for testing)
TesterServerDst: Strategy Tester only: server time convention to assume
DebugLog: Print one line per checked bar
The default values of the strategy parameters are the ones used in the test results below. The tests used a fixed 0.1 lot; the default lot size of the EA is 0.01.
RECOMMENDED SETUP
- Symbols: USDJPY and GBPJPY. Attach it to each symbol's chart separately.
- Chart period: the logic always uses H1 bars.
- Account: any type. Low-spread accounts are recommended.
- Start on a demo account.
- Strategy Tester: the tester has no real GMT time, so the EA assumes a server-time convention (input TesterServerDst). If your broker's server time differs, set ManualCheckHourOverride to the server hour of the confirming bar.
TEST RESULTS (MetaTrader 5 Strategy Tester, every tick based on real ticks)
Period 2024.01.01 - 2026.10.02, H1, deposit $100,000, leverage 1:100, fixed 0.1 lot, default parameters. Two different brokers' tick data were used, because results depend on the data.
MetaQuotes-Demo data:
USDJPY: 41 trades, win rate 34.2%, net profit +$871, profit factor 2.39, max balance drawdown $133, max consecutive losses 6
GBPJPY: 47 trades, win rate 27.7%, net profit +$568, profit factor 1.72, max balance drawdown $252, max consecutive losses 11
XM data:
USDJPY: 41 trades, win rate 26.8%, net profit +$437, profit factor 1.62, max balance drawdown $136, max consecutive losses 6
GBPJPY: 49 trades, win rate 28.6%, net profit +$624, profit factor 1.76, max balance drawdown $256, max consecutive losses 11
PLEASE READ - LIMITS OF THESE RESULTS
- Small sample: about 90 trades in 2.75 years. The statistical certainty is low.
- The win rate is low (roughly 25-35%). Most trades are small losses, and a few larger winners make up the result. Long losing streaks happen (11 in a row on GBPJPY in the test).
- The stop loss and take profit distances were chosen using tests that include the 2024-2026 period. The range-width threshold was chosen on earlier data (2010-2017, five currency pairs).
- The edge was found mainly on USDJPY and GBPJPY. Other pairs were tested and did not show a useful result, so the EA is not meant for them.
- The period may favor the Japanese yen trend. Results in other market conditions may be very different.
- Results depend on the broker's prices, spreads and server time. The two data sets above already differ.
- Backtests are simulations. Real spreads, slippage, swap and order rejections will differ.
RISK WARNING
Trading leveraged products such as forex carries a high risk of loss, including the loss of more than your deposit on some accounts. Past performance, including test results, does not guarantee future results. This product is a trading tool, not investment advice. Test on a demo account and only trade money you can afford to lose.
