This long-only research model separates three jobs: EMA defines direction, ADX supplies a strength condition, and a frozen ATR sets scale. The range is fixed before a breakout can occur. Its first outside close consumes the setup even when a filter rejects it; a later stronger ADX cannot revive it. Clear charts trace the six-candle box, the failed event, the next independent setup and the executable entry plan. All inputs are fictional and no trading performance is claimed.
1. Define one breakout hypothesis and separate the indicator roles
The hypothesis asks whether a compact, completed H1 range followed by an upward close, aligned EMAs and sufficient ADX defines a continuation population worth testing. It does not establish an edge. EMA direction, ADX strength and ATR scale are different roles, yet all process overlapping prices. Agreement is not independent evidence, and a strong reading can arrive after much of a move.
This version studies EURUSD BUY positions only. It has no SELL entry, averaging, pyramiding, automatic reversal, trailing stop or discretionary retest. The MACD–RSI strategy is a separate model. Changing the box clock, smoothing method, first-event policy or protection creates a new version; do not pool its results with this specification.
For a different indicator-combination model, see the closed H1 Bollinger middle-band pullback with RSI, including its one-candle deadline, quote checks and fixed protection.
2. Fix the UTC clock, data and eligibility
Use Bid H1 OHLC and Close-based EMA 20/50, plus the declared Wilder ADX 14 and ATR 14. Arm only Monday through Thursday when the completed 06:00 UTC candle becomes available. Require at least 50 preceding completed candles, valid positive ATR, complete indicator history and no position, pending entry or unresolved earlier request for this model. Map actual broker candle intervals to UTC; a local time label is not enough.
The box contains the six bars opening from 00:00 through 05:00 UTC, hence closing from 01:00 through 06:00. Candidate closes are 07:00, 08:00, 09:00 and 10:00 UTC on that same day. If the last remains inside, the setup expires after its assessment. Do not reconstruct a missed morning setup later using already-seen candidate prices. Holidays or data gaps require a skip, not fabricated bars.
| Component | Declared input | Role or limit |
|---|---|---|
| EMA 20 / 50 | Close; SMA-seeded EMA reference | Same-candle direction and slope |
| ADX 14 | Explicit Wilder DM/DI/DX/ADX reference | Strength at least 25; no direction |
| ATR 14 | Wilder reference frozen at 06:00 UTC | Box width, buffer and protection scale |
| Box | Six completed UTC candles; one first outside close | Fixed boundaries, no retrospective rearming |
3. Freeze the range and its volatility scale before the break
At arming, define U = max[H(01:00), …, H(06:00)], D = min[L(01:00), …, L(06:00)] and A0 = ATR14(06:00). The compactness gate is 0 < U − D ≤ 2A0. Freeze U, D and A0 for the entire setup. A0 is a price distance, not a direction or probability.
Do not include a candidate candle in the box or replace A0 with a breakout-inflated ATR. That would change the rule while observing the event it must judge. A narrow box relative to recent range does not guarantee expansion or choose its direction. If compactness fails at arming, there is no setup that day; do not keep shifting the six-bar window until an attractive box appears.
4. Evaluate EMA direction and ADX strength on the first event
On a candidate's completed candle require F(k) = [C(k) > EMA20(k) > EMA50(k)] AND [EMA20(k) > EMA20(k−1)]. The strength condition is ADX14(k) ≥ 25, including equality. Price location, EMA ordering and slope are explicit parts of F, not interchangeable interpretations of a rising chart.
ADX itself is nondirectional: a high value can accompany a decline. This model takes its upward direction from F, not from ADX. The +DI and −DI values are diagnostic calculation components, with no separate crossing requirement here. Both direction and strength use the event candle, which is completed; later improvement cannot be substituted for a failed event.
5. Declare the exact calculation instead of assuming terminal parity
Each EMA starts from the simple mean of its first period, then uses EMA_n(k) = [2C(k) + (n−1)EMA_n(k−1)]/(n+1). True range is TR(k) = max[H−L, |H−C(k−1)|, |L−C(k−1)|]. For ATR and directional-movement means, average the first 14 valid inputs, then use W(k) = [13W(k−1) + x(k)]/14. The first valid TR belongs to k1.
Positive DM uses a positive high increase only when it exceeds the low decrease; negative DM uses the converse, with ties set to zero. DI is 100 times the smoothed DM divided by ATR. DX is 100 times the absolute DI difference over their sum; a zero DI sum with positive ATR gives our DX zero. ADX starts as the mean of DX from k14 through k27, then uses the same Wilder recurrence. Zero ATR makes the directional decision unavailable. EMA50 first exists at k49. MQL4 exposes ADX components, but matching period labels does not verify the same seeds or smoothing; reproduce this reference and compare actual outputs before claiming equivalence.
6. Consume the first outside close even when it is rejected
The first candidate with C(k) > U OR C(k) < D consumes the box. Equality at either edge is still inside, and an outside wick without an outside close does not consume it. A lower outside close ends this long-only opportunity without a SELL. For an upper outside event, require 0.10A0 ≤ C(k) − U ≤ 0.75A0, F and the ADX condition together.
A close just above U but below the buffer is a weak break and consumes the setup. A close too far above is rejected for extension; it is not chased. Failed EMA or ADX also consumes the event. Do not wait for another outside candle or re-entry to retry. Only a new eligible day's independently armed box can create a new opportunity. Record the raw first event separately from its qualification Q.
7. Check exactly one first quote within its deadline
After a qualified close at t, assess the first observed two-sided Bid/Ask quote. Send an unsent request only during 0 ≤ elapsed < 10 seconds, with quote age no more than 2 seconds. Require spread at most 1.5 pips, Ask-to-stop distance within 5 to 30 pips inclusive and planned net reward-to-loss at least 1.5. Also require Ask − C(k) ≤ A0; this is a chase cap, not a new entry trigger.
Check the actual price grid, broker stop distances, volume, margin and support for attached protection. Failure of the first quote, explicit request rejection or no quote before expiry ends the consumed setup. A later better quote is not a replacement. The deadline controls sending; a request already sent may still fill and must be reconciled rather than assumed canceled.
8. Rebuild the full fictional OHLC history
The CSV has 80 invented EURUSD H1 candles with completion times from 2026-07-06 00:00 UTC, starting at 1.10000, with 1 pip = 0.00010. Close changes are (+4,−4) × 24, then (+2,−2) × 3, +8, +4 × 17, (+2,−2) × 3 and a final +8, in pips. These are constructed teaching inputs, not broker observations or a profitable trade sample.
Each later open equals the previous close; high is two pips above the larger of open and close, low two pips below the smaller. The initial open equals its close, with high 1.10060 and low 1.09980. Every input, EMA, TR, DM, DI, Wilder mean, ADX, frozen box and event flag is supplied. Blank means unavailable, not zero. The file ends at k79; the entry chart supplies a plan, not a future path or return curve.
9. Inspect the failed box and the independent new event
The first box freezes at k54. At k55, the close 1.10080 is above U 1.10040, and F is true, but ADX is 7.1429. The event is rejected. At k58 ADX reaches 25.6534; the box is already consumed and Q remains zero. Its original A0 is still 7.2821 pips. Later strength does not manufacture another first break.
The next eligible box arms at k78 with U 1.10800, D 1.10740 and A0 7.2128 pips. At k79, close 1.10840 exceeds U by 4 pips, within the frozen buffer/extension bounds. EMA20 is 1.10611961, EMA50 1.10376702 and ADX 84.3187. Q is one at 2026-07-09 07:00 UTC. The displayed values are rounded; decisions use full precision and still need quote checks.
| Candle | Bid close | A0 (pip) | ADX 14 | F | First outside | Q |
|---|---|---|---|---|---|---|
| k54 | 1.10000 | 7.2821 | 0.0000 | 0 | 0 | 0 |
| k55 | 1.10080 | 7.2821 | 7.1429 | 1 | 1 | 0 |
| k58 | 1.10200 | 7.2821 | 25.6534 | 1 | 0 | 0 |
| k78 | 1.10760 | 7.2128 | 83.1124 | 1 | 0 | 0 |
| k79 | 1.10840 | 7.2128 | 84.3187 | 1 | 1 | 1 |
10. Freeze protection using both structure and the pre-break ATR
For a qualified upper event, set S_raw = min[D − 0.25A0, C(k) − 1.5A0]. Round that BUY stop down to the actual tick grid, then set T = C(k) + 3[C(k) − S]. Both are Bid-side exits frozen before the entry quote. The lower stop satisfies both the structural margin and ATR distance; neither may be silently replaced after entry.
At k79 the structural candidate is about 1.10721968 and the ATR candidate 1.10731808. On the assumed grid 0.00001, rounding the lower one down gives S = 1.10721, hence T = 1.11197. The raw values are calculated levels, not executable quote increments. Verify the real tick size and recompute gates after any normalization. The chart's planned Ask marker is separate from its completed Bid candles.
11. Compare alternative first quotes after costs
At 07:00:02 UTC, suppose the first Bid/Ask is 1.10840 / 1.10852. A BUY enters Ask and exits Bid. Spread is 1.2 pips, gross stop 13.1 pips and gross target 34.5 pips. Round-trip commission 0.6 pip plus total adverse-execution reserve 1.0 pip give planned loss 14.7 pips, net target 32.9 pips and ratio 2.2381. The chase is 1.2 pips, within A0, so these arithmetic gates pass.
If the first quote were instead 1.10900 / 1.10912, spread stays the same and chase 7.2 pips remains within unrounded A0. Gross stop is 19.1 pips, planned loss 20.7 pips, net target 26.9 pips and ratio 1.2995, which fails. Reject this branch. These are alternative first quotes, not a choice after waiting. Ask entry against Bid exits already includes the spread effect; do not add it again. Reserves do not cap realized slippage or loss.
| First quote | Bid / Ask | Gross stop (pip) | Loss + costs | Net target | Ratio | Decision |
|---|---|---|---|---|---|---|
| Acceptable | 1.10840 / 1.10852 | 13.1 | 14.7 | 32.9 | 2.2381 | Pass |
| Expensive | 1.10900 / 1.10912 | 19.1 | 20.7 | 26.9 | 1.2995 | Reject |
12. Size against the actual planned loss rather than a fixed lot
Assume snapshot equity 10000 USD and research risk fraction 0.5%, giving 50 USD. With standard contract 100000 EUR, pip value 10 USD per standard lot in the USD account and volume step 0.01, round the budget-based volume down. The accepted quote gives 0.34 lots and planned risk 49.98 USD. The rejected quote produces no order even if a smaller lot would fit the budget.
Use actual contract data and account-currency conversion elsewhere. Apply broker maximum volume, permitted steps, minimum size and margin; skip rather than round up when the minimum is unaffordable. A larger ATR can widen the chosen stop and reduce size, but it does not remove liquidity or gap risk. Existing account exposure needs a separate cap. The budget and reserve are plans, not guarantees of a maximum loss.
13. Keep fixed exits and close the intraday model at its time limit
Keep the initial stop and target active and use the actual Bid-side trigger and broker execution. If still open, request closure at the first executable Bid at or after 18:00 UTC on the setup day. A market closure or outage can delay it. No later EMA/ADX change adds an exit, no target is rolled forward, and there is no automatic short reversal.
Ask touching the target is insufficient for a BUY: Ask 1.11197 with Bid 1.11185 has not reached Bid target 1.11197. Likewise a hypothetical candle with H = 1.11220 and L = 1.10700 spans both fixed exits without revealing which was hit first. Use tick sequence and realistic execution or mark ambiguity; do not assign a convenient winning outcome. The dataset provides no such future candle.
14. Record cancellations and reconcile uncertain execution
Log width failure, missing data, ineligible clock, nonflat state, wrong-side first close, weak or extended break, failed F or ADX, expired quote window, old quote, spread, chase, stop distance, net ratio, volume, margin and broker rejection separately. None is rescued by shifting the box, replacing A0, changing exits or waiting for a later indicator pass. A new day can arm only with clear position and request state.
The ten-second send window is a client rule, not a market-order expiration parameter. After timeout or interruption reconcile broker orders and fills before entering again. Confirm actual volume, price and attached protection. If filled without required protection, attempt immediate controlled closure and block new entries until resolved. Failed or partial closure leaves residual exposure. An uncertain reply is not permission to send a duplicate full BUY.
15. Test added filters without changing the baseline's execution
Start with compact-box first upper events that satisfy the frozen buffer and extension rules. Compare that baseline with EMA filtering, then with EMA plus ADX, keeping the same calendar, frozen ATR, stop/target formulas, quote policy, costs, budget, one-position rule and time exit. Track each model's own chronological positions: removing a trade can change later availability. Raw events and actual requests are different counts.
ATR already defines box eligibility, buffer and protection in this comparison; an ATR-free model would be another experiment. Use adequate Bid/Ask or tick data, realistic failures, later validation and every tried version. Examine net expectancy, drawdown, uncertainty and missed winners rather than chart appearance or win rate alone. Check sensitivity without choosing a new winner per interval. The synthetic example validates definitions and arithmetic, not profitability.
16. Review the complete specification before testing
Verify UTC bar mapping, six completed inputs, valid A0 and fixed U/D. Confirm the first outside-close state, inclusive width and extension bounds, same-candle F and ADX, and the rule against revival. Then check quote freshness, expiry, spread, chase, normalized protection, net ratio, volume, margin and unique request identity. Record real exits and unresolved cases so another researcher can reproduce the process.
This is the second strategy after the three indicator-combination guides. Keep it separate from the completed MACD zero-line model and the next Bollinger middle-band pullback with RSI. A reproducible specification makes research assessable; it does not establish a live-trading recommendation or imply that combining three indicators creates profit.
Frequently asked questions
Why freeze the range and ATR before a breakout?
The future candidate must be judged against information fixed beforehand. Including its high in the range or using its enlarged ATR changes the rule while observing the event. The declared box and scale stay fixed until the opportunity is consumed or expires.
Does ADX at 25 automatically mean buy?
No. ADX is a strength condition without direction. This model also requires the first eligible upper close, frozen distance bounds, EMA context, a valid first quote and complete risk checks. Equality passes the ADX gate alone, not the whole model.
Can later ADX strength revive the rejected k55 event?
No. At k58 ADX passes, but the first outside close already consumed that box. A new eligible day's box is needed. Waiting for strength would define a different strategy with its own expiry, execution and test.
Are Wilder calculations automatically identical to MT4 indicators?
No. Equal period labels do not verify smoothing, seeds, applied inputs or earlier history. This guide defines a reproducible reference. Compare real implementation outputs before substituting platform readings or claiming parity.
Why use a smaller lot when the stop is wider?
With the same budget, a wider planned loss distance costs more per lot. Round volume down using contract value, costs, currency conversion and broker steps. Even correct sizing does not guarantee a maximum realized loss.
Do the charts show a profitable backtest?
No. They show invented OHLC, calculated indicators, frozen levels and alternative quote plans. The CSV ends at the signal, without later trade outcomes. Profitability requires full chronological testing and separate later validation.
Sources and research notes
MetaQuotes documents moving-average, ADX and ATR concepts and the MQL4 interfaces. This lesson separately specifies its own Wilder smoothing, finite-history seeds, daily box state, thresholds, fictional OHLC and execution model. Built-in indicators with the same period labels are not asserted identical: validate the declared reference or treat a different implementation as another model. The CSV ends at the second signal and contains no post-entry returns. Quote plans illustrate arithmetic, not fills or commercial EA performance.
Educational research specification. Prices, charts and quote plans are fictional. Forex trading involves risk. Indicator agreement, planned budgets and protective orders do not guarantee profit or a maximum loss.