This BUY-only model studies the first Stochastic recovery after a fresh reset inside a declared EMA trend. It separates the reset, the first K/D cross and the completed-price confirmation, then permits one first-quote decision. Four reproducible fictional histories show immediate confirmation, a valid one-bar wait, expiry and a protection-level cancellation. The rules specify an experiment, not demonstrated trading profitability.
1. Define the first-recovery hypothesis
EMA summarizes lagging price context; Stochastic describes the close within a recent range. The research question is whether a fresh oscillator pullback and its first recovery, followed by a bounded price gate, define a useful continuation population after costs. Both use overlapping price history. Their agreement is not independent proof of an edge.
Study EURUSD BUY only. No price touch of an EMA is required: the pullback starts from Stochastic, not visual proximity to a moving average. This differs from the existing moving-average price-rejection and Stochastic swing-structure strategies. There is no SELL, averaging, pyramiding, discretionary retest, trailing or automatic reversal in this version.
The MACD and Stochastic ordered double-cross strategy turns the sequence into a complete H1 research specification, with three-bar expiry, rejected event orders, full quote costs and fixed exits.
2. Fix settings, UTC eligibility and position state
Use completed EURUSD Bid H1 OHLC, Close-based EMA20/50 with zero displacement, and Stochastic14 / D3 / slowing3 / MODE_SMA / Low/High. Require at least 55 valid completed candles including the reset. A reset p may close 07:00–12:00 UTC, Monday through Thursday. Subsequent episode bars must be uninterrupted H1 intervals on that same UTC date.
Map actual broker candle intervals to UTC, including historical offset changes; relabeling server time is insufficient. Arm and submit only with no open or pending EURUSD exposure and no unresolved request. Allow one active episode. If a live evaluation, required data or position state is uncertain, skip or cancel; do not replay an old opportunity after reconnecting. Other portfolio exposure needs separate controls.
| Component | Declared setting | Role or limit |
|---|---|---|
| EMA20 / EMA50 | Close; SMA seeds; slow slope over five bars | Trend permission B; price gate is separate |
| Stochastic14 / D3 / slowing3 | Low/High; ratio-of-sums K; SMA D | Fresh reset, then first K/D recovery |
| Episode | Cross p+1…p+4; price r or r+1 | One consumed opportunity; no old-signal revival |
| Execution | First quote; fixed Bid S/T; 20:00 UTC exit | Full costs before downward size rounding |
3. Arm only on a fresh oscillator reset with EMA permission
Define context B(k)=[E20(k)>E50(k)] AND [E50(k)>E50(k−5)]. Comparisons are strict; the first valid context is k54. B does not require the close above E20. The fresh reset is Z(p)=[K(p−1)>20 AND K(p)≤20]. Arm only when idle, eligible, flat and B(p)=1. A persistent K≤20 state is not another reset.
Seek the first fresh recovery cross only at p+1…p+4. A later reset while active cannot move p or extend its deadline. Missing data, a broken interval or B=0 cancels before any confirmation. Check a cross on p+4 before expiring. Cancellation, expiry or qualification consumes the episode; none may rearm on that same bar. A new one needs a later eligible fresh Z.
4. Declare EMA and Stochastic calculations completely
For each N in 20 and 50, seed E_N(N−1)=mean(C0…C(N−1)), then use E_N(k)=[2C(k)+(N−1)E_N(k−1)]/(N+1). Earlier values are unavailable. For Stochastic define LL(k)=min[L(k−13)…L(k)], HH(k)=max[H(k−13)…H(k)], A(k)=C(k)−LL(k) and R(k)=HH(k)−LL(k). Main K(k)=100ΣA/ΣR uses k−2…k; D(k)=[K(k)+K(k−1)+K(k−2)]/3. K first exists at k15, D at k17.
This ratio-of-sums slowing differs from averaging raw percentages. A zero summed range makes K unavailable; D needs three valid K values. Do not substitute zero or stale data. In MQL4, Low/High is price_field=0, with MODE_MAIN and MODE_SIGNAL selecting K and D. The last completed bar is shift=1, its predecessor shift=2; shift=0 is forming. Compare actual platform seeds and timestamped outputs before claiming parity, and decide with unrounded values.
5. Use the first fresh K/D recovery, not a later attractive cross
Define X(k)=[K(k−1)≤D(k−1)] AND [K(k)>D(k)]. Let r be the first X after p inside its four-bar window. This is the recovery event, even when K(r) remains below 20; an exit above 20 is not required. Do not discard an inconvenient first cross and choose a later one from the same reset.
At r freeze the structural Bid stop S=floor_tick(min[L(p)…L(r)]−0.00010) and price barrier P=H(r−1). The one-pip buffer is a declared EURUSD research choice, not a volatility estimate. Both levels stay fixed while awaiting price confirmation. Actual tick size must be known; the synthetic example assumes tick=0.00001. Later lows cannot widen S or replace P. On the assumed five-decimal quote, one point is also 0.00001 and one pip equals ten points.
6. Give price confirmation only one additional bar
Evaluate q=r first. Require C(q)>E20(q), C(q)>P, B(q)=1 and K(q)>D(q), with the full candle low above S. If the price gate fails, only q=r+1 remains. Cancellation takes priority if data or B fails, K≤D or L(q)≤S. Otherwise test the price gate on r+1 before expiring. Equality at either price gate fails; equality at the stop invalidates.
One passing close sets Q=1 and consumes the episode; it is still not a fill. With p no later than noon, r can be no later than 16:00 and q no later than 17:00 on the reset date. A missing expected bar expires the opportunity, not extends it. An old recovery cannot be moved to r+2. At qualification freeze target T=floor_tick(C(q)+3[C(q)−S]); it is anchored to the signal close, not three times actual net risk.
7. Inspect one first quote within a separate sending window
After qualified close t, inspect exactly the first observed two-sided quote. Require quote age 0≤age≤2 s, 0≤elapsed<10 s, spread≤1.5 pips, Ask−C(q)≤3.0 pips, gross Ask-to-stop distance within 5–35 pips and planned net reward/loss at least 1.5. Require Bid>max(S,P,E20(q)), ordered valid prices and Ask<T. Inclusive distance bounds do not relax the strict price comparisons.
Check the actual price grid, stop constraints, attached protection, permitted volume, free margin and flat EURUSD state before sending. A bad first quote, no quote before expiry or explicit rejection consumes the opportunity; do not await a cheaper second quote. These seconds limit an unsent request. They are not the broker expiration parameter for a market order and do not cancel an already sent request.
8. Rebuild four separate fictional input histories
All cases begin with close 1.10000 at 2026-07-06 09:00 UTC, with 1 pip=0.00010. Subsequent close changes in pips are: immediate +2×65,−2×8,+2×7; delayed +2×65,−3×7,+2×8; expired +2×65,−3×8,+2×8; cancelled +2×65,−3×7,+2×2,−5×1,+4×4. Open equals previous close, except k0 where open equals close. High is one pip above max(open,close), low one pip below min(open,close).
The cases contain 81,81,82,80 rows, 324 altogether. They share prefixes and are separate teaching histories, not independent trade samples or consecutive actual positions. CSV records indicators and the episode engine assuming flat eligibility, with no submitted orders or future trade outcomes. It ends before the same-day time exit. Exact rational arithmetic defines equality; the displayed CSV decimals are approximations.
Download all four fictional OHLC histories and episode calculations
9. Read immediate confirmation, including a cross below 20
In the immediate case, reset p=k73 completes at 2026-07-09 10:00 UTC. The first recovery is r=k75 at 12:00 UTC. K is 16.6667, D 13.2479; K remains below 20, which is allowed. Close 1.11180 exceeds E20 1.111614 and frozen P 1.11170. B passes, so q=r and Q=1.
The minimum low from p through r is 1.11130; the buffered stop is S=1.11120, target T=1.11360. The later 20-level exit is not the entry event. All panels share the completed-bar axis, and the history supplies no fill or profit. The separate first-quote branches below still determine whether an order may be sent.
| Case / bar | Bid close | EMA20 | K | D | Episode action | Q |
|---|---|---|---|---|---|---|
| Immediate case · k73 | 1.11140 | 1.111594 | 13.4615 | 28.7464 | Arm | 0 |
| Immediate case · k75 | 1.11180 | 1.111614 | 16.6667 | 13.2479 | Qualified close | 1 |
| One-bar wait case · k74 | 1.11130 | 1.111359 | 13.0435 | 10.0477 | Wait for price | 0 |
| One-bar wait case · k75 | 1.11150 | 1.111372 | 21.7391 | 14.1195 | Qualified close | 1 |
| Expired case · k76 | 1.11120 | 1.111238 | 19.2308 | 12.4786 | Price deadline expired | 0 |
| Expired case · k77 | 1.11140 | 1.111254 | 26.9231 | 19.2308 | An old recovery does not revive | 0 |
| Protection cancellation · k75 | 1.11080 | 1.111305 | 12.8571 | 11.1588 | Protection touched: cancel | 0 |
10. Allow the declared one-bar wait without moving the stop
In the delayed case, p=k72 completes at 09:00 UTC and the first cross r=k74 at 11:00 UTC. Close 1.11130 is below E20 1.111359, so price is not confirmed yet. Freeze S=1.11070 and P=1.11120 at r. This first cross is retained only for the single extra bar already specified.
At q=k75, 12:00 UTC, close 1.11150 exceeds E20 1.111372 and P. K>D and B remain valid, and the low stays above S. Q=1 even though X=0 there: q is price confirmation of the stored first recovery, not a fresh oscillator cross. S is unchanged and target becomes 1.11390. Never backdate the decision or a fill to r.
11. Show expiry and protection cancellation on the same axes
In the expired case, p=k72 and first cross r=k75. At k76, the last candidate, close 1.11120 is still below E20 1.111238; expire after checking it. At k77 price finally passes the gate, but X=0 and Q stays zero. The old episode cannot be revived by a better-looking chart.
The cancelled case shares the delayed history through r=k74. On k75 its low equals frozen S=1.11070. Cancel before confirmation even though K remains above D. No position has been entered, so this is invalidation of planned protection, not a reported stopped trade. Additional recovery crosses or later rebounds need a new eligible reset after the consumed bar.
12. Compare alternative first quotes after all costs
Use the immediate case’s fixed exits. If the first quote at 12:00:02 UTC is 1.11180 / 1.11192 Bid/Ask, spread is 1.2 pips and gross stop 7.2 pips. Add round-trip commission 0.6 pip plus total adverse-execution reserve 1.0 pip: planned loss 8.8 pips, net target 15.2 pips, ratio 1.7273. It passes the numeric gates, subject to broker checks.
If the first quote were instead 1.11198 / 1.11210, chase is exactly 3.0 pips and passes its inclusive cap. Yet planned loss is 10.6 pips, net target 13.4 pips, ratio 1.2642: reject, regardless of lot size. These are alternative first quotes, not quotes selected after waiting. With equity 10000 USD, budget 0.5%=50 USD, contract 100000 EUR, pip value 10 USD/lot and lot step 0.01, the acceptable quote gives 0.56 lots and planned risk 49.28 USD. Round down, skip below the minimum, and count spread only once through Ask entry and Bid exits; actual loss can exceed the reserve.
| First quote | Bid / Ask | Stop (pip) | Loss + costs | Net target | Ratio | Decision |
|---|---|---|---|---|---|---|
| Acceptable | 1.11180 / 1.11192 | 7.2 | 8.8 | 15.2 | 1.7273 | Numeric gates pass |
| Expensive | 1.11198 / 1.11210 | 9.0 | 10.6 | 13.4 | 1.2642 | Reject: poor net ratio |
13. Keep fixed Bid exits and a same-day time exit
Keep S and T unchanged after entry. BUY stop and target are tested on Bid, not Ask. If still open, request closure at the first executable Bid at or after 20:00 UTC on the reset day. A new oscillator cross or EMA change adds no separate exit; there is no break-even, partial close, trailing or automatic re-entry from this episode.
For the immediate example, Ask1.11360 / Bid1.11348 has not reached the Bid target. A separate hypothetical candle with H=1.11380 and L=1.11100 spans both exits without revealing their order. Use tick chronology or mark ambiguity; do not choose the winning outcome. This candle is outside the CSV, and a gap can fill a stop worse than its level or delay the requested time exit.
14. Reconcile request uncertainty before allowing another episode
Record p, r, q, exact indicators, frozen P/S/T, the first quote and age, sending time, request identity, requested volume, actual fills and accepted protection. A timeout does not prove rejection. Reconcile broker orders and positions before resending or declaring the symbol flat; a duplicate BUY can double exposure. A timely request may fill after the sending deadline.
If a fill lacks required protection, request controlled immediate closure and block new entries until exposure and request status are resolved. Continue managing any residual after a failed or partial close. If execution or recovery occurs after the 20:00 exit time, seek closure at the first executable quote. Do not silently widen protection or replay an expired setup. Verify actual tick size/value, account-currency conversion, margin and swaps; decimal digits alone do not determine them.
15. Test the trend permission without changing other rules
Compare the full model with a variant removing only B, including its cancellation. Keep the same oscillator reset, first-cross window, fast-EMA price gate C>E20, frozen barrier, protection, quote policy, costs, size and time exit. This is a test of the slow-trend permission; the variant still uses E20 for price confirmation and is not an oscillator-only model.
Track each variant’s own chronological position and episode state. Removing a trade can make another setup available, so deleting selected rows from a completed trade list is insufficient. Reserve later data and retain every tried period, deadline and threshold. Report net expectancy, drawdown, sample uncertainty, missed winners and execution failures. Four invented histories check definitions and arithmetic, not profitability.
16. Review the complete specification before testing it
Check the UTC clock and eligibility, finite EMA seeds and slope, full Stochastic settings, fresh Z, first X and both deadlines. Verify cancellation priority, frozen P/S, strict price gates, first-quote freshness, chase, net ratio, downward lot rounding and fixed exits. Preserve rejected, expired, uncertain and filled states separately. Another reader should reproduce decisions without choosing convenient candles.
This is the first strategy following the three new combination guides. The next is MACD with Stochastic and ordered double-cross confirmation, followed by SAR with ADX and controlled trailing. Their entry events and exit policies remain separate. The present specification makes one research idea reviewable; it does not recommend a live position or claim that an additional indicator creates profit.
Frequently asked questions
Must price touch an EMA to start this strategy?
No. A fresh downward Stochastic crossing into K≤20 starts the pullback episode while EMA context passes. Price confirmation is separate; visual proximity or a touch of an average is not required.
Must the first recovery cross also leave the 20 zone?
No. Recovery means the first fresh upward K/D cross after the reset. In the immediate example K is still below 20. A zone-exit condition would define another model.
How long can price confirmation wait after the first cross?
It is tested on the recovery bar and, if necessary, exactly the next completed H1 bar. Invalid data, lost context, K≤D or a low at the frozen stop cancels first. Later confirmation cannot revive it.
Can a second cross replace a failed first recovery?
No. The first cross inside p+1 through p+4 owns the bounded opportunity. Rejection or expiry consumes the episode; a new one needs a later fresh eligible oscillator reset.
Does a three-distance target mean a net three-to-one ratio?
No. The target uses the signal Bid close and frozen stop. Ask entry, costs and rounding determine the actual planned net ratio; the expensive first quote fails despite passing its chase cap.
Are the supplied charts a profitable backtest?
No. Four fictional histories and alternative quotes verify calculations and event order. There are no actual fills, measured returns or commercial EA results in these examples.
Sources and research notes
MetaQuotes documents iMA, iStochastic, OrderSend and symbol properties, and publishes the ratio-of-sums Stochastic reference. Finite EMA seeds, episode rules, time limits, fixed protection, cost assumptions and synthetic histories below are our original research specification. No native-terminal parity, measured trading returns or commercial EA behavior is claimed. The input CSV supplies OHLC and calculations; unrounded rational arithmetic determines its events.
- MQL4 Reference: iMA
- MQL4 Reference: iStochastic
- MetaQuotes: Stochastic ratio-of-sums reference
- MQL4 Reference: OrderSend
- MQL4 Reference: Symbol Properties
Educational research specification. Histories, quotes and planned executions are fictional. Forex trading involves risk; indicators, stops and planned budgets cannot guarantee profit or a maximum actual loss.