{
  "study": "SMA20 percentage Envelopes and Wilder ADX14 guide on GBP/USD H4",
  "scope": "Indicator arithmetic and historical reading examples only; no trade returns, executions, entries/exits, optimization, or outcome-based selection.",
  "source_evidence": "gbpusd-elder-evidence.json",
  "source_sha256": "7b1f7bd7f5ffa0939a699d702269f7109c445ce02910f1ad4a68c53d623ad9f7",
  "source_manifest": [
    {
      "file": "GBPUSD-M1-2019.zip",
      "sha256": "bc6d390e539d267fcd7856851db463fc098de5d7f7d732ddca75604f4a259bf2",
      "bytes": 3411684,
      "csv": "DAT_ASCII_GBPUSD_M1_2019.csv"
    },
    {
      "file": "GBPUSD-M1-2020.zip",
      "sha256": "07ad9524551d1b5bc617cd6971e5a6f38156f92e7046fa368abd22cbe7d9a044",
      "bytes": 3625339,
      "csv": "DAT_ASCII_GBPUSD_M1_2020.csv"
    },
    {
      "file": "GBPUSD-M1-2021.zip",
      "sha256": "5ce226e9e1cabcb8d3cab7d5c64135da2c864b0d79a559c8a08c6e1e3d47866e",
      "bytes": 3447415,
      "csv": "DAT_ASCII_GBPUSD_M1_2021.csv"
    },
    {
      "file": "GBPUSD-M1-2022.zip",
      "sha256": "6c3134133d24effe9ebae1ee02c7b0db3bff8f60f92bd9add846abc54d00a86e",
      "bytes": 3670216,
      "csv": "DAT_ASCII_GBPUSD_M1_2022.csv"
    },
    {
      "file": "GBPUSD-M1-2023.zip",
      "sha256": "4e7031d841a953ae76d1ba056780838bddd08e0d5eac62dd21c64b28b7b1a68b",
      "bytes": 3049553,
      "csv": "DAT_ASCII_GBPUSD_M1_2023.csv"
    },
    {
      "file": "GBPUSD-M1-2024.zip",
      "sha256": "030b05b4c670c7e152bf4aa4112488c96695d2dcc2b31ca13a3b4834b8431077",
      "bytes": 3375781,
      "csv": "DAT_ASCII_GBPUSD_M1_2024.csv"
    },
    {
      "file": "GBPUSD-M1-2025.zip",
      "sha256": "7b69c334eadd10568168634cff3ca37b06e5fb9057db4da9b590e2ef2034854e",
      "bytes": 3496823,
      "csv": "DAT_ASCII_GBPUSD_M1_2025.csv"
    }
  ],
  "history": [
    "2019-01-01T00:00:00Z",
    "2026-01-01T00:00:00Z"
  ],
  "price": "Observed HistData Bid OHLC, USD per GBP; original fixed EST UTC-05 without DST, shifted +18000 seconds, UTC H4 anchors floor(epoch/14400). No observed Ask, execution or consolidated volume.",
  "bars": "Keep all observed H4 buckets, including partial ones, first/last actual M1 endpoints. No fabricated minutes or candles. Indicator state carries over observed gaps/weekends; partial last close is a disclosed stale proxy if final minute is missing. Final values available at scheduled H4 end.",
  "parameters": {
    "sma_period": 20,
    "deviation_percent": "0.5",
    "deviation_fraction": "0.005",
    "di_period": 14,
    "adx_period": 14,
    "adx_threshold": "25",
    "time_shift": 0
  },
  "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% of SMA; neither 0.5 price units nor volatility-adaptive width.",
  "wilder": "First bar supplies predecessor only. On each later observed bar TR=max(H-L,abs(H-Cprev),abs(L-Cprev)); Up=H-Hprev, Down=Lprev-L; DMplus=Up if Up>Down and Up>0 else0; DMminus=Down if Down>Up and Down>0 else0. Tied positive moves both0. Seed average first14 transitions atindex14, then RMA=(13*previous+current)/14. DIplus/minus=100*RMA(DM)/RMA(TR), DI0 if RMA(TR)0. DX=100*abs(DIplus-DIminus)/(DIplus+DIminus), DX0 if sumDI0. ADX seed mean first14 definedDX atindex27, thereafter(13*previousADX+DX)/14. ADX has no direction; no DI gate added.",
  "numeric": "Decimal40 RMA and threshold comparison in primary; independent Decimal50 scaled Wilder sums. Exact rational price-band comparisons, no rounded display values or epsilon. Price/indicator atol1e-10, discrete/null flags exact.",
  "flags": "up_cross=previousClose<=previousUpper AND currentClose>currentUpper; down_cross=previousClose>=previousLower AND currentClose<currentLower, only if previous/current band values defined and scheduled anchors exactly14400seconds apart. high_touch=H>=currentUpper; touch_without_close=H>=currentUpper AND C<=currentUpper. Above/Below strict C>Upper/C<Lower; equality is inside. ADXstrong uses >=25, equality qualifies. Touch compares the final current band to that bar range retrospectively, not an intrabar quote-time trigger.",
  "initialization": "SMA20 first atindex19 (20 observations); new band crossing firstpossible index20 (21 observations); DI14/DX firstindex14 (15 observations); ADX14 firstindex27 (28 observations). Availability counts, not convergence guarantees.",
  "examples": {
    "start": "2024-01-01T00:00:00Z",
    "coverage": "Current and previous H4 both240minutes with exact first anchor and last anchor+14340 endpoints, anchors adjacent, current SMA/DI/ADX available. Selection solely from completed known data.",
    "strong": "First up_cross with ADX>=25.",
    "touch": "First distinct touch_without_close with ADX>=25. Final current band used for descriptive OHLC comparison; no claim of contemporaneous intrabar touch or trade.",
    "weak": "First distinct up_cross with ADX<25.",
    "window": "12 observed bars before and9 after selectedbar,22total. Future visible context never participates in selecting case or flags. S marks selected condition candle, not an executed trade."
  },
  "teaching": {
    "sma": "1.25000",
    "upper": "1.25625",
    "lower": "1.24375",
    "half_width_pips": "62.5",
    "total_width_pips": "125",
    "pip_size": "0.0001"
  },
  "sources": [
    "https://www.mql5.com/en/docs/indicators/ienvelopes",
    "https://www.metatrader5.com/en/terminal/help/indicators/trend_indicators/admiw",
    "https://www.histdata.com/f-a-q/data-files-detailed-specification/"
  ]
}
