feat: 关羽完成实时风险监控系统原型开发 - 16分钟冲刺完成

This commit is contained in:
cfdaily
2026-03-21 18:00:46 +08:00
parent 992f8bd30c
commit e43c7a5214
7 changed files with 1475 additions and 0 deletions
@@ -0,0 +1,60 @@
"""
实时风控系统 - 导出接口
============
使用示例:
```python
from realtime_system import RealtimeRiskPanel
# 创建保守风格风控面板
panel = RealtimeRiskPanel(risk_style="conservative")
# 更新净值
panel.update_net_value(datetime.now(), 1000000)
# 更新持仓
panel.update_position("600519", 100, 1800)
# 定期风控检查
result = panel.update(datetime.now(), total_capital, cash)
# 检查是否允许开仓
if result['can_open_position']:
# 允许开仓
pass
```
"""
from risk_calculator import RealTimeRiskCalculator, RiskMetrics
from risk_monitor import (
RealTimeRiskMonitor,
ThresholdConfig,
RiskAlert,
AlertLevel
)
from emergency_handler import (
EmergencyHandler,
EmergencyConfig,
EmergencyAction,
EmergencyLevel
)
from realtime_risk_panel import RealtimeRiskPanel
__all__ = [
# 风险计算
'RealTimeRiskCalculator',
'RiskMetrics',
# 风险监控
'RealTimeRiskMonitor',
'ThresholdConfig',
'RiskAlert',
'AlertLevel',
# 紧急处理
'EmergencyHandler',
'EmergencyConfig',
'EmergencyAction',
'EmergencyLevel',
# 主面板
'RealtimeRiskPanel',
]