Skip to content

Implement Annualized Historical Volatility (AHV) indicator#387

Merged
cinar merged 1 commit into
masterfrom
feature/annualized-historical-volatility
May 29, 2026
Merged

Implement Annualized Historical Volatility (AHV) indicator#387
cinar merged 1 commit into
masterfrom
feature/annualized-historical-volatility

Conversation

@cinar
Copy link
Copy Markdown
Owner

@cinar cinar commented May 29, 2026

Summary

Implements the Annualized Historical Volatility (AHV) indicator in the volatility package.

Formula: AHV = HV Γ— √252

AHV annualizes the Historical Volatility by multiplying it by the square root of the number of trading days per year (default 252).

Implementation

  • Struct: AnnualizedHistoricalVolatility[T helper.Number]
  • Constructors: NewAnnualizedHistoricalVolatility, NewAnnualizedHistoricalVolatilityWithPeriod
  • Parameters: period (default: 21), TradingDaysPerYear (default: 252)
  • Composition: Delegates to HistoricalVolatility and multiplies via helper.MultiplyBy
  • 100% test coverage with CSV-based validation (3 test functions)

Files Changed

  • volatility/annualized_historical_volatility.go β€” indicator implementation
  • volatility/annualized_historical_volatility_test.go β€” tests
  • volatility/testdata/annualized_historical_volatility.csv β€” test data (252 rows)
  • README.md β€” added AHV to volatility indicators index
  • volatility/README.md β€” auto-regenerated by gomarkdoc

Closes #368

Add the AHV indicator to the volatility package. AHV annualizes
Historical Volatility by multiplying it by the square root of
trading days per year (default 252).

  AHV = HV Γ— √252

- Struct: AnnualizedHistoricalVolatility[T helper.Number]
- Constructors: NewAnnualizedHistoricalVolatility,
  NewAnnualizedHistoricalVolatilityWithPeriod
- Composes HistoricalVolatility with helper.MultiplyBy
- 100% test coverage with CSV-based validation
- Updated root and volatility README indexes

Closes #368
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 91.89%. Comparing base (d87f947) to head (78fdb7c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #387      +/-   ##
==========================================
- Coverage   91.90%   91.89%   -0.02%     
==========================================
  Files         226      227       +1     
  Lines        7162     7177      +15     
==========================================
+ Hits         6582     6595      +13     
- Misses        490      492       +2     
  Partials       90       90              

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cinar cinar merged commit 607513d into master May 29, 2026
5 checks passed
@cinar cinar deleted the feature/annualized-historical-volatility branch May 29, 2026 02:25
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Annualized Historical Volatility (AHV) Indicator

2 participants