Xetra Opening Range
- エキスパート
- バージョン: 1.0
- アクティベーション: 5
DAX expert advisor that trades the breakout of the first hour after the Xetra open (Frankfurt time): one trade per day, stop loss on every order, flat before the close, no grid, no martingale.
Description
Xetra Opening Range trades one simple, well-defined moment of the day on the German DAX index: the first hour after the Xetra stock exchange opens in Frankfurt. It waits for that hour to finish, marks its high and its low, and then trades the side on which the price leaves this range. Below you will find exactly what the EA does at every step of the day, a worked example with numbers, every test result, and the weak points, so you know what to expect before you buy.
The idea in one paragraph
The Xetra open at 09:00 Frankfurt time is when the cash market for German shares starts trading, and trading volume on the DAX jumps at that moment. The idea behind the EA is that the first hour shows the price area that buyers and sellers accept for the day, and that a clear exit from this area can turn into a trend that lasts until the afternoon (a trend day). On many other days the breakout fails and the trade loses a small, fixed amount. The strategy earns money only because the trend days bring much larger profits than the small losses of the failed days. It is not a high win-rate system: about one trade in three is a winner.
What the EA does during a trading day (all times are Frankfurt time; the EA converts them to your broker’s time automatically)
- 09:00–10:00 — building the range. The EA does nothing but observe. When the hour is complete it takes the highest high and the lowest low of the 60 one-minute bars between 09:00 and 10:00. The distance between them is the "range".
- 10:00 — placing two pending orders (on the first price tick after 10:00).
- a Buy Stop a little above the range high (high + 5% of the range),
- a Sell Stop a little below the range low (low − 5% of the range).
The small 5% buffer avoids entries on a single tick that only touches the range edge.
If at that moment the price is already beyond one of the two levels (or closer to it than the broker’s minimum stop distance), only the other order is placed; that day the breakout on the first side is not traded. If the spread is too wide or an order is rejected, the EA tries again once per minute until 13:00.
If fewer than 30 one-minute bars exist between 09:00 and 10:00 (holiday, missing data), there is no trade that day.
- Stop loss. Each order carries its stop loss from the moment it is placed. The stop distance is half of the range, so a long trade’s stop sits near the middle of the range (slightly above it because of the buffer), and the same for a short trade. A wide, nervous first hour gives a wider stop and a smaller position; a quiet first hour gives a tighter stop and a larger position, so the money at risk stays the same.
- One trade per day. As soon as one order is filled, the other one is deleted. After a trade has been opened, the EA does not open another one that day, even if the first one is stopped out quickly.
- 13:00 — no more entries. If neither order was filled by 13:00, both are deleted and there is no trade that day.
- No take profit by default. A trade is not closed at a fixed target. It stays open until either its stop loss is hit or the time exit arrives. This is deliberate: in testing, fixed targets cut exactly the trend days that pay for the losing days (see "What did not work").
- 17:25 — time exit. Any open trade is closed at market at 17:25, a few minutes before the Xetra close at 17:30. No position is held overnight, so there is no swap and no weekend gap risk.
Worked example (numbers are illustrative)
- Between 09:00 and 10:00 the DAX trades between 18,000 and 18,080. Range = 80 points.
- At 10:00 the EA places a Buy Stop at 18,084 (18,080 + 4) and a Sell Stop at 17,996 (18,000 − 4).
- Stop distance = 40 points (half of 80): long stop at 18,044, short stop at 18,036.
- With a 10,000 USD account and 0.25% risk, the money at risk is 25 USD, so the lot size is chosen so that 40 points = 25 USD.
- At 11:20 the price rises through 18,084: the Buy Stop is filled and the Sell Stop is deleted.
- Case A (trend day): the DAX keeps rising and is at 18,250 at 17:25. The EA closes the trade: +166 points, about +104 USD, roughly four times the risk.
- Case B (failed breakout): the DAX falls back to 18,044. The stop loss closes the trade: −25 USD plus spread. No new trade that day.
Time handling
- All session times are inputs in Frankfurt time. The EA calculates Frankfurt time itself, including the European daylight-saving changes in March and October.
- On a live account the broker’s time zone is read automatically (difference between the trade server time and GMT as given by your computer), so the EA works with any broker time zone. The clock and time zone of the computer or VPS must be set correctly.
- In the Strategy Tester the broker time zone cannot be read, so two inputs describe it (default: GMT+2/+3 with European daylight saving, which is how the test broker’s server works; this was checked on the volume spike at the Xetra open).
Risk management
- Risk per trade is a fixed percentage of equity (default 0.25%), lost if the stop is hit. Lot = equity × risk % ÷ loss of one lot between entry and stop, so the position size grows and shrinks with the account.
- Every order has its stop loss from the moment it is placed. No grid, no martingale, no averaging, no hedging, no lot increase after losses.
- If the broker’s minimum lot would risk more than the risk setting, the EA trades the minimum lot only while its real risk stays below a limit you choose (default 2% of equity); otherwise it skips the day.
- Orders are not sent while the spread is wider than 10% of the range or while the market is closed. If the free margin is too small, the lot is reduced until the margin needed is at most 80% of the free margin; if even the minimum lot does not fit, there is no trade.
- The pending orders are deleted at 13:00 and the trade is closed at 17:25 by the EA itself, so the terminal must be running at those times. If it is off, the stop loss on the order still protects the position.
Backtest results (simulation, not live trading)
Strategy Tester, Admirals Group demo server, symbol GERMANY40, M5 chart, 10,000 USD starting balance, leverage 1:500, variable spread from the broker’s history, no commission, default inputs, January 2018 – November 2026.
- 0.25% (default): Model 1-minute OHLC | Net profit +8,333 USD | Profit factor 1.21 | Trades 1,973 | Largest drawdown (% of equity) 11.2% | Largest drawdown (money) 1,263 USD (6.7%)
- 0.5%: Model 1-minute OHLC | Net profit +22,179 USD | Profit factor 1.23 | Trades 1,973 | Largest drawdown (% of equity) 21.8% | Largest drawdown (money) 4,439 USD (13.2%)
- 0.25% (default): Model Real ticks* | Net profit +6,568 USD | Profit factor 1.17 | Trades 1,973 | Largest drawdown (% of equity) 12.3% | Largest drawdown (money) 1,247 USD
- 0.25% (default), 2025–2026 only: Model 1-minute OHLC | Net profit +3,367 USD | Profit factor 1.41 | Trades 428 | Largest drawdown (% of equity) 6.8%
- 0.25% (default), 2025–2026 only: Model Real ticks (100%) | Net profit +2,856 USD | Profit factor 1.34 | Trades 428 | Largest drawdown (% of equity) 7.1%
*The test broker has real tick history for only part of 2018–2026 (43% of the test); the rest is modelled. For 2025–2026 the test is 100% real ticks. Real ticks give a somewhat lower result than 1-minute OHLC (spread and the exact order of prices around the stop orders), so they are the more conservative estimate.
Results by calendar year (0.25% risk, 1-minute OHLC; each year continues from the previous balance)
- Net profit (USD): 2018 −638 | 2019 −199 | 2020 +596 | 2021 +921 | 2022 +2,154 | 2023 +584 | 2024 +281 | 2025 +3,255 | 2026* +1,378
*2026 until 20 November. Seven of nine years were positive. 2018 and 2019, two years of low DAX volatility, were negative. 2025 and 2026 together brought about 55% of the total profit.
Trade statistics (2018–2026, 0.25% risk, 1-minute OHLC)
- About 220 trades per year (roughly one per trading day; days without a breakout before 13:00 have no trade).
- Winning trades: 32%. Average win +74 USD, average loss −29 USD (about 2.6 to 1).
- Longest losing streak: 15 trades in a row. The deepest losing sequence was 13 trades and −584 USD.
- Average time in a trade: about 3 hours 45 minutes.
- Profit by direction: buys +3,979 USD, sells +4,354 USD. Both directions were positive, so the result does not come only from the long-term rise of the DAX.
- Profit factor 1.21, recovery factor 6.6.
How the default inputs were chosen and checked
(The screening, the ±20% test and the cost test were run with the research version of the EA, which has the same trading rules with fixed broker hours; the final version reproduces its 2018–2026 result.)
- 144 variants were screened (range start 1 hour before, at, or 1 hour after the Xetra open; range of 15/30/45/60 minutes; stop at half or the full range; take profit off, 1× or 2× the stop; with and without a range-size filter). They were tested on 2018–2024 and then run unchanged on 2025–2026: 79 of 144 were profitable in both periods.
- The range starting exactly at the Xetra open was the best; the "exit by time, no take profit" versions were positive in both periods in 43 of 48 cases.
- Changing range length (45/60/75 min), stop size (0.4/0.5/0.6 of the range), last entry time (12:00/13:00/14:00 Frankfurt) and buffer (3/5/7%) gave 81 combinations: all 81 were profitable in both 2018–2024 and 2025–2026.
- Entering 1 or 2 index points later on every trade (extra cost) reduced the 2018–2026 profit by up to 13%; the strategy stayed profitable with a profit factor of about 1.2.
- A filter that skips very small or very large ranges was tested; it did not improve the losing years, so it is off by default (you can still use it).
What did NOT work in testing
- A fixed take profit equal to the stop (1:1): only 4 of 48 variants were positive in both periods.
- Other symbols with the same rules: EURUSD H1 profit factor 0.73 (2025–2026), gold profit factor 1.01. Use this EA on the DAX only.
- A 15-minute range was weaker than 45–60 minutes (15 of 36 variants positive in both periods, against 23–25 of 36 for 45–60 minutes).
Honest limitations
- The edge is moderate: profit factor about 1.2 means that for every 1.2 USD won, about 1 USD is lost.
- Two out of three trades lose. Losing streaks of 10–15 trades and losing months are normal for this strategy; one or two losing years are possible (2018 and 2019 in the test).
- A large part of the profit came from the strong trend years 2025–2026.
- Results depend on your broker’s DAX CFD: spread, commission, trading hours and the quality of the price feed around the open. On German holidays the CFD can trade while Xetra is closed; these days give thin ranges.
- Live trading can be worse than a backtest (slippage on the stop orders at fast moves).
- Past results, including real-tick backtests, do not guarantee future results.
Please test the EA in the Strategy Tester and on a demo account with your own broker before trading real money.
How it differs from my other EA "First Five Breakout"
First Five Breakout trades the Nasdaq 100 on the first 5 minutes after the New York open with the stop at the opposite end of the range. Xetra Opening Range is built for the German DAX and the Frankfurt clock, uses the full first hour of Xetra trading, places the stop at the middle of the range, stops new entries at 13:00 and closes before the Xetra close. The settings were researched and tested separately on DAX data.
Recommended use
- Attach the EA to one chart of your broker’s DAX symbol (names such as GER40, DE40, DAX40, GERMANY40, [DAX40]). Any chart timeframe works; the EA reads one-minute data itself.
- Account: hedging or netting. As a guideline, with 0.25% risk a balance of about 1,000 USD or more lets the lot size follow the risk on most brokers (check your broker’s minimum lot for the DAX); smaller accounts trade the minimum lot only when its risk is below Max_Min_Lot_Risk. In the test, a 100 USD account traded normally and a 10 USD account did not trade (minimum lot too risky).
- Keep the terminal running from before 10:00 to after 17:25 Frankfurt time (VPS recommended), with a correct computer clock.
- Magic_Number identifies the EA’s orders; if you run another EA on the same symbol, give each EA its own Magic_Number. Trade_Comment is the text shown on the orders.
- The default inputs are the tested settings. For the higher-risk variant of the tests, change only Risk_Percent to 0.5 (drawdowns roughly double, see the table above).
Inputs
- Input: Open_Hour / Open_Minute; Default: 9 / 0; Meaning: Start of the range, Frankfurt time (Xetra open).
- Input: Range_Minutes; Default: 60; Meaning: Length of the range in minutes.
- Input: Last_Entry_Hour; Default: 13; Meaning: Pending orders are deleted at this hour (Frankfurt).
- Input: Close_Hour / Close_Minute; Default: 17 / 25; Meaning: Open trades are closed at this time (Frankfurt).
- Input: Buffer_Range; Default: 0.05; Meaning: Entry beyond the range edge, as a fraction of the range.
- Input: SL_Range; Default: 0.5; Meaning: Stop distance as a fraction of the range.
- Input: TP_R; Default: 0; Meaning: Take profit as a multiple of the stop distance; 0 = exit by time only.
- Input: Allow_Long / Allow_Short; Default: true / true; Meaning: Allow buy / sell trades.
- Input: Min_Range_ATR / Max_Range_ATR; Default: 0 / 0; Meaning: Optional filter: skip the day if range ÷ daily ATR(14) is outside these limits; 0 = off.
- Input: Max_Spread_Range; Default: 0.10; Meaning: Skip if the spread is larger than this fraction of the range.
- Input: Risk_Percent; Default: 0.25; Meaning: Risk per trade, % of equity.
- Input: Max_Min_Lot_Risk; Default: 2.0; Meaning: Maximum risk in % allowed when the broker minimum lot is used.
- Input: Max_Lots; Default: 10; Meaning: Upper limit per trade.
- Input: Tester_GMT_Offset / Tester_DST; Default: 2 / EU; Meaning: Broker time zone, used only in the Strategy Tester (live trading detects it automatically).
- Input: Magic_Number, Trade_Comment; Meaning: Order identification.
Risk warning
Trading leveraged products such as index CFDs carries a high risk of loss. Backtest results are simulations based on historical data and do not guarantee future results. Only trade with money you can afford to lose.
