feat: add opportunity evaluation optimizer
This commit is contained in:
@@ -436,6 +436,28 @@ class OpportunityServiceTestCase(unittest.TestCase):
|
||||
self.assertEqual(sol["metrics"]["fundamental"], 0.9)
|
||||
self.assertEqual(sol["metrics"]["research_confidence"], 0.9)
|
||||
|
||||
def test_research_score_does_not_create_weak_trigger(self):
|
||||
metrics = {
|
||||
"extension_penalty": 0.0,
|
||||
"recent_runup": 0.0,
|
||||
"breakout_pct": -0.01,
|
||||
"setup_score": 0.12,
|
||||
"trigger_score": 0.18,
|
||||
}
|
||||
action, reasons = opportunity_service._action_for_opportunity(
|
||||
2.5,
|
||||
metrics,
|
||||
{
|
||||
"entry_threshold": 1.5,
|
||||
"watch_threshold": 0.6,
|
||||
"min_trigger_score": 0.45,
|
||||
"min_setup_score": 0.35,
|
||||
},
|
||||
)
|
||||
|
||||
self.assertEqual(action, "setup")
|
||||
self.assertIn("technical trigger quality is not clean enough", reasons[0])
|
||||
|
||||
def test_unlock_risk_blocks_add_recommendation(self):
|
||||
metrics = {
|
||||
"liquidity": 0.8,
|
||||
|
||||
Reference in New Issue
Block a user