| 49 | |
| 50 | private: |
| 51 | void initialize() { |
| 52 | // 初始化日志 |
| 53 | Logger::init(); |
| 54 | spdlog::info("Initializing trading engine..."); |
| 55 | |
| 56 | // 加载配置 |
| 57 | config_ = std::make_unique<Config>("config.json"); |
| 58 | |
| 59 | // 初始化组件 |
| 60 | data_loader_ = std::make_unique<DataLoader>(); |
| 61 | strategy_ = std::make_unique<MovingAverageStrategy>(); |
| 62 | risk_manager_ = std::make_unique<RiskManager>(config_->getRiskLimits()); |
| 63 | order_executor_ = std::make_unique<OrderExecutor>(); |
| 64 | |
| 65 | // 设置信号处理 |
| 66 | signal(SIGINT, signalHandler); |
| 67 | signal(SIGTERM, signalHandler); |
| 68 | |
| 69 | spdlog::info("Trading engine initialized successfully"); |
| 70 | } |
| 71 | |
| 72 | void processMarketData() { |
| 73 | try { |
nothing calls this directly
no outgoing calls
no test coverage detected