Skip to content

v0.5.2

Compare
Choose a tag to compare
@joaquinbejar joaquinbejar released this 10 Jun 08:28
· 96 commits to main since this release
e2e286c

Release v0.5.2: Plotly Visualization, Code Cleanup, and Macro Improvements

Description

This pull request delivers the beta version v0.5.2-beta.1, introducing substantial improvements across plotting, macro utilities, testing, and internal structure. A major enhancement includes integrating plotly.rs for visualizing strategy payoffs, particularly for the short strangle strategy. Furthermore, the codebase has undergone systematic cleanup, documentation enrichment, macro expansion, and dependency management refinement—enhancing maintainability, clarity, and usability.


Changes Made

  • Visualization Enhancements:

    • Integrated plotly.rs to visualize profit/loss charts.
    • Added new short strangle P/L visualization with segment coloring and zero lines.
    • Enabled Plotly features (kaleido) in the library.
    • Improved HTML output and formatting of embedded plots.
  • Macro and Trait Refactoring:

    • Added impl_json_display_pretty, impl_json_debug_pretty for structured JSON output.
    • Refactored usage of pos! and standardized with spos! for signed positive numbers.
    • Improved macro coverage with unit tests.
  • Library and Code Cleanup:

    • Removed deprecated CustomStrategy implementation.
    • Eliminated unused functions and variables in pricing utilities.
    • Migrated to workspace-based dependency configuration.
    • Cleaned up stray whitespaces, improved module declarations, and test formatting.
    • Removed old plotly.rs files and re-vendored with updates.
  • Testing Improvements:

    • Enhanced test coverage for OptionData, OptionChain, and macro utilities.
    • Improved error handling and assertions for numerical stability in implied volatility calculations.
    • Updated option semantics in tests for consistency (SP500AAPL).
  • Documentation and Usability:

    • Added inline documentation for key traits, macros, and methods.
    • Introduced structured example outputs and adjusted builder parameter defaults.

Testing

  • Unit Tests:

    • Verified new macros and visual components.
    • Tested calculate_iv utility across edge cases like zero DTE.
    • Validated OptionData and OptionChain behavior with updated parameters.
  • Manual Testing:

    • Manually confirmed correctness of generated plots.
    • Verified P/L visualization against known strategies.
  • Refactoring Validation:

    • Ensured compilation and execution across updated binaries and examples.
    • Confirmed logging consistency via setup_logger across example bins.

Screenshots/Examples

  • Embedded plotly charts for short strangle and short straddle.
  • Updated HTML files showing visual enhancements.

Additional Notes

  • This release significantly improves maintainability by standardizing formatting, macros, and plot generation logic.
  • Follow-up work includes further extending visualization support for other strategies and refining macro ergonomics.

References

  • Supersedes earlier plotly.rs visual patches and macro improvements.

Checklist

  • Code changes reviewed and linted.
  • Documentation updated with inline and example-based explanations.
  • All unit and integration tests pass.
  • Plotly visualization manually verified.
  • Redundant code and dependencies removed.