Skip to content

v0.5.1

Compare
Choose a tag to compare
@joaquinbejar joaquinbejar released this 29 May 14:11
· 147 commits to main since this release
d740e2c

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.
  • Macro and Type Refactors:

    • Standardized pos! to spos! usage for consistency in signed positive values.
    • Updated Positive type with sub_or_zero, sub_or_none methods.
    • Improved Display/Debug trait macros with pretty JSON formatting.
  • 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.
  • Parameter and Utility Updates:

    • Updated OptionDataPriceParams, OptionChainBuildParams to use Some(...) consistently.
    • Enhanced OptionData to support optional extra_fields.
  • 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 and kaleido 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.