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

Loads OHLCV data from CSV files and stdin streams. More...

#include <data_loader.hpp>

Static Public Member Functions

static std::optional< std::vector< OHLCV > > load_csv (const std::string &filepath) noexcept
 
static std::vector< OHLCV > parse_csv_string (const std::string &csv_content) noexcept
 
static bool validate_bar (const OHLCV &bar) noexcept
 

Detailed Description

Loads OHLCV data from CSV files and stdin streams.

Definition at line 35 of file data_loader.hpp.

Member Function Documentation

◆ load_csv()

std::optional< std::vector< OHLCV > > srfm::core::DataLoader::load_csv ( const std::string &  filepath)
staticnoexcept

Load OHLCV bars from a CSV file on disk.

Arguments

  • filepath — Path to a CSV file with header row (timestamp, open, high, low, close, volume)

Returns

  • nullopt if the file cannot be opened
  • Empty vector if the file has a header but no valid data rows
  • Vector of parsed bars, skipping any malformed or non-finite rows

Definition at line 193 of file data_loader.cpp.

◆ parse_csv_string()

std::vector< OHLCV > srfm::core::DataLoader::parse_csv_string ( const std::string &  csv_content)
staticnoexcept

Parse OHLCV bars from a CSV-formatted string (useful for testing).

Same format as load_csv — first line is treated as a header.

Returns

Parsed bars. Never returns nullopt; returns empty vector on completely empty or header-only input.

Definition at line 161 of file data_loader.cpp.

◆ validate_bar()

bool srfm::core::DataLoader::validate_bar ( const OHLCV &  bar)
staticnoexcept

Validate a single OHLCV bar.

A bar is valid if:

  • All fields are finite
  • low <= open, close <= high
  • high >= low
  • volume >= 0

Definition at line 66 of file data_loader.cpp.


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