File tree Expand file tree Collapse file tree
QuanuX-Statistics/cpp/include Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#pragma once
22#include " models/WelfordRolling.hpp"
33// #include <Eigen/Dense> // Not used in this header anymore
4+ #include " quanux/SPSCQueue.hpp"
45#include < atomic>
56#include < cstdint>
67#include < map>
@@ -77,5 +78,19 @@ class StatsEngine {
7778 stats_mutex_; // Protect maps from NATS callbacks if multithreaded (NATS C
7879 // is usually single threaded callback context, but safer)
7980
81+ // Signal Structure for SPSC Queue
82+ struct Signal {
83+ uint64_t tick_ts;
84+ uint32_t instrument_id;
85+ double z_score;
86+ double volatility;
87+ };
88+
89+ // Lock-Free Signal Queue (Capacity 1024)
90+ // We use a unique_ptr to defer construction or keep header clean-ish
91+ // but template needs to be visible.
92+ // Actually, we can just declare the member if we include the header.
93+ quanux::SPSCQueue<Signal> signal_queue_{4096 };
94+
8095 void update_correlation (const std::string &symbol, double price);
8196};
You can’t perform that action at this time.
0 commit comments