@@ -70,3 +70,50 @@ def test_platform_reserved_cash_policy_does_not_lower_strategy_reserve():
7070
7171 assert plan ["execution" ]["reserved_cash" ] == 1200.0
7272 assert plan ["execution" ]["investable_cash" ] == 1800.0
73+
74+
75+ def test_value_decision_without_threshold_uses_platform_default ():
76+ decision = StrategyDecision (
77+ positions = (PositionTarget (symbol = "AAA" , target_value = 500.0 ),),
78+ diagnostics = {"signal_display" : "hold AAA" },
79+ )
80+ snapshot = PortfolioSnapshot (
81+ as_of = datetime .now (timezone .utc ),
82+ total_equity = 20000.0 ,
83+ buying_power = 3000.0 ,
84+ positions = (),
85+ )
86+
87+ plan = map_strategy_decision_to_plan (
88+ decision ,
89+ snapshot = snapshot ,
90+ strategy_profile = "mega_cap_leader_rotation_top50_balanced" ,
91+ )
92+
93+ assert plan ["execution" ]["trade_threshold_value" ] == 200.0
94+ assert plan ["execution" ]["current_min_trade" ] == 200.0
95+ assert plan ["allocation" ]["targets" ]["AAA" ] == 500.0
96+
97+
98+ def test_no_execute_decision_without_threshold_holds_current_positions ():
99+ decision = StrategyDecision (
100+ positions = (),
101+ risk_flags = ("no_execute" ,),
102+ diagnostics = {"signal_description" : "no actionable signal" },
103+ )
104+ snapshot = PortfolioSnapshot (
105+ as_of = datetime .now (timezone .utc ),
106+ total_equity = 5000.0 ,
107+ buying_power = 1000.0 ,
108+ positions = (Position (symbol = "AAA" , quantity = 3 , market_value = 750.0 ),),
109+ )
110+
111+ plan = map_strategy_decision_to_plan (
112+ decision ,
113+ snapshot = snapshot ,
114+ strategy_profile = "mega_cap_leader_rotation_top50_balanced" ,
115+ )
116+
117+ assert plan ["execution" ]["trade_threshold_value" ] == 100.0
118+ assert plan ["execution" ]["current_min_trade" ] == 100.0
119+ assert plan ["allocation" ]["targets" ]["AAA" ] == 750.0
0 commit comments