# Hotspot Rules Layer ## Purpose Rules define testable feature hypotheses. They are not permanent production weights and they are not trading advice. ## Canonical Rule File - `docs/ta_reference/institutional_hotspot_rules.md` ## Rule Families ### Institutional Flow Memory - `flow_120d_accumulation` - `flow_20d_acceleration` - `foreign_20ma_support` - `trust_10ma_support` - `dealer_confirmation` ### Risk And Divergence - `trust_10ma_break` - `foreign_20ma_break` - `flow_divergence_risk` - `flow_distribution_risk` ### Price And Volume Context - 20-day and 60-day momentum - 5/20 volume surge - average traded value - MA20 and MA60 distance - volatility penalty ## Implementation Rule Every new rule should be implemented as an auditable metric or reason in the hotspot payload first. Only after no-lookahead validation passes should it be allowed to affect production recommendation weighting. ## Current Code Anchors - `services/hotspot_scanner_service.py` - `data/institutional_flow_cache.py` - `scripts/precompute_full_market_hotspots.py`