Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
srfm::hawking::BollingerState Struct Reference

Internal rolling state for Bollinger Band computation. More...

#include <hawking.hpp>

Public Member Functions

void push (double price) noexcept
 Push a new price and pop the oldest if window is full.
 
double mean () const noexcept
 Return the rolling mean (NaN-safe).
 
double stddev () const noexcept
 Return the rolling standard deviation (population σ).
 
bool full () const noexcept
 True iff window has reached its maximum size.
 

Public Attributes

std::vector< double > window
 Rolling price window (oldest first).
 
double sum {0.0}
 Running sum for fast mean.
 
double sum_sq {0.0}
 Running sum of squares for fast σ.
 
std::size_t max_size {DEFAULT_BB_WINDOW}
 

Detailed Description

Internal rolling state for Bollinger Band computation.

Definition at line 121 of file hawking.hpp.

Member Function Documentation

◆ full()

bool srfm::hawking::BollingerState::full ( ) const
inlinenoexcept

True iff window has reached its maximum size.

Definition at line 137 of file hawking.hpp.

◆ mean()

double srfm::hawking::BollingerState::mean ( ) const
noexcept

Return the rolling mean (NaN-safe).

Definition at line 66 of file hawking.cpp.

◆ push()

void srfm::hawking::BollingerState::push ( double  price)
noexcept

Push a new price and pop the oldest if window is full.

Definition at line 53 of file hawking.cpp.

◆ stddev()

double srfm::hawking::BollingerState::stddev ( ) const
noexcept

Return the rolling standard deviation (population σ).

Definition at line 71 of file hawking.cpp.

Member Data Documentation

◆ max_size

std::size_t srfm::hawking::BollingerState::max_size {DEFAULT_BB_WINDOW}

Definition at line 125 of file hawking.hpp.

◆ sum

double srfm::hawking::BollingerState::sum {0.0}

Running sum for fast mean.

Definition at line 123 of file hawking.hpp.

◆ sum_sq

double srfm::hawking::BollingerState::sum_sq {0.0}

Running sum of squares for fast σ.

Definition at line 124 of file hawking.hpp.

◆ window

std::vector<double> srfm::hawking::BollingerState::window

Rolling price window (oldest first).

Definition at line 122 of file hawking.hpp.


The documentation for this struct was generated from the following files: