Add S/R v2 research and validation harness
This commit is contained in:
@@ -85,6 +85,33 @@ class TestClusterSrZonesStrength:
|
||||
zones = cluster_sr_zones(levels, current_price=200.0, tolerance=0.02)
|
||||
assert zones[0]["strength"] == 30
|
||||
|
||||
def test_soft_strength_uses_max_plus_confluence(self):
|
||||
levels = [
|
||||
{
|
||||
"price_level": 100.0,
|
||||
"strength": 60,
|
||||
"detection_method": "pivot_point",
|
||||
"sources": ["pivot_point"],
|
||||
"rejection_count": 3,
|
||||
},
|
||||
{
|
||||
"price_level": 100.5,
|
||||
"strength": 60,
|
||||
"detection_method": "round_number",
|
||||
"sources": ["round_number"],
|
||||
"rejection_count": 1,
|
||||
},
|
||||
]
|
||||
zones = cluster_sr_zones(
|
||||
levels,
|
||||
current_price=200.0,
|
||||
tolerance=0.02,
|
||||
strength_mode="soft",
|
||||
)
|
||||
assert zones[0]["strength"] == 65
|
||||
assert set(zones[0]["sources"]) == {"pivot_point", "round_number"}
|
||||
assert zones[0]["rejection_count"] == 3
|
||||
|
||||
|
||||
class TestClusterSrZonesTypeTagging:
|
||||
"""Support vs resistance tagging."""
|
||||
|
||||
Reference in New Issue
Block a user