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:
@@ -126,7 +126,13 @@ class HazelcastDataFeed(DataFeedPort):
|
||||
|
||||
# Prefer an explicit vel_div if present; otherwise compute it from
|
||||
# 50 vs 750 velocity tracking on the single-result schema.
|
||||
vel_div = scan.get('vel_div')
|
||||
# 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')
|
||||
if vel_div is None:
|
||||
multi = scan.get('multi_window_results') or {}
|
||||
if isinstance(multi, dict):
|
||||
|
||||
Reference in New Issue
Block a user