# "Monthly Profit - Daily Trading using SMA": the 5-day SMA cross on daily bars, EUR/USD - specification (RIP Backtest protocol v1.0 plus the 8 Oct 2026 rules)

Specification written and **frozen 2026-10-29 (approved by the owner the same day, draft 1 unchanged: "Da, îngheaț-o")**. Once frozen, any change of a rule is documented and treated as a separate test; bugs may be fixed. No SMA, Bollinger band, signal or trade of this test had been computed when it was frozen.

## Why this test, where the rules come from, and what was looked at before
- **Chosen by the owner** on 2026-10-29 ("Da, pe EUR/USD"), from the Forex Factory thread **"Monthly Profit - Daily Trading using SMA"** (thread 600112, started 18 Dec 2016, 622 pages; rules in the first post, updated 17 Dec 2016). *(Note added 2026-10-29, after publication; no rule or result involved: the thread started on 26 Jul 2016, the date of its first post; 18 Dec 2016 is when the first post was last edited. The author's first charts, July and August 2016, used the SMA shifted three days (period 5, shift 3); the thread moved to shift 0 by late September 2016, which is what the first post states and what this test uses.)* The last page (2025-2026) has members adding other indicators (CCI, an EMA 5) and asking whether anyone still uses it; no statistic over a long period was found in the thread.
- **The rules as stated:** daily (D1) charts only, "even H4 is not reliable"; a 5-period SMA ("SMA 5,0") and Bollinger Bands (marked optional); long only when the SMA line points up, short only when it points down, nothing when it is flat; **long** when the previous D1 candle is bullish, its **body has clearly crossed the SMA** and it **did not touch the upper Bollinger band** (short mirrored); **stop** at the previous candle's low minus 15 pips (high plus 15 for a short), or the candle before it if the candle is too short; **exits:** take two positions, close the first "after taking profit on same day", leave the second to run, moving its stop "as per S&R"; "you may exit" when a candle touches the opposite band, or after "minimum 3 candles profit as part of 1:3 strategy"; "must exit on breakeven if setup goes in opposite direction". Risk up to 5% of the account per position (not used here: results are in pips and R).
- **What is tested:** our mechanical reading of each phrase, fixed below before any result, with the three exits the post describes as three separate versions. "Clearly", "flat", "too short" and "S&R" are not defined in the thread; the numbers chosen for them are ours and are stated as such.
- **Looked at before (disclosed):** on this EUR/USD file the FX study, the 1-hour golden cross, the Fibonacci 61.8% pullback, the Turtle rules (daily breakouts), Stochastic + RSI + MACD, the TDI tests, Parabolic SAR, the inside bar, ADX, the order block test and the anchored VWAP (28 Oct 2026), all buried. Moving-average and trend rules have been tried several times on this file; that raises the bar below.

## Instrument and data
- **EUR/USD** spot, the 1-minute bid history of the IC Markets MetaTrader 4 demo server, 2004-01-01 to 2026-09-28 15:46 New York (`fb_clock.loadEur({ fix: false })`).
- **Daily bars:** the forex day runs **17:00 to 17:00 New York** (the broker's D1 candle; the Sunday evening minutes belong to Monday's candle), built from the minutes that exist; a day with fewer than 600 minutes is kept but flagged. The clock audit found labels an hour early in many weeks of 2004-2014; there the day boundary falls at 16:00 instead of 17:00, which moves one hour between neighbouring candles; it is reported, not corrected.
- **Holes (rule 3):** `data_holes_eur.json`; every gate and verdict is recomputed without the trades open across a suspect or unclear gap.

## Indicators (fixed now)
- **SMA 5:** the mean of the last 5 daily closes, the signal day included. **Bollinger Bands:** 20-day SMA of closes plus and minus 2 standard deviations (population), the MetaTrader 4 default. **ATR 14:** Wilder, daily, used only to turn "clearly", "flat" and "too short" into numbers.
- **Direction of the SMA:** slope = SMA(signal day) - SMA(day before). **Up** if slope > 0.05 x ATR14, **down** if slope < -0.05 x ATR14, **flat** otherwise (no trade).

## Rules (described for a long; a short is the mirror)
- **Signal day** = the last closed daily candle. A long signal needs all of:
  1. the SMA points **up**;
  2. the candle is **bullish** (close > open);
  3. its **body clearly crossed the SMA**: open < SMA of that day and close >= SMA + 0.1 x ATR14;
  4. it **did not touch the upper band**: high < upper Bollinger band of that day.
- **Entry:** at the open of the next day (the first minute after 17:00 New York).
- **Stop:** the signal candle's low - 15 pips. **"Too short"** = a signal candle range below 0.5 x ATR14: then the lower of its low and the previous candle's low - 15 pips. **R** = entry to stop.
- **One position at a time.** An opposite signal while a position is open closes it at the next day's open and opens the new one there; a signal in the same direction is ignored.

## Exits (three versions)
- **SMA-1D (the first position):** closed at the close of the entry day (17:00 New York), or earlier at the stop.
- **SMA-3R (the "1:3" exit):** target 3R; the stop moves to the entry ("must exit on breakeven") once price has gone 1R in favour; or the stop; or an opposite signal.
- **SMA-TRAIL (the second position, "moving SL as per S&R", exit at the band):** after each closed day, the stop moves up to that day's low - 15 pips if higher (the previous candle is our reading of the nearest support); exit at the close of the first day whose high touches its upper Bollinger band; or the stop; or an opposite signal.
- **All:** the stop and target are checked on every minute (a minute opening beyond them fills at its open; stop first when both are in one minute). Positions are held over nights and weekends.

## Variants (the only ones tested)
**SMA-1D, SMA-3R, SMA-TRAIL.** All long and short, on the same signals.

## Costs
- **About 1 pip per round trip** (the cost model of every EUR/USD test on the site); also shown at 1.5x and 2.5x. Results in pips and in R.
- **Financing** (positions cross nights and weekends): scenario A, 2% a year of the entry price per calendar day held; scenario B, today's IC Markets EUR/USD swap as recorded for the Turtle EUR/USD test (long -7.99, short +1.31 points per lot per night, Wednesday counting three, rollover at 17:00 New York; not a historical rate). The verdict uses the baseline (no financing); A and B are reported next to it.

## Periods, gates, control
- **Periods (by entry date):** development 2004 to 2012; validation 2013 to 2019; holdout 2020 to 2026-09-28 (**already used** by the earlier EUR/USD tests).
- **Six gates per variant** (net R): validation profit factor >= 1.2; at least 50 trades in each period; development **t >= 2.5** (trend and average rules tried several times on this file); above the 95th percentile of 500 runs of the matched control; positive without the 10 best trades; holdout net positive (flagged used). Fewer than 30 trades: Inconclusive.
- **Matched control (moved entries):** every real trade moved, all together, by one random circular offset of whole trading days (at least 5% of them), entered at the open of the new day, same direction, the same stop distance in price, the same exit rule (SMA-1D: the same one-day hold; SMA-3R: the same target and breakeven distances; SMA-TRAIL: the same trailing and band rules on the new days), the same costs. 500 runs, seeds 1000 + run. Statistic: the average net R per trade. It asks whether the SMA cross picks better days than the same trades on other days.
- **Also reported (descriptive, no gates):** signals by condition (how many days the SMA was up, down, flat; how many crosses failed "clearly" or touched the band); trades per year; which stop rule was used; win rate with its Wilson interval; exits by reason; median risk in pips and the cost in R; long and short; by year; the result without the Bollinger condition (the post calls the bands optional), descriptive only.

## Engine and self-test (before the run)
New engine `sma5_lib.js`, independent re-implementation `sma5_ref.js`, `sma5_selftest.js` that must pass before any result is printed: the daily candles at 17:00 New York (a Sunday evening, a short day), SMA 5, the bands and ATR against hand-worked values, each condition alone failing (flat SMA, bearish candle, open above the SMA, close not clearly above, band touched), the too-short stop, each exit (one-day close, 3R target, breakeven move, trailing stop, band exit, opposite signal reversing, stop and target in one minute, a gap through the stop), a short; the reference matched trade by trade on the real data for all three versions; the control at offset 0 reproducing the real entries.

## Before the article
Results go to the owner first: all three versions, every gate, long and short, by year, the exits, the cost in R. One article, published only with the owner's agreement. Working title for search: "5 SMA Daily Strategy Backtest: the Forex Factory 'Monthly Profit' System on 22 Years of EUR/USD". The thread and its author are named and quoted only as needed to state the rules.

## Reading the result
"Buried" or "Inconclusive" mean a statistically convincing edge was not demonstrated; neither is proof that none exists. One market, one data source, our mechanical reading of a method whose author leaves several choices to the trader's judgement.
