v0.5.1
Release v0.5.1: Improved Implied Volatility Calculation, Refactors, and Documentation Enhancements
Description
This pull request finalizes the v0.5.1
beta release, which introduces major improvements to implied volatility (IV) calculations, enhanced macro and type handling, refactors for consistency, and expanded documentation. The release also includes updated test cases, parameter handling improvements, and utility enhancements aimed at improving code clarity, maintainability, and performance, particularly for edge cases in options pricing.
Changes Made
-
Implied Volatility Enhancements:
- Introduced
calculate_iv
utility. - Replaced Newton-Raphson with parallelized brute-force search for better performance and accuracy.
- Improved clamping, error handling, and test coverage, especially for zero DTE scenarios.
- Introduced
-
Macro and Type Refactors:
- Standardized
pos!
tospos!
usage for consistency in signed positive values. - Updated
Positive
type withsub_or_zero
,sub_or_none
methods. - Improved
Display
/Debug
trait macros with pretty JSON formatting.
- Standardized
-
Documentation and Usability:
- Added inline documentation to key methods, macros, and types like
OptionData
. - Refined parameter naming and removed unused variables in simulation and test files.
- Added inline documentation to key methods, macros, and types like
-
Parameter and Utility Updates:
- Updated
OptionDataPriceParams
,OptionChainBuildParams
to useSome(...)
consistently. - Enhanced
OptionData
to support optionalextra_fields
.
- Updated
-
Test Refactors and Additions:
- Adjusted expectations, reduced error margins, and improved test clarity.
- Removed deprecated test data, unused variables, and renamed parameters for clarity.
Testing
- Unit Tests: Extensive coverage for all new utilities, especially
calculate_iv
. - Edge Cases: Special focus on zero volatility, zero DTE options, and non-convergent scenarios.
- Manual Testing: Verified changes in simulation output and test harness consistency.
Screenshots/Examples
Not applicable for this update.
Additional Notes
- This release significantly improves robustness for volatility calculation in high-frequency trading or short-dated options.
- Prepares the codebase for future integrations with visualization libraries like Plotly via the
plotly
andkaleido
features now enabled.
References
- Resolves multiple internal improvements aligned with issue themes on documentation clarity, IV computation, and macro usage consistency.
Checklist
- Code refactored for consistency and clarity.
- New utility methods and macros documented.
- All tests updated and passing.
- Version bumped to v0.5.1.
- README and Cargo.toml updated accordingly.