Skip to content

Conversation

@Satvik-Singh192
Copy link
Contributor

Description

This PR adds an interactive Plotly HTML chart to the CLI backtest command, providing users with enhanced visualization capabilities while maintaining full backward compatibility with the existing matplotlib PNG output.

Key Changes:

  • Added create_equity_curve_plot function in new metrics/plotting.py module
  • Integrated new --plotly flag into CLI backtest command
  • Generated Plotly HTML charts are saved to output/backtest_plot.html
  • Maintained existing matplotlib PNG functionality as default behavior
  • Added comprehensive unit smoke tests for Plotly HTML file creation

Testing

  • pytest passes locally
  • Linting passes (ruff check src/ tests/ - no errors in new code)

Semver Changes

  • Patch (bug fix, no new features)
  • Minor (new features, no breaking changes)
  • Major (breaking changes)

Issues

Closes #5 - "Add Plotly PnL chart to CLI"

Checklist

Additional Notes

  • Plotly is an optional dependency (already listed in project README)
  • Users can generate both PNG and HTML charts using --plotly flag
  • Interactive charts include hover tooltips, zoom/pan capabilities, and performance metrics
  • Backward compatibility ensures existing workflows remain unchanged
  • Unit tests verify HTML file creation and basic functionality

@ayushkrtiwari ayushkrtiwari added PR:Accept To acknowledge the PR hacktoberfest-accepted Semver:minor minor version changes Type:Medium junior developers talks labels Oct 27, 2025
@ayushkrtiwari ayushkrtiwari merged commit 864d4e9 into OPCODE-Open-Spring-Fest:main Oct 27, 2025
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted PR:Accept To acknowledge the PR Semver:minor minor version changes Type:Medium junior developers talks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Plotly PnL chart to CLI

2 participants