@@ -115,6 +115,7 @@ def fake_loader(_ib, symbol, duration="2 Y", bar_size="1 day"):
115115 self .assertGreaterEqual (indicators ["soxx" ]["rsi14_dynamic_threshold" ], 70.0 )
116116 self .assertGreater (indicators ["soxx" ]["bb_upper" ], indicators ["soxx" ]["price" ])
117117 self .assertLess (indicators ["soxx" ]["bb_lower" ], indicators ["soxx" ]["price" ])
118+ self .assertIn ("realized_volatility_10" , indicators ["soxx" ])
118119 self .assertIn ("realized_volatility_20" , indicators ["soxx" ])
119120 self .assertEqual (
120121 indicators ["soxx" ]["realized_volatility" ],
@@ -141,6 +142,7 @@ def test_build_semiconductor_rotation_indicators_from_history_is_generic(self) -
141142 self .assertEqual (indicators ["soxx" ]["rsi14" ], 100.0 )
142143 self .assertGreaterEqual (indicators ["soxx" ]["rsi14_dynamic_threshold" ], 70.0 )
143144 self .assertGreater (indicators ["soxx" ]["bb_upper" ], indicators ["soxx" ]["price" ])
145+ self .assertIn ("realized_volatility_10" , indicators ["soxx" ])
144146 self .assertIn ("realized_volatility_20" , indicators ["soxx" ])
145147 wrapped = build_semiconductor_rotation_inputs_from_history (
146148 soxl_history = [100.0 + idx for idx in range (170 )],
@@ -180,6 +182,7 @@ def fake_loader(_ib, symbol, duration="2 Y", bar_size="1 day"):
180182 self .assertEqual (payload ["derived_indicators" ]["soxx" ]["ma20" ], 200.0 )
181183 self .assertEqual (payload ["derived_indicators" ]["soxx" ]["rsi14" ], 50.0 )
182184 self .assertEqual (payload ["derived_indicators" ]["soxx" ]["rsi14_dynamic_threshold" ], 70.0 )
185+ self .assertEqual (payload ["derived_indicators" ]["soxx" ]["realized_volatility_10" ], 0.0 )
183186 self .assertEqual (payload ["derived_indicators" ]["soxx" ]["realized_volatility_20" ], 0.0 )
184187
185188 def test_build_semiconductor_rotation_indicators_requires_sufficient_history (self ) -> None :
0 commit comments