{
  "id": "mpf-cci20-typical-price-mean-absolute-deviation-guide-20261115-v1",
  "frozen_at_utc": "2026-11-15T20:07:51.595357+00:00",
  "kind": "educational_indicator_guide",
  "instrument": "EURJPY HistData M1 Bid aggregated to H4",
  "source_evidence": "eurjpy-aroon-evidence.json",
  "source_sha256": "29858fbed84e573a6dbe348c8631bef451dfba6bb481ba49b09075c6a6de5973",
  "source_manifest": "eurjpy-aroon-source-manifest.json",
  "source_manifest_sha256": "9e88e3526802762c68887cc4ca2f05cd60c667fb9886177b4fa5c0773767cd37",
  "period": 20,
  "window_observations": 20,
  "bar_seconds": 14400,
  "source_price_scale": 1000000,
  "source_fields": [
    "ts",
    "open",
    "high",
    "low",
    "close",
    "n",
    "first_ts",
    "last_ts",
    "source_open_int",
    "source_high_int",
    "source_low_int",
    "source_close_int"
  ],
  "time_policy": "Pinned source uses provider fixed EST without DST; add5hours forUTC. H4 anchors are scheduled bucket starts; first/last source-minute stamps are interval labels, not individual quote timestamps.",
  "history_policy": "Last20 observed candles includingcurrent, no filling/reset atcalendar gaps; source-minute coverage flags retained. Calendar gap need not mean provider error. No precomputed Aroon or strategy indicators used.",
  "formulas": {
    "tp": "(H+L+C)/3",
    "mean": "sum(last20 TP)/20",
    "mad": "sum(abs(TP_i-current_mean) for all20 TP_i)/20; same current mean in every term",
    "cci": "(TP_current-current_mean)/(0.015*MAD); constant=3/200 exactly",
    "undefined": "MAD=0 gives unavailable CCI; no zero or previous-value substitution. TP can be constant while individual candles have nonzero ranges.",
    "exact_method": "With z_i=H_int+L_int+C_int, S=sum(z_i), A=sum(abs(20*z_i-S)), exact CCI=200*20*(20*z_current-S)/(3*A). Original integer prices; Fraction forquotients andthresholds.",
    "fixed_period_bound": "Forcurrent-inclusive20 andMAD>0, abs(CCI)<=2000/3 follows fromsum(centered deviations)=0 andsum(abs(deviations))>=2*abs(currentdeviation). This mathematical cap isnot a forecasting threshold.",
    "wrong_mad": "SMA20(abs(TP_i-SMA20_i)) centers each term differently andisnot the currentwindowMAD."
  },
  "thresholds": {
    "upper_strict": "CCI>100",
    "lower_strict": "CCI<-100",
    "equality": "Exact±100 excluded from strictzones; previous equality allowed for cross.",
    "cross_flags": "Adjacent H4 anchors withbothreadingsdefined; previous<=threshold,current>threshold. Descriptive transitions, not executabletrades."
  },
  "selection": {
    "start_utc": "2023-01-01T00:00:00Z",
    "start_ts": 1672531200,
    "order": [
      "zero_cross",
      "upper_cross",
      "lower_run"
    ],
    "conditions": {
      "zero_cross": "previousCCI<=0,currentCCI>0",
      "upper_cross": "previousCCI<=100,currentCCI>100; no ceiling",
      "lower_run": "current andtwo precedingCCIvalues allstrictly<-100"
    },
    "eligibility": "Current and21 preceding observedrows form22 adjacent H4 scheduledanchors. Previous andcurrent buckets require n240,first_ts=ts,last_ts=ts+14340. Earlierbuckets maybepartial andremain disclosed. Need25 prior and5 followingobservedrows for31row display.",
    "selection": "Firsteligible distinctsourceindex for eachpredicate indeclaredorder; nofuturepriceoutcomes andnofallback ifabsent.",
    "future_context": "Five subsequent observedrows needed onlyfordisplay availability; their prices,quality andreturns donotrank/select cases.",
    "chart_previous": 25,
    "chart_following": 5,
    "reference_index": 25
  },
  "teaching": {
    "typical_example": {
      "high": 112,
      "low": 100,
      "close": 109,
      "typical_price": 107
    },
    "mean_window": [
      100,
      100,
      100,
      100,
      100,
      100,
      100,
      100,
      100,
      100,
      110,
      110,
      110,
      110,
      110,
      110,
      110,
      110,
      110,
      120
    ],
    "mean_example": {
      "mean_tp": 105.5,
      "mean_abs_dev": 5.5,
      "deviation": 14.5,
      "cci_num": 5800,
      "cci_den": 33
    },
    "zero_mad_nonflat": {
      "high": 110,
      "low": 90,
      "close": 100,
      "observations": 20,
      "mean_tp": 100,
      "mean_abs_dev": 0,
      "cci": null
    },
    "wrong_residual": {
      "prelude": [
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100
      ],
      "window": [
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110,
        110
      ],
      "correct_mean": 110,
      "correct_mad": 0,
      "correct_cci": null,
      "wrong_mad": 4.75
    },
    "bound_example": {
      "window": [
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        110
      ],
      "mean_tp": 100.5,
      "mean_abs_dev": 0.95,
      "deviation": 9.5,
      "cci_num": 2000,
      "cci_den": 3
    }
  },
  "display": {
    "ohlc_decimals": 3,
    "derived_price_decimals": 6,
    "cci_decimals": 2,
    "candles": 31,
    "x_axis": "Even observed-indexspacing; compressandmark calendarjumps; connect consecutiveavailablevalues, break onlyforundefinedvalues.",
    "cci_axis": "Symmetric adaptive range from all31displayedCCIvalues, at least±200; fixed duringreaderselection."
  },
  "research_disclosure": "Educational retrospective reusedsource; rulesfixed before CCI candidate scanning. No returns calculated or used forselection. Rawsourcearchives are not re-downloaded here.",
  "performance_calculated": false,
  "sources": [
    "https://www.tradingview.com/support/solutions/43000502001-commodity-channel-index-cci/",
    "https://ta-lib.org/functions/cci.html",
    "https://www.histdata.com/f-a-q/data-files-detailed-specification/"
  ]
}
