fix(quant): eliminate all synthetic market/timeseries data, use 100% real exchange bars, and report 'No data available' when absent (v2.0.23)
This commit is contained in:
1 parent
9716a0ab61
commit
922f485388
27 files changed
+24021
-17509
No files matched your search
@@ -233,21 +233,29 @@ def classify_qualitative_archetype(
|
||||
structural_vector: dict[str, float],
|
||||
timeseries_moments: dict[str, Any],
|
||||
lens_id: str,
|
||||
) -> dict[str, str]:
|
||||
) -> dict[str, str | None]:
|
||||
"""
|
||||
Deterministically map lens-neutral structural + time-series moments into qualitative
|
||||
archetype tags, roles, and abilities under the requested lens.
|
||||
Returns `None` (`null` in JSON) when time-series data is unavailable.
|
||||
"""
|
||||
if timeseries_moments.get("ts_duty_cycle_pct") is None:
|
||||
return {
|
||||
"archetype": None,
|
||||
"causal_role": None,
|
||||
"regime_specialization": None,
|
||||
}
|
||||
qp = timeseries_moments.get("ts_quantile_profile") or {}
|
||||
p20 = float(qp.get("p20_floor", 50.0))
|
||||
p90 = float(qp.get("p90_ceiling", 75.0))
|
||||
cv = float(qp.get("cv", 0.5))
|
||||
duty = float(timeseries_moments.get("ts_duty_cycle_pct", 50.0))
|
||||
lag = int(timeseries_moments.get("ts_optimal_lag_days", 0))
|
||||
p20 = float(qp["p20_floor"]) if qp.get("p20_floor") is not None else 0.0
|
||||
p90 = float(qp["p90_ceiling"]) if qp.get("p90_ceiling") is not None else 0.0
|
||||
cv = float(qp["cv"]) if qp.get("cv") is not None else 0.5
|
||||
duty = float(timeseries_moments["ts_duty_cycle_pct"])
|
||||
lag_raw = timeseries_moments.get("ts_optimal_lag_days")
|
||||
lag = int(lag_raw) if lag_raw is not None else 0
|
||||
splits = timeseries_moments.get("ts_regime_splits") or {}
|
||||
m1_split = float(splits.get("M1_ENTROPIC", 0.0))
|
||||
m2_split = float(splits.get("M2_FLASH_CRASH", 0.0))
|
||||
m3_split = float(splits.get("M3_LEVIATHAN", 0.0))
|
||||
m1_split = float(splits["M1_ENTROPIC"]) if splits.get("M1_ENTROPIC") is not None else -999.0
|
||||
m2_split = float(splits["M2_FLASH_CRASH"]) if splits.get("M2_FLASH_CRASH") is not None else -999.0
|
||||
m3_split = float(splits["M3_LEVIATHAN"]) if splits.get("M3_LEVIATHAN") is not None else -999.0
|
||||
|
||||
if m1_split >= max(m2_split, m3_split) and m1_split > 3.0:
|
||||
peak_regime = "M1_ENTROPIC"
|
||||
|
||||
Reference in new issue
Block a user