Forex is "24 hours" the same way a diner is "always open" – technically true, but the 3 AM crowd is very different from the lunch rush. Asian session? That's the sleepy overnight crew. London open hits like a double espresso. New York piles on chaos. The edges live in those transitions – the moment price wakes up and breaks out of whatever box it's been stuck in.
We've been building session breakout EAs for over a decade. Three approaches keep showing up, from dead-simple hour gates to full range-box systems we still run on live accounts today.
The Three Approaches
| Approach | Complexity | Description |
|---|---|---|
| Hour Filter | Low | Restrict any strategy to specific session hours |
| Single-Hour Sniper | Medium | Enter only during one specific hour, tight conditions |
| Range-Box Breakout | High | Detect session range, trade breakout of high/low/median |
Approach 1: The Trading Hour Window
A gate that says "nope, not trading right now" outside your chosen hours. Dead simple, but we've seen people skip this and wonder why their EA takes garbage fills at 2 AM on a Sunday.
input int TradingStartHour = 8; // e.g., London open
input int TradingEndHour = 17; // e.g., NY close
bool IsTradingHour()
{
int h = TimeHour(TimeCurrent());
if (TradingStartHour <= TradingEndHour)
return (h >= TradingStartHour && h <= TradingEndHour);
else
// Overnight window (e.g., 22:00 to 06:00)
return (h >= TradingStartHour || h <= TradingEndHour);
}That else branch with the OR logic? Non-negotiable. Set start=22, end=6 with AND logic and the condition is mathematically impossible. Hour 23 is not simultaneously ≥ 22 AND ≤ 6.
Weekday Filter (Companion)
Monday opens = weekend gaps, thin liquidity. Friday afternoons = liquidity drains. We filter both by default.
input bool AllowTradeOnMonday = true;
input bool AllowTradeOnFriday = true;
bool IsAllowedWeekday()
{
int wd = TimeDayOfWeek(TimeCurrent());
if (wd == 0) return false;
if (wd == 1 && !AllowTradeOnMonday) return false;
if (wd == 5 && !AllowTradeOnFriday) return false;
return true;
}Wire them in OnTick() – session filter first, weekday filter second. Fail fast.
Approach 2: Single-Hour Sniper
Some of the best-performing EAs we've ever shipped trade during exactly one hour per day. One. The rest of the time they sit there doing nothing – until you see the equity curve.
input int EntryHour = 1; // Server hour (e.g., Asian session start)
input int MaxTrades = 5;
void OnTick()
{
static datetime lastDay = 0;
static int dailyTradeCount = 0;
static double lastAsk = 0;
if (Day() != TimeDay(lastDay))
{
dailyTradeCount = 0;
lastDay = TimeCurrent();
}
double spread = Ask - Bid;
if (spread <= 0.002 && Hour() == EntryHour && OrdersTotal() == 0)
{
if (Ask < lastAsk - 0.00006 && Ask < Low[1] && dailyTradeCount < MaxTrades)
{
PlaceBuy();
dailyTradeCount++;
}
}
lastAsk = Ask;
}The ≤ 0.002 spread filter is basically a liquidity detector. Tight spread + dip below prior bar's low at 1 AM server time? That dip gets absorbed fast. Mean-reversion scalp inside a session filter.
Recommended Session Hours by Instrument
| Instrument | Best Session | Server Hour (GMT+2) | Why |
|---|---|---|---|
| EUR/USD | London–NY overlap | 15:00–17:00 | Peak liquidity, tightest spreads |
| GBP/JPY | London open | 10:00–12:00 | High volatility, clean breakouts |
| AUD/USD | Asian session | 01:00–03:00 | Session-native pair, lowest noise |
| Gold (XAU/USD) | NY open | 15:30–17:30 | Correlated with US data |
| NAS100 | US cash open | 16:30–19:00 | Index follows equity hours |
Approach 3: Range-Box Breakout (Full System)
Detect the session range, draw it on the chart, trade the breakout with dual targets. We've run variations of this on live accounts since 2018.
Step 1: Detect the Session Range
input int RangeBars = 12;
double SessionHigh, SessionLow, MedianPrice;
void DetectSessionRange()
{
SessionHigh = 0;
SessionLow = 100000;
for (int i = RangeBars; i >= 1; i--)
{
if (High[i] > SessionHigh) SessionHigh = High[i];
if (Low[i] < SessionLow) SessionLow = Low[i];
}
MedianPrice = (SessionHigh + SessionLow) / 2.0;
}On M5 with RangeBars=12, you're looking at the last 60 minutes. Perfect for the Asian range before London smashes through it.
Step 2: Trade the Breakout
Median line crossover = early warning. We place a stop order beyond the range extreme so the market has to prove the breakout before we get filled. Dual target: 1:1 R:R (reliable) + 10:1 runner (tiny lot, rare but huge when it hits).
Step 3: Expire Stale Pending Orders
If the setup candle has passed, delete unfilled stop orders. We left a stale buy stop hanging during NFP once. Got filled 40 pips of slippage. Never again.
Session Parameter Optimization
Most people pick session hours based on vibes. The session window is the single most impactful parameter – more than stop loss, more than lot size.
Step 1: Map your instrument's volatility profile (average range per hour).
Step 2: Set range window to quiet hours. For EUR pairs, hours 0–7 = range-building zone → trigger at London open (e.g. TradingStartHour = 8, RangeBars = 48 on M5).
Step 3: Backtest across session configs.
| Session Config | Win Rate | Profit Factor | Max DD |
|---|---|---|---|
| Asian range → London breakout | 52% | 1.8 | -8% |
| London range → NY breakout | 48% | 1.5 | -12% |
| Full day range → Asian breakout | 55% | 2.1 | -6% |
"Full day range → Asian breakout" often wins the profit factor contest. When Asian session breaks the entire prior day's range, something real is happening. Rare, but sky-high conviction.
Common Pitfalls
- Server time ≠ your time. MetaTrader runs on your broker's server clock (often GMT+2). London 8 AM = hour 10 on many brokers. We've seen people backtest for months on the wrong hour.
- DST will ruin your week. Twice a year the broker shifts. Use UTC internally or DST detection.
- Monday gaps are brutal. Ship with
AllowTradeOnMonday = falseas an option. Let the user prove it's safe. - News nukes session logic. NFP at 8:30 AM EST doesn't care about your range box. Pause session strategies 30 minutes before and after high-impact news.
Build Your Session Strategy
Session breakout systems are the most honestly backtestable strategy type. Fixed rules, hard time boundaries, no ambiguity. You know within a week of testing whether something has an edge or not.


