A momentum indicator can improve again after a rejected entry. This model does not treat that improvement as permission to try again. One strict MACD segment gets one first-turn setup, one next-bar confirmation and one first-quote decision. The examples are invented to explain execution, not evidence of an edge.
1. What this strategy is testing
The hypothesis is that the first recovery of momentum inside an existing directional move may be worth testing. It differs from a MACD zero-cross strategy: the main line and its difference from the signal already have the same sign. There is no EMA trend filter, zero-cross entry, averaging or later retry. This is a specification for research, not a ready Expert Advisor or a demonstrated profitable system.
Use continuous scheduled M5 bars and closed data only. The teaching instrument is fictional EURUSD: pip=0.0001; point=tick=0.00001. All analytical OHLC values are Bid. Real SELL protection also requires paired Ask history. Missing bars, unavailable indicators, unknown exposure or unreconciled state block a new entry. Never substitute the next available bar for a missing scheduled confirmation.
2. Define MACD and ATR before testing
With closing prices, M=EMA12(Close)−EMA26(Close); SIGNAL=SMA9(M); D=M−SIGNAL. The signal is a simple moving average in this MT4-based definition. The usual MT4 MACD histogram displays the main value M; D is the separate MACD-minus-signal quantity, also called OsMA. It is not a third independent confirmation. The fixture seeds both EMAs with the first close; compare seeds and warm-up before comparing platforms.
Define TR=max(High−Low,abs(High−PreviousClose),abs(Low−PreviousClose)); ATR14_SMA=mean(last 14 TR) on Bid bars. This article deliberately uses a simple ATR average, not Wilder smoothing. An indicator named ATR(14) does not establish equivalence. The CSV starts ATR at index 13 and uses the first close as the initial previous close. Shift 0 is forming: S is shift 1 at its close, then shift 2 when C closes. Store bar timestamps, not moving shift numbers.
3. One opportunity per strict segment
A BUY segment exists while M>0 AND D>0; a SELL segment while M<0 AND D<0. It begins when that condition becomes true after being false and ends as soon as it becomes false. Zero is outside either strict segment. Only a new segment can create a new opportunity after consumption; opening the trading window does not reset the segment.
Track the segment from its actual start, including bars outside the entry window. Consume its first structural turn immediately, even if the setup body, ATR, time, confirmation, quote or risk gate fails. A restart must reconcile exposure and replay segment state without sending historical orders. If the consumed flag cannot be established, hold new entries rather than assuming the segment is unused.
4. The four closed readings that select S
Let U=abs(D). The first setup S requires U[s−3]>U[s−2]>U[s−1]>0 AND U[s]>U[s−1], with all four bars inside the current strict segment. That means three successively smaller readings, or two decreases, followed by a rise. Equal values do not pass. Evaluate full values, not rounded chart labels.
In the BUY fixture, the closes at 07:45 / 07:50 / 07:55 / 08:00 UTC have D in pips of 0.0688148631 / 0.0638322058 / 0.0592009819 / 0.0903521327. Main M stays positive. The last bar is S; it selects a candidate and consumes the segment, but it does not send an order. The SELL construction mirrors the signs, so the same absolute-value pattern applies.
| UTC time | Main | Signal | Difference |
|---|---|---|---|
| 07:45 | 3.3199691418 | 3.2511542787 | 0.0688148631 |
| 07:50 | 3.3332038698 | 3.2693716640 | 0.0638322058 |
| 07:55 | 3.3454737693 | 3.2862727874 | 0.0592009819 |
| 08:00 | 3.3967339610 | 3.3063818283 | 0.0903521327 |
5. Setup quality and a frozen protective stop
Both S and C must close inside [07:00,10:00) UTC. These are bar-close times, not broker-chart labels; verify the broker offset for the date. A BUY S must close above its open; a SELL S below it. Require 2<=ATR_S/pip<=8; TR(S)<=1.25×ATR_S. Freeze ATR_S at S. The window is a research choice and does not guarantee a liquid or news-free market.
Freeze BUY protection at S_bid=floor_tick(BidLow(S)−0.2 pip), or SELL protection at S_ask=ceil_tick(AskHigh(S)+0.2 pip). The tick functions round down or up to the executable tick. A real SELL setup needs the actual paired Ask high; adding today's spread to an old Bid high does not recover it. The fixture's constant 0.8-pip Ask offset is an invented data contract only.
6. Only the next scheduled bar can confirm
C is exactly the bar closing five minutes after S. First cancel if BUY: BidLow(C)<=S_bid; SELL: AskHigh(C)>=S_ask, even if C later closes beyond the entry threshold. Then require the same strict segment, the time window and TR(C)<=1.5×ATR_S. Price must satisfy BUY: BidClose(C)>BidHigh(S)+0.1 pip; SELL: BidClose(C)<BidLow(S)−0.1 pip. Equality, a missing C or a failed C consumes the opportunity.
At a valid C close, freeze BUY: T_bid=floor_tick(BidClose(C)+2×ATR_S); SELL: T_ask=ceil_tick(AskClose(C)−2×ATR_S). This target uses the stored setup ATR and the correct exit quote side. It is not a fixed R multiple. Do not move either level when MACD, ATR, spread or price later changes. There is no pending order at the setup extreme and no second confirmation bar.
| Side | Stop | Target |
|---|---|---|
| BUY | 1.10061 | 1.10196 |
| SELL | 1.10147 | 1.10012 |
7. One first quote and one initial request
Use the first observed symbol quote after the scheduled C close on which C can be processed. If C's completed data are unavailable on that observation, consume the setup. Require positive prices with Ask at least Bid, spread<=1.0 pip; abs(Bid_ref−BidClose(C))<=0.5 pip and own-symbol quote receipt age <=250 ms. Receipt age is elapsed time since local receipt, not a claim that an MT4 server timestamp measures network delay.
Send at most one initial market request by C+1 second, inclusive; no quote by the deadline means expiry. A bad first quote cannot be replaced by a later good one. Before sending, recheck current prices, receipt age, costs, exposure, margin, minimum lot, permissions and broker stop constraints. Keep S, T and the first-sized volume fixed; the current-price risk calculation must still fit the budget. If the interface cannot submit the fixed SL/TP with the entry request, skip. Never widen protection or resize while waiting to repair a failure.
8. BUY: from closed bars to the actual fill
S closes at 08:00 and C at 08:05 UTC. Here ATR_S=4.8 pips; S_bid=1.10061; T_bid=1.10196. The first quote arrives at 08:05:00.100; Bid/Ask=1.10100/1.10108. Spread is 0.8 pip and the Bid reference equals C's close. Use the adverse entry allowance to plan at F_plan=Ask_ref+0.2 pip=1.10110, not at the Bid chart close.
The net-risk calculation below gives L=5.8 pips; W=7.7 pips; W/L=1.327586; lots=0.43. The protected request is sent at 08:05:00.300 with receipt age 200 ms. The invented server fill is 1.10109 at 08:05:00.450 and acknowledgement at .500. Those are different events. Recalculate actual exposure from the confirmed fill; the volume was chosen before sending and is not rewritten afterwards.
9. SELL: Ask levels and a Bid entry
The separate SELL branch reverses the Bid candles and indicator signs. Its first Bid/Ask is again 1.10100/1.10108, with ATR_S=4.8 pips; S_ask=1.10147; T_ask=1.10012. The entry sells at Bid; adverse planning uses F_plan=Bid_ref−0.2 pip=1.10098. Stop and target are Ask exit levels, so neither may be tested against the Bid chart alone.
The same assumptions produce L=5.8 pips; W=7.7 pips; lots=0.43; the actual fictional entry is 1.10099. A target Ask of 1.10012 later corresponds to Bid 1.10004 in this constant-spread construction. This numerical symmetry was engineered to check the mechanics. It is not evidence that BUY and SELL have equal live performance or that real spread is constant.
10. Three failures that later prices cannot repair
In the no-confirmation branch, C's Bid close is 1.10086=1.10085+0.00001. It equals the threshold, so the strict BUY break fails. A higher close at 08:10 is too late. In another independent branch, the first Ask is 1.10113 against Bid 1.10100: spread is 1.3 pips. The better 0.8-pip quote at .200 cannot replace the rejected first quote.
The wide-setup branch has TR(S)=16 pips; ATR_S=5.7857142857 pips. ATR is within its 2–8 range, but the setup range exceeds 1.25 times ATR, so consumption occurs at S. These branches send no entry request, have no traded volume and no realised P&L. Diagnostic CSV calculations are counterfactual, not trades. A later turn becomes eligible only after the strict segment ends and a new segment develops its own full four-bar pattern.
11. Net costs and volume chosen before entry
Assume a USD account, EUR 100,000 per standard lot, pip_value=$10/lot; equity=$10,000; new_risk=0.25%=$25; aggregate_risk<=0.50%=$50. Allow 0.2 pip adverse entry, 0.2 pip remaining exit slippage and a 0.7-pip round-trip commission, linear in volume with no minimum fee or other charge. The entry allowance is already in F_plan; the remaining deduction is c=0.7+0.2=0.9 pip. Do not add spread twice.
For BUY use L=(F_plan−S_bid)/pip+c; W=(T_bid−F_plan)/pip−c; for SELL use L=(S_ask−F_plan)/pip+c; W=(F_plan−T_ask)/pip−c. Require positive L and W and W/L>=1.20. With no other exposure, lots=floor_step(min(25,50−existing_risk)/(L×10),0.01)=0.43: planned loss is $24.94 and net target $33.11. Unknown aggregate risk blocks entry; one owned position at a time, no additions or hedge. Allowances are planning reserves, not fill guarantees or realised fees.
| Side | Loss, pips | Reward, pips | Net W/L | Lots | Planned risk, USD | Net target, USD |
|---|---|---|---|---|---|---|
| BUY | 5.8 | 7.7 | 1.327586 | 0.43 | 24.94 | 33.11 |
| SELL | 5.8 | 7.7 | 1.327586 | 0.43 | 24.94 | 33.11 |
12. Frozen price exits and the time limit
Close the full BUY on Bid<=S_bid OR Bid>=T_bid, or the full SELL on Ask>=S_ask OR Ask<=T_ask. The time exit uses the first valid quote at or after min(C+20 minutes,10:00 UTC), measured from C, not the fill. Reconcile an already executed broker stop or target before requesting another close. There is no trailing, partial exit, later ATR target or MACD-based exit.
In the target branches, the actual entry and exit yield 8.7−0.7=8.0 net pips; $34.40. Unused slippage reserves are not charged as actual costs. The gap branch jumps from Bid 1.10120 to 1.10030 and exits at the available 1.10030: −8.6 net pips; −$36.98, beyond the $25 plan. The time branch first receives a due quote at 08:25:00.200 and fills its close at .350 for −1.1 net pips; −$4.73. Gaps and delay can exceed the planned stop loss.
| Result | Net pips | Net USD |
|---|---|---|
| BUY / Target | 8.0 | 34.40 |
| SELL / Target | 8.0 | 34.40 |
| BUY / Gap | -8.6 | -36.98 |
| UTC time / Exit | -1.1 | -4.73 |
| One request / 128 | 8.0 | 34.40 |
13. Unknown requests and protection faults
A timeout does not prove that no position exists. The timeout branch sends once at 08:05:00.300, fills on the server at .450, reports error 128 at 08:05:01 and discovers the protected position at 08:05:02. Hold new entries and reconcile open positions, pending orders and history using identifiers, symbol, direction and volume. A comment is not an idempotency guarantee. Do not blindly resend an entry.
If a verified owned fill has missing or incorrect fixed protection, the declared fault response is one full market-exit request on a valid quote when permissions allow, followed by alerting and reconciliation if rejected or unknown. Do not blindly repeat closes or touch unrelated positions. Entry holds do not disable management of an existing position: its quote, permission and reconciliation checks remain active. Restart recovery must restore both position ownership and consumed-segment state.
14. Where this hypothesis can fail
A small rise in D can occur during a weak drift, and the price confirmation can arrive near exhaustion. The ATR target can be unreachable before the time exit. Wide spread, variable commission, sparse quotes, gaps and insufficient Ask history can make an apparently clean Bid chart untradeable. Rejecting a setup is a defined outcome; it is not permission to loosen a threshold after seeing the next candle.
This baseline has no automatic news blackout. The UTC window is not a news filter. A news-aware variant must declare the complete blackout, spread-recovery and fresh-signal policy before testing, then compare missed trades and costs as well as losses. Likewise, test different ATR averaging, hours or thresholds as separate predeclared variants, not silent changes to this strategy.
15. Reproduce mechanics before measuring results
The three downloadable CSVs contain the full indicator warm-up, order events and cost ledger for eight independent constructed branches: 1,041 bars and 2,386 events. The five eligible branches are alternatives, not simultaneous positions or a win-rate sample. After entry, the declared one-second teaching feed plus explicit endpoint observations defines all available quotes; analytical close markers are not claims of executable quotes at those instants. There is no financing or additional fee in this fixture.
Recalculate EMA, SMA signal, D and the explicit ATR from the bars. Replay the consumed flag, then enforce invalidation before confirmation, the first-quote rule, net costs and chronological exits. Test equality at each strict boundary, zero and sign changes, out-of-window first turns, missing C, stale quotes, deadline expiry, insufficient lots, restart, timeout and price gaps. A meaningful performance study needs separate unseen periods, actual Bid/Ask execution data and broker constraints; these invented branches establish mechanics only.
Download fictional M5 bars (CSV)
16. A compact decision checklist
Establish continuous closed data, the actual strict segment and its consumed state. Select its first four-reading turn; validate S and freeze ATR and protection. Validate only scheduled C, with invalidation first, then freeze the target. Process the first observed quote once, compute net reward/risk and a fixed volume, recheck current execution constraints, and send at most one protected request before the deadline.
After sending, reconcile the outcome and manage the confirmed position with fixed price levels and the time limit. After any rejection, wait for a genuinely new segment and pattern. Keep rejected candidates, costs and unknown outcomes in the research log. This finite sequence makes the hypothesis reproducible; it does not establish a positive expectancy, a guaranteed loss cap or suitable live settings.
Frequently asked questions
Is this another MACD zero-cross strategy?
No. The main value and main-minus-signal difference must already share a strict sign. The setup is the first contraction-and-turn pattern inside that segment, followed by one scheduled price-confirmation bar.
Which histogram does the pattern use?
It uses the absolute MACD-minus-SMA-signal difference D, also called OsMA. The standard MT4 MACD histogram displays the main MACD value M; confusing those two series changes the strategy.
Can the entry wait for a narrower spread?
No. A failed first observed quote consumes the candidate. A later better quote, later breakout or later momentum turn in the same segment cannot revive it.
Can I use any ATR indicator set to 14?
Only after matching its calculation. This model explicitly uses the simple mean of fourteen Bid true ranges. Wilder smoothing, different seeds or different price data define a different series.
Does the 0.25% risk budget cap every realised loss?
No. It sizes the initial plan using declared allowances. Gaps, fills, delays or protection faults can exceed it; the fictional gap branch loses $36.98 against a $25 planning budget.
Do the CSV outcomes prove that this strategy works?
No. They are independent invented branches for checking signals, execution and accounting. They are not market observations, a backtest, a portfolio or a performance estimate.
Sources and research notes
The official references explain indicator definitions and order parameters. The entry pattern, thresholds, session, risk limits and all prices below are our declared research assumptions; the references do not validate their profitability.
- MetaTrader 4: MACD main and SMA signal definition
- MetaTrader 4: true range and ATR
- MQL4: protected order request parameters
Educational research hypothesis. Invented prices and execution paths; no verified performance or guaranteed loss limit.