compute_lead_lag_relationships
See whether a reference market leads your primary chart by scanning return correlations across symmetric lags. Get per-lag interval and stability for descriptive evidence.
Instructions
Scan return correlation between two explicitly bound layout charts across a symmetric range of lags, so a caller can see whether a reference market leads the primary. Closed bars must share an exact UTC timestamp; missing bars are never forward-filled. The v3 default scales each return by its own series' prior-20-return RMS without using the current return. Every scanned lag is returned with its own interval and per-fold stability, and no best lag is selected. Shared clustered-volatility calibration still exceeds nominal alpha, so candidate eligibility and journal promotion remain disabled. Descriptive evidence only, never a trading signal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| folds | No | ||
| journal | No | Record this scan as evidence. Only tradable positive lags are stored; a scan can never be adopted, so decision must be rejected or inconclusive. | |
| max_lag_bars | No | Scan every lag from -max_lag_bars to +max_lag_bars. Default: 10 | |
| alignment_mode | No | Default exact_utc joins only identical bar timestamps. The resampling mode temporarily reads both charts at closed 60-minute bars and rebuilds a common UTC grid at expected_timeframe; use it only when vendor-anchored higher-timeframe bars cannot align exactly. | |
| confidence_level | No | ||
| expected_timeframe | Yes | ||
| primary_chart_index | Yes | ||
| configuration_trials | No | Total related scans inspected so far, including this one. Applied with all scanned lags as the Bonferroni family. Default: 1 | |
| minimum_observations | No | Lags with fewer paired returns are reported as insufficient. Default: 30 | |
| reference_chart_index | Yes | ||
| return_standardization | No | Default causal_prior_20_rms uses only each return's prior 20 returns for scale. none reproduces the invalidated raw-return v2 contract. | |
| expected_primary_symbol | Yes | ||
| expected_reference_symbol | Yes | ||
| empirical_null_calibration | No | Run the fixed 1,000-replication circular-shift empirical-null calibration on this exact pair. Required for the statistical gate; public candidate eligibility remains disabled pending shared-volatility calibration. Default: false |