33#include "../manifold/n_asset_interval.hpp"
34#include "../tensor/n_asset_manifold.hpp"
80 [[nodiscard]]
int n() const noexcept {
81 return static_cast<int>(
names.size());
154 [[nodiscard]] std::optional<std::monostate>
155 ingest(std::span<const OHLCVBar> bars)
noexcept;
172 [[nodiscard]] std::optional<EngineOutput>
process()
const noexcept;
182 [[nodiscard]] std::optional<EngineOutput>
192 [[nodiscard]]
int n_assets()
const noexcept;
199 [[nodiscard]]
bool ready()
const noexcept;
214 [[nodiscard]] std::optional<Eigen::MatrixXd>
215 estimate_covariance()
const noexcept;
227 [[nodiscard]] std::optional<double>
228 compute_beta(
double prev_close,
double curr_close)
const noexcept;
239 [[nodiscard]] std::optional<std::pair<double, IntervalType>>
240 compute_portfolio_interval(
const NAssetManifold& manifold)
const noexcept;
248 std::deque<std::vector<OHLCVBar>> history_;
254 return universe_.
n();
258 return static_cast<int>(history_.size()) >= cfg_.
lookback_bars;
Full SRFM pipeline engine for N assets.
std::optional< std::monostate > ingest(std::span< const OHLCVBar > bars) noexcept
Ingest one bar for every asset in the universe.
std::optional< EngineOutput > ingest_and_process(std::span< const OHLCVBar > bars) noexcept
Ingest bars then immediately process.
bool ready() const noexcept
Return true if enough bars have been accumulated.
int n_assets() const noexcept
Return the number of assets.
std::optional< EngineOutput > process() const noexcept
Run the full pipeline on accumulated history.
Computes spacetime intervals between N-asset events.
(N+1)-dimensional Lorentzian manifold for N financial assets.
constexpr double ENGINE_BETA_MAX_SAFE
Maximum safe beta value (mirrors BETA_MAX_SAFE from momentum.hpp).
IntervalType
Causal character of a spacetime interval.
Relativistic momentum result for a single asset.
double relativistic_momentum
p_rel = γ × m_eff × close.
double m_eff
Effective mass (volume / ADV_baseline).
std::string asset_name
Name of the asset.
double gamma
Lorentz gamma factor.
IntervalType regime
Interval type for this asset.
double beta
Lorentz beta (normalised velocity).
The universe of assets processed by the engine.
int n() const noexcept
Return the number of assets.
std::vector< std::string > names
Asset names in order.
Engine configuration parameters.
int lookback_bars
Bars required before covariance is valid.
double lightlike_threshold
ds² threshold for LIGHTLIKE classification.
double adv_baseline
ADV baseline for effective mass.
double c_market
Market speed of light.
Aggregated engine output for one process() call.
double portfolio_interval_sq
Portfolio ds².
double timestamp
Timestamp of latest bar.
std::vector< AssetMomentumResult > assets
Per-asset results.
IntervalType portfolio_regime
Portfolio-level regime.
A single OHLCV bar for one asset.
double open
Opening price.
double volume
Volume traded.
double close
Closing price.
double timestamp
Bar timestamp (seconds since epoch or bar index).
double high
Highest price.
A spacetime event: a moment in time with N asset prices.