{
  "id": "eth-cmf-h4-ema50-v1",
  "frozen_on": "2026-11-12",
  "frozen_before": "New ETHUSDT archive ingestion, indicator or performance calculation for this study.",
  "source_plan_library_file_id": "libfile_fde3_f-0e357bed062481918433d2ca5bf35bd1_4aaf69fd96c4819197b87d875abd2c30",
  "question": "Does a strictly positive CMF20 gate improve price-cross-above-EMA50 entries after costs?",
  "market": "Binance ETHUSDT spot",
  "bar_seconds": 14400,
  "warmup_start_utc": "2019-06-01T00:00:00Z",
  "periods": {
    "full": [
      "2020-01-01T00:00:00Z",
      "2026-01-01T00:00:00Z"
    ],
    "early": [
      "2020-01-01T00:00:00Z",
      "2023-01-01T00:00:00Z"
    ],
    "later": [
      "2023-01-01T00:00:00Z",
      "2026-01-01T00:00:00Z"
    ]
  },
  "retrospective": true,
  "initial_cash": 10000,
  "long_only": true,
  "one_position": true,
  "leverage": 1,
  "uninvested_cash_interest": 0,
  "cmf_length": 20,
  "cmf_threshold": 0,
  "cmf_current_strictly_above": true,
  "money_flow_multiplier": "((C-L)-(H-C))/(H-L)",
  "money_flow_volume": "multiplier * base-asset ETH volume",
  "cmf": "sum(money_flow_volume over last20 observed candles) / sum(base volume over same20 candles)",
  "zero_range": "If H=L, multiplier=0; keep that candle's nonnegative volume in the denominator.",
  "zero_total_volume": "CMF undefined; primary gate cannot pass. Constant-volume control sets every volume to1, including originally zero-volume candles.",
  "cmf_window": "20 observed candles including current, not20 changes and not21 candles; no rounding before comparisons.",
  "ema_length": 50,
  "ema_initialization": "SMA of first50 observed closes, then alpha=2/51",
  "atr_length": 14,
  "atr_initialization": "First TR=H-L; SMA of first14 TR, then Wilder alpha=1/14",
  "price_cross": "Previous observed close <= previous EMA50 and current close > current EMA50; the two source bars must be adjacent scheduled H4 bars.",
  "primary_signal": "When flat at a completed close: price_cross, CMF20>0, valid EMA50 and positive ATR14. CMF exactly0 does not qualify. Do not wait for CMF confirmation after a price cross.",
  "entry": "Immediately next scheduled H4 open times(1+slippage). Missing next source bar or entry outside period cancels signal; no delayed entry.",
  "stop_atr_multiple": 2,
  "target_price_stop_multiple": 2,
  "max_holding_bars": 30,
  "entry_bar_holding_count": 1,
  "exit_levels": "D=2*signal ATR14; stop=entry-D; target=entry+2D; fixed, positive levels only. No EMA/CMF/trailing exit.",
  "baseline_fee_per_leg": 0.001,
  "baseline_slippage_per_leg": 0.0005,
  "stress_fee_per_leg": 0.002,
  "stress_slippage_per_leg": 0.001,
  "risk_fraction": 0.01,
  "risk_unit_formula": "entry*(1+fee)-stop*(1-slippage)*(1-fee)",
  "quantity": "min(0.01*available_cash/risk_unit, available_cash/(entry*(1+fee)))",
  "net_pnl": "quantity*(exit-entry)-fee*quantity*(entry+exit)",
  "net_r": "net_pnl/(quantity*risk_unit)",
  "fractional_quantity": true,
  "historical_venue_order_filter_feasibility": false,
  "variants": [
    "primary",
    "no_cmf",
    "constant_volume",
    "zero_cost",
    "higher_cost"
  ],
  "variant_rules": {
    "no_cmf": "Remove only the CMF>0 gate. Keep the identical adjacent price-cross candidate definition, EMA50, ATR and execution rules. CMF need not be defined for this control.",
    "constant_volume": "Replace all CMF volume inputs with1 while retaining20-bar range multipliers, the same price-cross, EMA50 and execution.",
    "zero_cost": "Primary gate with fee=slippage=0; resimulate prices, quantities, levels and account.",
    "higher_cost": "Primary gate with fee=.002 and slippage=.001; resimulate prices, quantities, levels and account."
  },
  "passive_reference": true,
  "passive_rule": "Full cash buy at first observed in-period opening; sell at last observed close, baseline adverse slippage and fees; exposure/risk not matched to the strategy.",
  "ambiguous_bar_resolution": "Opening barrier checks first. For H4 double touch, scan required official1m candles in chronological order; a missing minute before resolution or a same-minute double touch is unresolved. Primary stop-first; separate target-first bound. Fetch union of required minute days across portfolio, bounds and shadow candidates until no newly required days, or record official unavailability without inventing bars.",
  "gap_execution": "At an observed opening beyond a barrier use that opening reference and adverse sale slippage, before later intrabar range checks.",
  "holding_deadline": "deadline=entry_ts+30*14400. Entry bar counts1. Exit at30th scheduled close; if its quote is missing, first later observed opening after opening-barrier checks and before that later bar's intrabar ranges.",
  "end_exit": "Last observed close inside each independently evaluated period, adverse sale slippage; label period_end.",
  "cash_precision": "Float arithmetic; clamp only residual cash[-1e-8,0) to0; larger negative residual is error.",
  "indicator_gaps": "No synthetic bars. EMA/ATR recurse over observed bars; CMF uses20 observed candles. Price-cross signals require the two actual bars to be adjacent, and entry still requires immediate next scheduled source bar.",
  "reported_close_time": "Retain original close-time metadata and anomalies; close signals available only at scheduled open+14400, never an earlier source metadata close.",
  "first_entry": "Warm-up bar whose scheduled cutoff equals period start may signal first in-period entry; each account starts flat, no earlier positions.",
  "fresh_signal": "A bar closing after an exit may produce a new signal for next opening; no intrabar re-entry.",
  "equity_marking": "cash + quantity*native H4 close while open; exit fee at liquidation only. Initial cash included in peak. Equity ts=scheduled close cutoff, bar_ts=source opening; annual attribution uses bar_ts calendar year.",
  "exposure": "Observed evaluated H4 bar occupancy (held at any time in bar), not exact clock time.",
  "diagnostics": {
    "fixed_quantity_costs": "Hold primary raw entry opens, raw exit references, dates and quantities fixed; recost zero/baseline/higher. Report ledger P&L and fees, not resimulated account return.",
    "gap_exclusion": "Flag positions carried over any missing native H4 slot; exclude them at original quantities and report retained ledger P&L, not an account-return improvement.",
    "price_cross_candidates": "Full-period shadow diagnostic of every valid adjacent EMA50 price cross, even while another shadow position is open. Identical baseline entry, fixed levels and exit rules; one ETH unit, no cash account. Classify by signal CMF>0, CMF<=0, or undefined. Report sample counts, positive/non-positive net R fractions, mean/median net R and gap/ambiguity counts. Overlapping candidates are dependent and are not portfolio trades; do not sum into an account return. 'Non-positive entry' is only an outcome proxy, not a known false market signal."
  },
  "gallery": "First completed independent early trade, first completed later trade, then first later trade with opposite P&L sign to first later trade; if none use next chronological later trade. If a cohort has insufficient trades, explicitly report unavailable example rather than inventing one. H4 reference markers use raw prices. Selected M15 windows aggregate only complete15-minute groups from real1m observations; refine timing separately, never alter main ledger fills.",
  "later_trade_sample_warning_below": 30,
  "sources": [
    "https://www.tradingview.com/support/solutions/43000501974-chaikin-money-flow-cmf/",
    "https://chartschool.stockcharts.com/table-of-contents/technical-indicators-and-overlays/technical-indicators/chaikin-money-flow-cmf",
    "https://github.com/binance/binance-public-data/blob/master/README.md"
  ]
}

