{
  "account": {
    "initial_cash": 10000,
    "net_r": "Realized directionalpricePnL minus bothcommissions and realizedfinancing, divided by entryq*Lunit. Nominal1%budget is not guaranteed maximum loss.",
    "notional_cap": "Entry GBPnotional+entrycommission<=preentryUSDcash, for either direction; no leverage at entry. USD collateral/mark-to-market research account, not actual delivery of GBP or a broker margin schedule.",
    "planned_loss": "D=2*signalATR14. Lunit=D+exitSlippage+2*commissionUSDperGBP. q=min(0.01*B/Lunit,B/(abs(entryFill)+commissionUSDperGBP)). Nominal stop budget excludes future unknown holdingcharges and opening gaps.",
    "risk_fraction": 0.01
  },
  "costs": {
    "baseline": {
      "carry_pips_per_rollover_unit": 0.2,
      "commission_usd_per_100000_gbp_per_leg": 3.5,
      "slippage_pips_per_leg": 0.1,
      "spread_pips": 1.0
    },
    "financing": "Bothdirectionsresearchdebit atMonday–Friday17:00 America/New_York: Wednesday3units, otherweekdays1; noholidaycalendar or credit. Entrytime<cutoff and position stillopenaftercutoff. Exactopen/closeexit atcutoff excludesit; intraminuteexitwhoseintervalstart=cutoff includesit. Entryatcutoff excludesit. Accrue in equity and deductin netPnL.",
    "higher_cost": {
      "carry_pips_per_rollover_unit": 0.4,
      "commission_usd_per_100000_gbp_per_leg": 7.0,
      "slippage_pips_per_leg": 0.2,
      "spread_pips": 2.0
    },
    "scope": "Fixed research scenarios, not measured historical or current broker spreads/fees. AskOHLC=Bid+constantspread; actualAsk unobserved. Fullrerunrebuildfills,stops,quantities,calendar,cash.",
    "zero_cost": {
      "carry_pips_per_rollover_unit": 0,
      "commission_usd_per_100000_gbp_per_leg": 0,
      "slippage_pips_per_leg": 0,
      "spread_pips": 0
    }
  },
  "entry": {
    "adx_gate": "Primary also requires current completed Wilder ADX14>=25; equality qualifies. no_adx removes ONLY this threshold. ADX and DI are still calculated; both variants keep identical28-bar eligibility, crossings, quotes, exits, costs and constraints.",
    "cross": "When flat, long if previous Bid close<=previous Upper AND current Bid close>current Upper; short if previous close>=previous Lower AND current close<current Lower. Exact rational comparisons, previous equality allowed, current equality fails. Current/previous bands defined,28 shared observed bars, current ADX defined, positive ATR14 and anchors exactly14400seconds apart. A high/low touch alone is not an entry.",
    "eligibility": "Only enter within model weeklysession [Sunday17:00,Friday17:00) America/New_York. A signal can use prior valid history across account restart; no inherited position. No same-opening re-entry after opening or intraminute exit. An exit at prior minute close permits a fresh completed-H4 decision at the same cutoff.",
    "execution": "At immediately next scheduled H4 opening, require an actual M1 opening exactly at that timestamp inside period. Missing exact minute cancels entry, even if another minute later inbucket exists. Longfill=sourceBidOpen+scenarioSpread+slip; shortfill=sourceBidOpen-slip.",
    "position": "One position only, no pyramiding, reversal or hedging; fractional GBPquantity; no historic minimumlot/steps reconstructed."
  },
  "equity": "At each observedH4scheduledcutoff, settle actualexits beforecutoff or atcutoff ifmodeledclose. An openingexit exactlyatcutoff remainsheld in precedingclosemark. Ifopen: V=preentryCash+direction*q*(liquidationFill-entryFill)-2*q*commissionUSDperGBP-q*carryUSDperGBPPerUnit*accruedRolloverUnits; liquidationFill=BidClose-slip long or BidClose+spread+slip short. If flat, use realizedcash. Initial10000isopeningpeak. Annualreturns chainyearendmarks anduse bucketopeningyear. H4sampling is not continuous drawdown.",
  "exit": {
    "deadlines": "Earliest of entry+30*14400 calendarseconds, nextFriday17:00 America/New_York, evaluatedperiodEnd. Stop checks in minutesbeforedeadline precede modeleddeadlineclose. If an observedminute ends exactlyatdeadline, survivingposition exits at that minuteclose afteritsrangechecks; otherwise use firstlater observed opening with openingstopgap priority. Pendingindicatorqueue earlierthandeadline doesnot waitfor modeleddeadlineclose. Periodend neverreads out-of-periodopening: lastobservedinperiodclose fallback explicitlyflagged if exactdeadlineclose unavailable. Ties afterstop/queue use time,thenweek_close,thenperiod_end.",
    "fixed_stop": "LongSL=entryFill-2ATR; shortSL=entryFill+2ATR, positivefinite. For long requireSL<entryBidOpen; forshort requireSL>modeledAskOpen. No target, trailingstop or stopupdates.",
    "indicator_level": "For a held long, completed Bid close<=current SMA20 queues exit; for short, Bid close>=SMA20. Equality triggers. No fresh center cross, ADX threshold, DI direction, adjacency, entry warmup or positive ATR is needed. Queue survives absent quotes; execute at first observed M1 opening at/after cutoff with opening stop-gap priority. A return merely inside the outer band does not trigger this center-line exit.",
    "max_holding_h4_slots": 30,
    "order": "At each observedminuteopening: openingstopgap first, then pendingindicator exit, then overdue earliestdeadline; onlythen inspect subsequentminuterange forstop. Stopgap uses actualopeningreference. IntraminutestopusesSLreference. No imaginedticktime.",
    "quote_side": "Longexittrigger/sourcequoteBid; shortexittrigger/modelAsk=Bid+scenarioSpread. Exitfill=exitReference-direction*slip.",
    "timing": "Openingevent exact observedminuteopening; modeledminuteclose at minuteStart+60; intraminute stop interval[minuteStart,minuteStart+60), not an exacttick. Indicator exits use completedH4information only."
  },
  "exposure": "Count observedH4buckets with any positioninterval overlap; exactopeningexit doesnot occupy itsfollowingbucket, intraminuteexitdoes. Denominator observedbuckets only; not exactwallclockexposure. Holding H4equivalents are elapsedcalendartime, within1mbarrier haslower/upperbounds.",
  "frozen_at_utc": "2026-11-15T14:30:17.899004+00:00",
  "gallery": "First completedprimaryearlytrade; first completedprimarylatertrade; then firstlatertrade with strictlyoppositenetPnLsign (zeronotopposite), otherwise nextlatertrade, otherwiseexplicitunavailable. Outcomeconditionedthirdexample is educational,notrepresentativesample; examples alreadybelongtoaccounttotals. H4pricecharts sourceBid; forshort markersdistinguishmodeledAskexitreference from Bidcandles.",
  "id": "mpf-gbpusd-h4-envelopes-sma20-adx14-20261115-v1",
  "indicators": {
    "adx14": "Seed ADX as mean first14 defined DX at index27, then(13*previousADX+DX)/14. Decimal40 arithmetic and comparison; independent Decimal50. ADX>=25 includes equality. No rising-ADX requirement and no DIplus/minus directional gate. First ADX needs28 observed bars.",
    "atr14": "Separate stop ATR14: firstTR=H-L, later max(H-L,abs(H-prevObservedClose),abs(L-prevObservedClose)). Seed mean first14 TR at index13, then(13*previous+TR)/14. Unlike ADX transitions, stop ATR includes a first-bar range. Decimal40; independent50.",
    "di_dx": "Seed arithmetic means of the first14 transitions at index14, then RMA=(13*previous+current)/14 for TR and both DM. DIplus/minus=100*RMA(DM)/RMA(TR), or both0 if smoothedTR0. DX=100*abs(DIplus-DIminus)/(DIplus+DIminus), or0 if sumDI0. First DI/DX index14.",
    "entry_warmup": "Both primary and no_adx require at least28 observed H4 bars, defined current/prior bands, current defined ADX and positive ATR14. Crossings also need exactly adjacent scheduled anchors. No difference in warmup or quote eligibility between variants.",
    "envelopes": "SMA20=sum(last20 observed Bid closes)/20. Upper=SMA20*201/200, Lower=SMA20*199/200; exact Fraction from integer source prices scaled1e6. Half-width0.5% of SMA, totalwidth1%; no time shift. First band index19, first possible adjacent-anchor crossing index20. Not 0.5 price units, an ATR channel or Bollinger dispersion bands.",
    "numeric_decisions": "Bands and all close/band/center comparisons use exact Fraction arithmetic, no epsilon or rounded display decisions. ADX threshold uses Decimal40, independent50. Ledger follows existing binary64 Forex accounting framework, independently reconstructed with Decimal50; displayed float values never decide price-band or ADX flags.",
    "wilder_transitions": "First observed bar supplies predecessor only for ADX. For each later observed bar TR=max(H-L,abs(H-Cprev),abs(L-Cprev)); Up=H-Hprev, Down=Lprev-L. DMplus=Up only if Up>Down and Up>0, else0; DMminus=Down only if Down>Up and Down>0, else0. A tied positive move sets both0. Observed gaps use the previous observed bar, no fabricated transition."
  },
  "parameters": {
    "adx_period": 14,
    "adx_threshold": "25",
    "atr_period": 14,
    "atr_stop_multiple": 2,
    "common_entry_observations": 28,
    "deviation_fraction": "0.005",
    "deviation_percent": "0.5",
    "di_period": 14,
    "sma_period": 20,
    "time_shift": 0
  },
  "periods": {
    "early": [
      "2020-01-01T00:00:00Z",
      "2023-01-01T00:00:00Z"
    ],
    "full": [
      "2020-01-01T00:00:00Z",
      "2026-01-01T00:00:00Z"
    ],
    "later": [
      "2023-01-01T00:00:00Z",
      "2026-01-01T00:00:00Z"
    ]
  },
  "pip_size": 0.0001,
  "quality": "Keepallgaps. Separate modelSunday17-toFriday17NYinsessionunobservedminutes fromoutsideweeklysessions withoutclaimingfeedfailurevsnoupdates/holidays. Flagtradescrossingunobservedinsessionminutes and partialsignal/exitbuckets. Ex-post exclusion atoriginalquantities is ledgerdiagnostic only, not realtimefilter or rebuiltretrun.",
  "reference": "USDcash10000withzeroassumedinterest; do not rankleveraged/short FX against buy-and-holdasriskmatched.",
  "research_scope": "One retrospective fixed-rule percentage-band breakout strategy on familiar retained GBPUSD history. Preset SMA20,0.5% half-width and Wilder ADX14>=25. One control removes only the ADX threshold. No search over lengths, width, strength level, stops, exits or periods. Publish all scenarios regardless of result; restarted early/later periods are not unseen prospective tests.",
  "runs": [
    "primary_full",
    "primary_early",
    "primary_later",
    "no_adx_full",
    "no_adx_early",
    "no_adx_later",
    "zero_cost_full",
    "higher_cost_full"
  ],
  "site_baseline": {
    "sitemap_urls": 2560,
    "strategies_per_language": 69,
    "version": 359
  },
  "source": {
    "h4": "Buckets floor(UTCepoch/14400), first actual Bid open/maxhigh/minlow/lastactualclose. Retain partial buckets and their first/last observed minutes. Indicator close becomes a disclosed stale-price proxy if final minute absent; available only at scheduled H4 cutoff. No future bucket ranges or metadata gate an already observed opening.",
    "indicator_history": "All observed H4 buckets in chronological order, including partial buckets and across scheduled gaps/weekends; no artificial flat candles or gap resets. Entry price-band crossings require immediately adjacent scheduled H4 anchors. Center-line exits require defined current SMA20, not a previous adjacent anchor, ADX, DI direction, entry warmup or positive ATR.",
    "manifest": "data/eurusd-bb-squeeze/manifest.json",
    "normalization": "Validate pinned SHA256 and ZIP CRC; one GBPUSD CSV peryear. Sort actual UTC minutes. Collapse only byte-identical rows at an identical source timestamp, reject conflicts. Retain all original ZIPs. Ignore placeholder volume. No fabricated or interpolated minutes. Trim to warmupStart<=t<2026-01-01UTC.",
    "provider": "HistData Generic ASCII M1 Bid",
    "raw_directory": "data/eurusd-bb-squeeze/raw",
    "source_authenticity": "Pinned original bytes from retained downloads, not newly fetched or provider-published checksums.",
    "timestamp": "Fixed EST UTC-05 with no DST; add18000seconds forUTC. The separate NewYork trading-week/financing calendar observes DST."
  },
  "source_manifest": [
    {
      "bytes": 3411684,
      "csv": "DAT_ASCII_GBPUSD_M1_2019.csv",
      "file": "GBPUSD-M1-2019.zip",
      "sha256": "bc6d390e539d267fcd7856851db463fc098de5d7f7d732ddca75604f4a259bf2"
    },
    {
      "bytes": 3625339,
      "csv": "DAT_ASCII_GBPUSD_M1_2020.csv",
      "file": "GBPUSD-M1-2020.zip",
      "sha256": "07ad9524551d1b5bc617cd6971e5a6f38156f92e7046fa368abd22cbe7d9a044"
    },
    {
      "bytes": 3447415,
      "csv": "DAT_ASCII_GBPUSD_M1_2021.csv",
      "file": "GBPUSD-M1-2021.zip",
      "sha256": "5ce226e9e1cabcb8d3cab7d5c64135da2c864b0d79a559c8a08c6e1e3d47866e"
    },
    {
      "bytes": 3670216,
      "csv": "DAT_ASCII_GBPUSD_M1_2022.csv",
      "file": "GBPUSD-M1-2022.zip",
      "sha256": "6c3134133d24effe9ebae1ee02c7b0db3bff8f60f92bd9add846abc54d00a86e"
    },
    {
      "bytes": 3049553,
      "csv": "DAT_ASCII_GBPUSD_M1_2023.csv",
      "file": "GBPUSD-M1-2023.zip",
      "sha256": "4e7031d841a953ae76d1ba056780838bddd08e0d5eac62dd21c64b28b7b1a68b"
    },
    {
      "bytes": 3375781,
      "csv": "DAT_ASCII_GBPUSD_M1_2024.csv",
      "file": "GBPUSD-M1-2024.zip",
      "sha256": "030b05b4c670c7e152bf4aa4112488c96695d2dcc2b31ca13a3b4834b8431077"
    },
    {
      "bytes": 3496823,
      "csv": "DAT_ASCII_GBPUSD_M1_2025.csv",
      "file": "GBPUSD-M1-2025.zip",
      "sha256": "7b69c334eadd10568168634cff3ca37b06e5fb9057db4da9b590e2ef2034854e"
    }
  ],
  "sources": [
    "https://www.mql5.com/en/docs/indicators/ienvelopes",
    "https://www.mql5.com/en/code/8",
    "https://www.histdata.com/f-a-q/data-files-detailed-specification/"
  ],
  "status": "frozen before first strategy performance calculation",
  "study": "GBP/USD H4 Envelopes SMA20 ±0.5% + Wilder ADX14",
  "symbol": "GBPUSD",
  "timeframe_seconds": 14400,
  "variants": [
    "primary",
    "no_adx",
    "zero_cost",
    "higher_cost"
  ],
  "verification": {
    "decisions": "Exact counts,times,sides,eventkinds,qualityflags,entrycrosses. No epsilon in thresholds.",
    "independent_decimal_precision": 50,
    "metrics_tolerance": 1e-08,
    "money_absolute_tolerance": 1e-06,
    "price_indicator_tolerance": 1e-08,
    "quantity_gbp_tolerance": 1e-07
  },
  "warmup_start": "2019-01-01T00:00:00Z"
}
