Implement Annualized Historical Volatility (AHV) indicator#387
Merged
Conversation
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 Reportβ
All modified and coverable lines are covered by tests. 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. π New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the Annualized Historical Volatility (AHV) indicator in the
volatilitypackage.Formula:
AHV = HV Γ β252AHV annualizes the Historical Volatility by multiplying it by the square root of the number of trading days per year (default 252).
Implementation
AnnualizedHistoricalVolatility[T helper.Number]NewAnnualizedHistoricalVolatility,NewAnnualizedHistoricalVolatilityWithPeriodperiod(default: 21),TradingDaysPerYear(default: 252)HistoricalVolatilityand multiplies viahelper.MultiplyByFiles Changed
volatility/annualized_historical_volatility.goβ indicator implementationvolatility/annualized_historical_volatility_test.goβ testsvolatility/testdata/annualized_historical_volatility.csvβ test data (252 rows)README.mdβ added AHV to volatility indicators indexvolatility/README.mdβ auto-regenerated by gomarkdocCloses #368