PINK: fix vel_div always-None in HazelcastDataFeed — normalize_ng7_scan hoists vel_div to top-level data dict but feed was reading scan (inner result sub-dict) which has no vel_div. Now checks data.get('vel_div') first (top-level), then scan, then recomputes from multi_window_results. PINK was receiving velocity_divergence=None on every snapshot and never entering trades even when BLUE (same threshold) did.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-06-08 15:18:53 +02:00
parent 6fc9eab927
commit 62553424ab

View File

@@ -126,6 +126,12 @@ class HazelcastDataFeed(DataFeedPort):
# Prefer an explicit vel_div if present; otherwise compute it from # Prefer an explicit vel_div if present; otherwise compute it from
# 50 vs 750 velocity tracking on the single-result schema. # 50 vs 750 velocity tracking on the single-result schema.
# NOTE: normalize_ng7_scan() hoists vel_div to the top-level data
# dict, but scan == result (inner sub-dict) which does NOT have it.
# Check the top-level data first, then the scan sub-dict, then
# recompute from multi_window_results as a last resort.
vel_div = data.get('vel_div') if isinstance(data, dict) else None
if vel_div is None:
vel_div = scan.get('vel_div') vel_div = scan.get('vel_div')
if vel_div is None: if vel_div is None:
multi = scan.get('multi_window_results') or {} multi = scan.get('multi_window_results') or {}