Skip to content

Phase 1: Foundation hardening#1

Merged
Jdaniel98 merged 2 commits into
mainfrom
phase-1/foundation-hardening
Mar 9, 2026
Merged

Phase 1: Foundation hardening#1
Jdaniel98 merged 2 commits into
mainfrom
phase-1/foundation-hardening

Conversation

@Jdaniel98

Copy link
Copy Markdown
Owner

Summary

  • Restructured monolithic Main/ into modular C++17 library with 5 module directories (core, indicators, analysis, risk, simulation)
  • CMake build system with Google Test via FetchContent, 14 passing tests with CSV-based offline data
  • GitHub Actions CI on Ubuntu + macOS matrix
  • Fixed 6 bugs: RSI div-by-zero, correlation div-by-zero, dynamic hedging wrong loop bound, EMA underflow, CURL silent failures, Bollinger incomplete return
  • Implemented 4 previously empty MeanReversion methods

Test plan

  • 14/14 tests pass locally on macOS
  • CI passes on Ubuntu and macOS (triggered by this PR)

Restructure monolithic Main/ codebase into modular C++17 library:

- CMake build system with FetchContent (Google Test v1.14.0)
- 5 module directories: core, indicators, analysis, risk, simulation
- 14 passing tests with CSV-based offline data (no network dependency)
- GitHub Actions CI (Ubuntu + macOS matrix)

Bugs fixed during extraction:
- RSI division by zero when avgLoss=0
- Correlation division by zero when variance=0
- Dynamic hedging wrong loop bound for long MA
- EMA unsigned integer underflow (backward loop)
- CURL missing error handling (silent failures)
- Bollinger bands returning only upper band

New capabilities:
- CSV load/save for reproducible analysis
- MeanReversion methods implemented (were declared but empty)
- CLAUDE.md project conventions established
- test_slippage.cpp: add #include <cmath> for std::isnan/std::isinf (GCC requires it)
- time_utils.cpp: increase snprintf buffer from 11 to 32 to silence GCC -Wformat-truncation
@Jdaniel98 Jdaniel98 merged commit f38fd28 into main Mar 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant