{
  "id": "mpf-obv-cmf20-price-volume-disagreement-guide-20261116-v1",
  "frozen_at_utc": "2026-11-16T04:01:14.662900+00:00",
  "kind": "educational_indicator_guide",
  "instrument": "Binance ETH/USDT spot H4",
  "period": 20,
  "bar_seconds": 14400,
  "price_scale": 100000000,
  "volume_scale": 100000000,
  "source_evidence": "eth-wr-evidence.json",
  "source_sha256": "060f24b65562a768dde311f7e6ff09ba69c4bc99c2c2457e46dd7b2bc95b88ad",
  "source_fields": [
    "ts",
    "open",
    "high",
    "low",
    "close",
    "volume",
    "source_close_raw",
    "timestamp_scale"
  ],
  "input_policy": "Consume only the eight raw fields. Require finite positive OHLC with valid bounds, finite nonnegative total base-asset volume, exact representation at scale100000000, integer H4-aligned strictly increasing anchors and integer source close labels with scale1000 or1000000. Reject malformed or missing inputs. Genuine zero volume is valid; never invent volume.",
  "canonical_policy": "A canonical source close label is exactly (ts+14400)*timestamp_scale-1. Noncanonical rows retain raw fields but all indicator values are unavailable. A noncanonical row or a missing scheduled anchor ends the segment. The next canonical row starts a new segment with OBV0 and no previous-close comparison. CMF starts with20 canonical adjacent rows; matched20-bar OBV change starts with21. Do not fill missing bars or bridge comparisons over an invalid row.",
  "formulas": {
    "obv": "For adjacent canonical closes d=sign(C_t-C_prev). signed_volume=d*V_t; OBV_t=OBV_prev+signed_volume. An exact tie has d=0 and signed_volume0. At a segment's first row OBV=0 and d/signed_volume are unavailable. The absolute OBV origin is a chosen additive constant, not a bullish or bearish zero line.",
    "mfm": "For H>L, MFM=((C-L)-(H-C))/(H-L). For valid H=L, MFM=0 by explicit policy. MFM lies in[-1,+1] because OHLC bounds are validated.",
    "mfv": "MFV=MFM*current total base-asset volume. Units ETH; neither quote turnover nor actual net capital flow nor buyer-initiated volume.",
    "cmf": "For20 current-inclusive canonical adjacent bars, window_mfv=sum(MFV) and window_volume=sum(V). CMF20=window_mfv/window_volume when denominator>0; unavailable when denominator0 or before20 bars. A zero-range bar adds0 to numerator but its volume remains in denominator.",
    "matched_obv": "With21 canonical adjacent price rows, obv_change20=OBV_t-OBV_(t-20)=sum of the20 signed_volume contributions on exactly the CMF20 volume window. obv_balance20=obv_change20/window_volume when denominator>0; otherwise unavailable. This dimensionless teaching diagnostic is a normalized OBV change, not a renamed CMF or the raw cumulative OBV.",
    "precision": "Exact Decimal-to-integer source conversion. Use integer OBV and Fraction MFM, MFV and window ratios for all comparisons. JSON/CSV numeric fields are float representations; retain exact reduced numerator/denominator fields. Do not decide equality or sign after display rounding.",
    "platform_policy": "Our zero-based OBV differs by an additive constant from TA-Lib's first-volume seed within each identical segment. Our null zero-volume CMF differs from TA-Lib's documented0 fallback. We also explicitly reset at source gaps/noncanonical intervals. No bitwise platform-parity claim.",
    "interpretation": "CMF is the volume-weighted mean close location inside each bar, not a percentage of buyers or trades at the high. OBV uses only the sign of each close-to-close change, not its magnitude or the open. Comparing the matched20-bar OBV change with CMF20 avoids mixing their horizons. Neither indicator identifies actual aggressor flow."
  },
  "history_policy": "Replay from the first supplied source row, with explicit canonical adjacent segments. Do not restart OBV at a chart window. No strategy indicators from reused evidence are consumed.",
  "selection": {
    "start_utc": "2023-01-01T00:00:00Z",
    "start_ts": 1672531200,
    "order": [
      "obv_up_cmf_down",
      "obv_down_cmf_up",
      "bar_disagrees"
    ],
    "conditions": {
      "obv_up_cmf_down": "Exact obv_change20>0 and exact CMF20<0.",
      "obv_down_cmf_up": "Exact obv_change20<0 and exact CMF20>0.",
      "bar_disagrees": "Exact current close>previous close, current MFM<0 and current volume>0; both20-bar diagnostics defined. This single-bar contrast explains the two classification methods, not a matched-window disagreement condition."
    },
    "eligibility": "Need25 earlier and5 later observed rows for31-row chart. Current and25 preceding rows must be26 adjacent canonical anchors: all displayed past price bars are canonical and both20-bar diagnostics at S are formed. The earliest displayed indicator values may still be warming up after a segment start. Future rows are required only for display availability; no future prices, volume, quality or returns rank selection. First eligible distinct source index per predicate in declared order; no fallback.",
    "reference_index": 25,
    "chart_previous": 25,
    "chart_following": 5,
    "performance_calculated": false
  },
  "display": {
    "candles": 31,
    "ohlc_decimals": 2,
    "volume_obv_decimals": 6,
    "ratio_decimals": 4,
    "price_axis": "Candles share USDT per ETH axis, padded and fixed for all31 displayed rows.",
    "obv_axis": "Cumulative zero-based source-segment OBV in ETH on its own padded axis. Do not rebase at display start; absolute zero is not a directional signal.",
    "ratio_axis": "CMF20 and the normalized20-bar OBV change on shared fixed[-1,+1] axis with zero reference. Label both series separately.",
    "x_axis": "Even observed-index spacing. Mark compressed calendar gaps; break indicator lines at unavailable values. Outlined candle bodies identify noncanonical source close labels. S stays on the fixed completed reference candle, while cursor and fields follow selection."
  },
  "teaching": {
    "classification": {
      "high": 110,
      "low": 90,
      "volume": 100,
      "cases": [
        {
          "id": "up_upper",
          "previous_close": 100,
          "close": 105,
          "signed_volume": 100,
          "mfm": 0.5,
          "mfv": 50
        },
        {
          "id": "down_upper",
          "previous_close": 110,
          "close": 105,
          "signed_volume": -100,
          "mfm": 0.5,
          "mfv": 50
        },
        {
          "id": "equal_upper",
          "previous_close": 105,
          "close": 105,
          "signed_volume": 0,
          "mfm": 0.5,
          "mfv": 50
        },
        {
          "id": "up_lower",
          "previous_close": 90,
          "close": 95,
          "signed_volume": 100,
          "mfm": -0.5,
          "mfv": -50
        }
      ]
    },
    "denominator": {
      "period": 20,
      "cases": [
        {
          "id": "all_ranged",
          "ranged_rows": 20,
          "flat_rows": 0,
          "volume_each": 10,
          "window_mfv": 100,
          "window_volume": 200,
          "cmf": 0.5
        },
        {
          "id": "one_flat",
          "ranged_rows": 19,
          "flat_rows": 1,
          "volume_each": 10,
          "window_mfv": 95,
          "window_volume": 200,
          "cmf": 0.475
        },
        {
          "id": "all_flat",
          "ranged_rows": 0,
          "flat_rows": 20,
          "volume_each": 10,
          "window_mfv": 0,
          "window_volume": 200,
          "cmf": 0
        },
        {
          "id": "no_volume",
          "ranged_rows": 20,
          "flat_rows": 0,
          "volume_each": 0,
          "window_mfv": 0,
          "window_volume": 0,
          "cmf": null
        }
      ],
      "ranged_bar": {
        "high": 110,
        "low": 90,
        "close": 105
      },
      "flat_bar": {
        "high": 105,
        "low": 105,
        "close": 105
      }
    },
    "units": "Constructed valid price fixtures in USDT per ETH; volumes, signed volumes and MFV in ETH; MFM and CMF dimensionless. Denominator examples each contain20 bars. No actual candles, fills or returns are implied."
  },
  "research_disclosure": "Retrospective educational guide using a previously published source. Protocol frozen before OBV/CMF candidate scanning. Original monthly ZIP archives are not downloaded again. No entries, exits, costs, orders, execution or returns calculated.",
  "performance_calculated": false,
  "sources": [
    "https://www.tradingview.com/support/solutions/43000502593-on-balance-volume-obv/",
    "https://www.tradingview.com/support/solutions/43000501974-chaikin-money-flow-cmf/",
    "https://github.com/binance/binance-public-data/blob/master/README.md"
  ],
  "additional_primary_context": [
    "https://ta-lib.org/functions/cmf.html",
    "https://github.com/TA-Lib/ta-lib/blob/main/src/ta_func/ta_OBV.c"
  ]
}
