ForexBestRobots.comCompare EAs →
EN

Indicator combinations · Strategy 2

MACD and Stochastic Forex Strategy: Ordered Double-Cross Confirmation

A precise EURUSD H1 research model: Stochastic crosses first, a fresh MACD cross must follow within three bars, then price, full costs and fixed exits decide.

A fresh Stochastic event must precede a new MACD main/signal cross. Completed H1 candles define the three-bar deadline; fictional inputs show no measured performance.
A fresh Stochastic event must precede a new MACD main/signal cross. Completed H1 candles define the three-bar deadline; fictional inputs show no measured performance.

This BUY-only research strategy tests an ordered pair of events, not two indicators that happen to point upward. A fresh Stochastic K/D cross starts an episode while MACD main is still at or below its signal. The first new MACD cross must arrive during the next three completed H1 candles. Five reproducible fictional histories distinguish timely confirmation, expiry, reversed order, simultaneous crosses and oscillator cancellation. A qualified close still needs one acceptable first quote.

1. Define the ordered-event hypothesis

Stochastic locates a close within its recent range; MACD compares smoothed prices. The question is whether a new Stochastic recovery followed by a later MACD recovery defines a useful continuation population after costs. Both use overlapping prices. Two agreeing indicators do not supply two independent proofs of an edge.

Study EURUSD BUY only. This differs from the MACD zero-line/RSI model and the EMA/Stochastic first-recovery strategy. There is no zero-line requirement, 20/80-zone prerequisite, EMA-touch test, SELL, averaging, pyramiding, discretionary retest or automatic reversal. The sequence and its price gate are the experiment; parameter values are declared research choices, not optimized recommendations.

2. Fix completed-bar settings, UTC and position state

Use completed EURUSD Bid H1 OHLC and Close-based MACD12/26 / signal9 SMA, plus Stochastic14 / D3 / slowing3 / MODE_SMA / Low/High. Require at least 35 valid completed candles. A setup p may close 07:00–16:00 UTC, Monday through Thursday. An active episode needs uninterrupted H1 intervals on the same UTC date.

Convert actual broker candle intervals to UTC, including historical offset changes; changing server-time labels is insufficient. Arm and send only with no open or pending EURUSD exposure and no unresolved request. One episode may be active. Missed evaluation, uncertain data or unknown position state means skip or cancel, without replay after reconnection. Other portfolio exposure needs separate controls.

ComponentDeclared settingRole or limit
MACD12/26 / signal9Close; finite SMA seeds; SMA9 signalFresh later main/signal cross, not a zero-line state
Stochastic14 / D3 / slowing3Low/High; ratio-of-sums K; SMA DFresh X starts the episode while M≤G
EpisodeY on p+1…p+3; price at first Y onlyCancellation first; no revival after consumption
ExecutionFirst quote; fixed Bid S/T; 21:00 UTC exitFull costs before downward lot rounding

3. Declare MACD and Stochastic calculations completely

For N in 12 and 26 initialize E_N(N−1)=mean(C0…C(N−1)), then E_N(k)=[2C(k)+(N−1)E_N(k−1)]/(N+1). Define M(k)=E12(k)−E26(k), G(k)=mean[M(k−8)…M(k)] and diagnostic H(k)=M(k)−G(k). M starts at k25 and G at k33. The MT4 main bars represent M, not H; the declared signal is SMA9, not an EMA signal borrowed from another platform.

For Stochastic use LL(k)=min[L(k−13)…L(k)], HH(k)=max[Hprice(k−13)…Hprice(k)], A(k)=C(k)−LL(k), R(k)=HH(k)−LL(k), K(k)=100ΣA/ΣR over k−2…k and D(k)=[K(k)+K(k−1)+K(k−2)]/3. Hprice denotes the candle high; H alone is the diagnostic MACD difference. K first exists at k15, D at k17. A zero summed range makes K unavailable; D requires three valid K values. Low/High is price_field=0; MODE_MAIN/MODE_SIGNAL select the relevant lines. Use completed shift=1 and prior shift=2, never forming shift=0. Do not fill unavailable data with zero; compare actual seeds and timestamped outputs before claiming terminal parity.

Finite EMA initialization, MACD main with SMA9 signal and ratio-of-sums Stochastic are explicit. Diagnostic H is not the native MT4 main histogram.
Finite EMA initialization, MACD main with SMA9 signal and ratio-of-sums Stochastic are explicit. Diagnostic H is not the native MT4 main histogram. On small screens, scroll the chart horizontally to keep labels readable.

4. Arm on a fresh Stochastic cross while MACD has not crossed

Define X(k)=[K(k−1)≤D(k−1)] AND [K(k)>D(k)] and Y(k)=[M(k−1)≤G(k−1)] AND [M(k)>G(k)]. X first becomes calculable at k18, Y at k34. When idle, eligible and flat, arm at p only if X(p)=1 and M(p)≤G(p). Freeze price barrier P=Hprice(p−1). K need not be below 20; M may be above or below zero.

If X and Y occur together, M(p)>G(p) blocks arming. If MACD crossed earlier and merely remains above G, a new X cannot reuse it. A persistent K>D state is not a new X. An active episode owns its original p and deadline; additional apparent events cannot restart the timer. Missing required data cancels rather than manufactures a cross.

A fresh Stochastic cross arms only while M≤G. The first later MACD cross must arrive on p+1 through p+3; no timer restart or simultaneous entry.
A fresh Stochastic cross arms only while M≤G. The first later MACD cross must arrive on p+1 through p+3; no timer restart or simultaneous entry. On small screens, scroll the chart horizontally to keep labels readable.

5. Accept only the first later MACD event within three bars

Let q be the first Y after p inside p+1…p+3. Require valid uninterrupted data, the same UTC date and K(k)>D(k) on every intervening bar, including q. Invalid data, a broken interval or K≤D cancels before checking Y. On p+3 test Y before expiry. With the latest p at 16:00, the latest possible q is 19:00 UTC.

At that first Y require C(q)>P. Equality fails. If price fails, consume the episode immediately: there is no extra price-confirmation bar, later Y substitution or r-style recovery memory from the EMA strategy. Qualification, rejection, cancellation and expiry all consume the episode, with no rearming on that bar. Only a later fresh eligible X can start another one. A Y after p+3 cannot revive the old setup.

6. Freeze structural protection from information available at q

At a passing first Y freeze Bid stop S=floor_tick(min[L(p)…L(q)]−0.00010) and target T=floor_tick(C(q)+2[C(q)−S]). The one-pip structural buffer and two-distance target are declared choices. P was already frozen at p; S and T use no candles after q. Later lows or highs cannot move these levels. Q=1 records qualification, not a fill.

The example assumes 1 pip=0.00010 and tick=point=0.00001, so one pip equals ten points on that five-decimal quote. Know the actual broker tick size and grid; digits alone do not establish tradeable increments or tick value. A target two signal-close distances away does not mean an actual net two-to-one trade: Ask entry, costs and rounding change the geometry.

Freeze the previous high at p, then the structural stop and target at qualification q. No candle after q enters those levels, and price has no extra waiting bar.
Freeze the previous high at p, then the structural stop and target at qualification q. No candle after q enters those levels, and price has no extra waiting bar. On small screens, scroll the chart horizontally to keep labels readable.

7. Inspect one first quote within a separate sending deadline

After qualified close t inspect exactly the first observed two-sided quote. Require 0≤age≤2 s, 0≤elapsed<10 s, spread≤1.5 pips, Ask−C(q)≤4.0 pips, gross Ask-to-stop distance 5–40 pips and planned net reward/loss at least 1.5. Also require valid ordered prices, Bid>max(S,P) and Ask<T. Distance bounds include equality; the price inequalities remain strict.

Before sending check actual grid, stop constraints, attached protection, volume limits, free margin and flat EURUSD state. A bad first quote, no quote before expiry or explicit rejection consumes the chance; do not wait for a cheaper second quote. Seconds constrain an unsent request, not the lifetime of a sent market request. They are not the broker’s pending-order expiration parameter. If the broker checks outlast the sending window, consume the chance without sending; do not replace the first quote with a newer one.

8. Rebuild five separate fictional histories

Start every history with close 1.08000. The first completed timestamp is 2026-07-06 16:00 UTC, except reversed order, which starts 2026-07-06 09:00 UTC. Close changes in pips are timely 0×39,+3×20,−4×4,+8×7; late 0×39,+3×20,−4×8,+7×9; reversed 0×39,+3×20,−4×4,+8×6,−2×1,+3×6; simultaneous 0×39,+3×4; cancelled 0×39,+3×20,−4×4,+8×2,−20×1.

Open equals previous close, except k0 where they coincide. High is one pip above max(open,close), low one pip below min(open,close). Row counts are 71,77,77,44,67, 336 altogether. Shared price prefixes and the separate reversed-case clock do not create independent trade samples. CSV records exact-rule indicator episodes under flat eligibility, with no submitted orders or trade outcomes, and ends before the 21:00 exit. Rational arithmetic decides equality; displayed decimals are approximations.

Download all five fictional OHLC histories and episode calculations

9. Read the timely ordered confirmation on shared axes

In the timely history p=k65 closes at 2026-07-09 09:00 UTC. X=1, K 68.9655 exceeds D 63.7326, but M 0.001080729 is below G 0.001221014. Freeze P at 1.08530. Positive M alone does not count as MACD confirmation.

The first Y arrives at q=k67, 11:00 UTC, inside the deadline. M 0.001254174 exceeds G 0.001205510; K>D persists and close 1.08760 exceeds P. The minimum low from p through q is 1.08510, giving S=1.08500, T=1.09280 and Q=1. Price, K/D and M/G panels use the same completed-bar positions; quote acceptance still comes later.

Timely case: X at k65 precedes Y at k67. Price, K/D and MACD main/signal share completed-bar positions; qualification does not yet imply a fill.
Timely case: X at k65 precedes Y at k67. Price, K/D and MACD main/signal share completed-bar positions; qualification does not yet imply a fill. On small screens, scroll the chart horizontally to keep labels readable.
Case / barBid closeKDMACD MSignal GEpisode actionQ
Timely case · k651.0860068.965563.73260.0010807290.001221014Arm0
Timely case · k671.0876096.774284.31630.0012541740.001205510Qualified close1
Late case · k711.0856064.705944.11760.0005391920.000650274Episode expired0
Late case · k721.0863082.857163.89360.0006555570.000601283An old episode cannot revive0
Reversed-order case · k671.0876096.774284.31630.0012541740.001205510An old episode cannot revive0
Reversed-order case · k721.0896096.774296.64730.0017545700.001392803Reject: MACD already crossed0
Simultaneous case · k401.0803066.666755.55560.0000239320.000002659Reject: simultaneous events0
Oscillator cancellation · k661.0840060.256462.86560.0009261810.001185796K≤D: cancel0

10. Expire the episode before a late but attractive cross

In the late history p=k68 closes at 12:00 UTC. X is fresh while M≤G. The last candidate is k71, 15:00 UTC; there is no Y, so expire after checking it. No price improvement or smaller order size can extend that signal deadline.

At k72, 16:00 UTC, a fresh Y finally appears: M 0.000655557 exceeds G 0.000601283. It is p+4 and Q stays zero. A persistent K>D state is not a replacement X. The later chart can look convincing while the declared strategy correctly remains without an entry opportunity.

Late case: k71 expires after the final check. The fresh MACD cross at k72 is p+4 and cannot revive the old opportunity, despite improving prices.
Late case: k71 expires after the final check. The fresh MACD cross at k72 is p+4 and cannot revive the old opportunity, despite improving prices. On small screens, scroll the chart horizontally to keep labels readable.

11. Separate reversed order, simultaneous events and cancellation

The reversed history has its own stated clock. Y at k67 occurs at 04:00 UTC; the earlier X at k65 was outside entry hours. At k72, 09:00 UTC, X is new but M 0.001754570 already exceeds G 0.001392803: reject the order of events. In the simultaneous history, k40 at 2026-07-08 08:00 UTC has X=Y=1; it also cannot arm this ordered model.

The cancelled history arms at p=k65, then k66, 10:00 UTC, has K 60.2564 below D 62.8656. Cancel before considering any Y. There is no entered position or reported stop loss. Missing data and K=D have the same cancellation priority. A new eligible X on a later bar may form a separate episode; none of these rejections grants discretionary reuse of the old one.

Separate rejection cases: earlier MACD before a new X, simultaneous X/Y, and loss of K>D while waiting. No actual position or stop loss is implied.
Separate rejection cases: earlier MACD before a new X, simultaneous X/Y, and loss of K>D while waiting. No actual position or stop loss is implied. On small screens, scroll the chart horizontally to keep labels readable.

12. Compare alternative first quotes after full costs

Use the timely case’s fixed S and T. If the first quote at 11:00:02 UTC is 1.08760 / 1.08772 Bid/Ask, spread is 1.2 pips and gross stop distance 27.2 pips. Add round-trip commission 0.6 pip and total adverse-execution reserve 1.0 pip: planned loss 28.8 pips, net target room 49.2 pips, ratio 1.7083. Numeric gates pass, subject to broker checks.

If the first quote were 1.08788 / 1.08800, chase is exactly 4.0 pips and passes its inclusive cap, but loss 31.6 pips, net target 46.4 pips and ratio 1.4684 require rejection at any lot size. With equity 10000 USD, risk budget 0.5%=50 USD, contract 100000 EUR, pip value 10 USD/lot and lot step 0.01, the acceptable quote gives 0.17 lots and planned risk 48.96 USD. Round down and skip below minimum. Count spread once through Ask entry and Bid exits; actual loss can exceed the reserve.

Alternative first quotes share fixed exits. The dearer quote passes its four-pip chase cap but fails net reward/loss; reducing volume cannot repair it.
Alternative first quotes share fixed exits. The dearer quote passes its four-pip chase cap but fails net reward/loss; reducing volume cannot repair it. On small screens, scroll the chart horizontally to keep labels readable.
First quoteBid / AskStop (pip)Loss + costsNet targetRatioDecision
Acceptable1.08760 / 1.0877227.228.849.21.7083Numeric gates pass
Expensive1.08788 / 1.0880030.031.646.41.4684Reject: poor net ratio

13. Keep fixed Bid exits and a same-day time exit

Keep S and T unchanged after entry. BUY protection is tested on Bid. If still open, request closure at the first executable Bid at or after 21:00 UTC on p’s date. Oscillator or MACD changes add no exit. There is no break-even, partial close, trailing, averaging or automatic re-entry from this episode.

For the timely example Ask1.09280 / Bid1.09268 has not reached the Bid target. A separate hypothetical candle with Hprice=1.09300 and L=1.08480 spans both exits without revealing their order. Obtain tick chronology or mark ambiguity; do not select the winning path. This candle is outside the CSV. Gaps can worsen a stop fill or delay the requested time exit.

BUY exits use Bid. Ask touching the target alone is insufficient; OHLC spanning both exits hides their order. Same-day time closure starts at 21:00 UTC.
BUY exits use Bid. Ask touching the target alone is insufficient; OHLC spanning both exits hides their order. Same-day time closure starts at 21:00 UTC. On small screens, scroll the chart horizontally to keep labels readable.

14. Resolve execution uncertainty before starting another episode

Log exact indicators, p/q, frozen P/S/T, the first quote and its age, send time, request identity, requested volume, actual fills and accepted protection. A timeout does not prove rejection. Reconcile broker orders and positions before retrying or declaring EURUSD flat; a duplicate BUY can double exposure. A request sent in time can fill after the send deadline.

If a fill lacks required protection, seek controlled immediate closure and block new entries until exposure and request state are resolved. Manage any residual after failed or partial closure. If execution or recovery occurs after 21:00, seek closure at the first executable quote. Never silently widen protection or replay expired setups. Verify actual tick size/value, account-currency conversion, margin and swaps before applying the USD sizing example elsewhere.

15. Compare the complete policy without cherry-picking trade rows

Compare with a Stochastic-only variant that removes both MACD restrictions: no M≤G arming gate and no Y wait, with decision q=p on each eligible fresh X. Keep the same prior-high barrier, strict price test, stop formula using p through q, target rule, first-quote policy, costs, size and time exit. The variant can fail the price gate on p and must consume that episode too.

This comparison changes permission and entry timing together; it does not isolate an independent causal contribution from MACD. Run each variant’s own chronological position and episode state rather than deleting rows from a finished trade list. Reserve later data, keep all tried parameters and report net expectancy, drawdown, sample uncertainty, missed opportunities and execution failures. Five invented histories verify rules and arithmetic, not profitability.

16. Review the whole specification before testing

Check actual UTC intervals, finite EMA initialization, SMA9 signal semantics, full Stochastic settings, fresh X then fresh Y and cancellation priority. Confirm p+3 is checked before expiry, P stays frozen, price cannot wait after the first Y, S/T use only completed data and all quote and cost gates precede lot sizing. Keep rejected, expired, uncertain, qualified and filled states distinct.

This is strategy two in the current combination cluster. The remaining strategy studies SAR with ADX and controlled trailing, with its own event and protection rules. This specification makes one research idea reproducible; it is not a recommendation for a live trade or a claim that adding MACD makes Stochastic profitable.

Frequently asked questions

Do both indicators have to cross on the same candle?

No. This ordered model rejects simultaneous crosses. Stochastic X must come first while M≤G; the first new MACD Y may confirm only on one of the next three completed bars.

Is a positive MACD main value sufficient confirmation?

No. Y means a fresh main/signal crossover, not a main/zero crossover or an already true M>G state. The declared signal average is SMA9.

Does Stochastic have to leave the 20 zone?

No. This version has no 20/80 prerequisite. X is the fresh K/D upward cross; the timely setup occurs with K already above 20.

Can price wait another candle after the first MACD cross?

No. If C(q) does not strictly exceed the frozen prior-high barrier at that first Y, the episode is consumed. A later price improvement cannot rescue it.

Does the two-distance target guarantee a net two-to-one ratio?

No. The target is anchored to the signal Bid close and stop. Ask entry and full costs determine the actual planned net ratio; the expensive first quote is rejected despite passing the chase cap.

Are these histories a profitable trading backtest?

No. Five fictional OHLC histories and alternative first quotes demonstrate calculations and event order. They contain no actual fills, measured trading returns or commercial EA results.

Sources and research notes

MetaQuotes documents MACD main and its simple signal average, the Stochastic API and ratio-of-sums reference, OrderSend and symbol properties. Finite EMA initialization, event sequence, three-bar window, UTC rules, protection and cost assumptions below are our original research specification. The examples are fictional calculation fixtures, not native-terminal parity tests, measured returns or commercial EA results.

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.