Fixing My Least-Winning MT5 EA: Tokyo Swing Trend (USDJPY H1) — Why Exits, Trailing, and Sizing Matter More Than Entries

Published: 2026/01/15 Updated: 2026/01/15 Permalink

I’m publishing this breakdown for a reason I usually avoid admitting in public: this EA is my least winning one. That makes it the best teacher. When an EA fails quietly, it rarely fails because of one “bad indicator.” It fails because the math of the exits, the structure of the trailing stop, and the reality of sizing don’t match the market you’re asking to pay you.

This post is a rewrite of my earlier walkthrough, updated with technical feedback that sharpened the diagnosis. The conclusion is simple: the entry is not the main problem. The exit model is.

What the EA is designed to do (in plain terms)

Tokyo_SwingTrend_USDJPY_H1 is a trend-following swing EA for USDJPY on H1. It tries to:

  • Define trend using EMA(50) vs EMA(200)
  • Enter pullbacks using RSI (buy in uptrend when RSI is low, sell in downtrend when RSI is high)
  • Trade only when volatility is “real” (ATR filter) and trend strength is present (ADX filter)
  • Use ATR-based SL, target a multiple of risk (R-multiple TP)
  • Optionally trail stops using ATR
  • Restrict trading to a Tokyo-time window in JST
  • Track trade opens and closes through KurosawaTrack

Structurally, the code is clean: closed-bar signals, once-per-new-bar evaluation, risk gates, and tracking are all solid. The weakness is not architecture. It’s strategy mechanics.

The core issue: “Ambitious exit” versus “pullback entry”

The EA pairs an RSI pullback entry with a 2.5R profit target. On paper, that’s elegant. In practice, it can be a mismatch.

Why the pairing conflicts

An RSI pullback (RSI ≤ 45 in an uptrend, RSI ≥ 55 in a downtrend) often happens when the trend is entering a rest phase, or when momentum is fading temporarily. That doesn’t mean the trend is over, but it does mean you’re not necessarily entering the “easy” expansion leg.

If you enter after RSI has already pushed into a pullback zone, you are often late relative to the next clean impulse. From that position, asking price to travel another 2.5× your initial risk becomes statistically demanding. You can still have occasional big winners, but you’ll often pay for them with many small losses or scratched trades.

The practical fix

A more realistic target range for this style is usually 1.2R to 1.8R. The point is not to “make it smaller.” The point is to match the typical follow-through after a pullback entry on H1 USDJPY.

A smaller target typically increases win rate and reduces equity curve volatility. You lose some home-run potential, but you often gain something more valuable: consistency.

Trailing stop: the hidden killer of expectancy

The most important feedback was about trailing stop interference. The EA currently sets:

  • SL = 2.0 × ATR
  • Trailing starts at 1.0R
  • Trailing step = 0.7 × ATR

Why this becomes too tight on H1 USDJPY

If your trailing step is 0.7×ATR, you’re placing the stop inside normal volatility. On H1, USDJPY can swing around by close to 1×ATR without “meaningfully changing direction.” That means the trailing stop can get hit simply because the market is breathing.

When that happens repeatedly, you don’t just reduce your biggest winners. You reshape the entire payoff distribution downward. Suddenly the EA is forced to rely on a win rate it was never designed to have.

A better trailing configuration (directional, not fragile)

A more robust baseline is:

  • Start trailing at 1.5R (not 1.0R)
  • Use a wider step, like 1.0×ATR or 1.2×ATR

This gives the trade room to survive normal pullbacks while still protecting profits once the market has proven it can move. If you keep the 2.5R target, this change becomes even more necessary. But realistically, it pairs best with a TP in the 1.5R–1.8R range.

Position sizing: the missing link that makes results misleading

In the current code, lot sizing is: GetMinLot(_Symbol). That is fine for a smoke test. It is not fine for a system you intend to run and compare over time.

Why fixed min lot is a real weakness

  • When ATR expands or contracts, your SL distance changes, but your lot size does not
  • That means your risk in money changes while your risk in lots stays constant
  • USDJPY pip value and tick value depend on price and account currency, so risk is not stable by default

The result is that your backtest can look “okay” in some periods and terrible in others, not because your signal changed, but because your effective risk drifted.

What to implement instead

Replace min lot sizing with equity-risk sizing, such as 0.5% risk per trade. The typical model is:

LotSize = (AccountEquity × Risk%) / (SL_Distance_in_Points × TickValue)

Once you do this, your evaluation becomes honest. You can compare versions, filters, and exit rules without volatility silently changing your risk profile.

Session gate: JST is stable, but market drivers are not

The EA uses a fixed JST offset (UTC+9) and trades between 09:00 and 23:00 JST. That makes the code operationally simple. But there’s a strategic risk: USDJPY volatility is driven by session overlaps and scheduled opens.

The DST reality

Japan does not use DST. The US does. That means “New York open in JST” shifts during the year. If your strategy benefits (or suffers) from those volatility windows, a fixed JST gate can accidentally move you in or out of the real driver periods.

Data-driven approach

The best idea here is not guessing the right session. It’s letting tracking decide:

  • Which hours produce positive expectancy
  • Which hours create losing clusters
  • Whether this “Tokyo” EA actually performs best during London/NY overlap

A trend-continuation system that needs follow-through may benefit from the hours where liquidity and participation are highest. If the EA is demanding 1.5R+ consistently, it needs fuel.

Recommended upgrade plan (minimal changes, maximum clarity)

If I were iterating this EA as a production system, I’d change it in this order. Each step improves the signal-to-noise ratio of your testing.

  1. Implement risk-based position sizing
    • Risk 0.25%–0.75% of equity per trade
    • Normalize results across volatility regimes
  2. Fix exit realism
    • Reduce TP from 2.5R to 1.5R–1.8R (or even 1.2R for testing)
    • Measure win rate and average R captured
  3. Adjust trailing to stop hunting
    • Trail start: 1.5R
    • Trail step: 1.0×ATR or 1.2×ATR
  4. Make entry slightly more “active”
    • Switch from “RSI level” to “RSI cross back” (momentum confirmation)
    • This reduces catching pullbacks that keep falling
  5. Upgrade trend bias (optional, but powerful)
    • Define trend using H4 or D1 alignment, enter on H1
    • Reduce whipsaw from H1-only EMA logic

Comparison: current vs. proposed optimization

Feature Current Logic (v0.1.2) Proposed Optimization
Position Sizing Fixed min lot % equity risk (e.g., 0.5%)
Entry Timing RSI level (passive) RSI cross back (active confirmation)
Profit Target 2.5R (ambitious) 1.5R–1.8R (realistic)
Trailing Stop Start 1.0R / Step 0.7×ATR Start 1.5R / Step 1.0–1.2×ATR
Trend Filter H1 EMA(50/200) H4 or D1 alignment (bias) + H1 entry

What I’m learning from the least-winning EA

The biggest lesson is uncomfortable because it’s not glamorous: entries are easy to tweak, but exits decide whether a strategy is viable. When an EA is “least winning,” it often means the market is not paying the exit model you chose. Fixing that is not about adding more indicators. It’s about making the math survivable.

My next step is to implement equity-risk sizing, adjust TP to 1.5R, widen trailing, then compare results across sessions using tracking. If the EA still underperforms after those changes, then I’ll revisit the trend filter timeframe and the entry trigger type.

You can see updated code here


If you build MT5 EAs, this is the kind of work that turns “ideas” into systems: tracking, controlled iteration, and letting the numbers decide.

If this helped your EA work, share it.
X Facebook LinkedIn

Keisuke Kurosawa
Hello
Share
https://1kpips.com/en/blog/tokyo-swingtrend-usdjpy-h1-least-winning-fixes
Categories
MT5 Strategy Testing & Optimization
Tags
MT5 EA development, USDJPY algorithmic trading, ATR trailing stop, risk-based position sizing, RSI pullback strategy

Related Articles

Next step
Save this idea into your EA: add a session filter, then backtest with and without it to see the difference.