Skip to content

Fix Day P/L and BWD calculations for option spreads#27

Merged
Graeme22 merged 1 commit into
tastyware:mainfrom
Atephys:fix-day-pl-and-bwd-calculations
Nov 3, 2025
Merged

Fix Day P/L and BWD calculations for option spreads#27
Graeme22 merged 1 commit into
tastyware:mainfrom
Atephys:fix-day-pl-and-bwd-calculations

Conversation

@Atephys

@Atephys Atephys commented Oct 30, 2025

Copy link
Copy Markdown
Contributor

Issue

The new tt pf positions command added in v1.0.0 shows incorrect Day P/L and Beta Weighted Delta values for vertical spreads.

What was wrong

  • Day P/L calculations didn't account for position direction (long/short), causing incorrect signs
  • BWD used option mark price instead of underlying stock price, inflating values by ~100x

Changes

  • Add position direction multiplier (m) to all pnl_day calculations
  • Fix BWD calculation to use underlying stock price instead of option mark price

Testing

Tested with real option spreads and compared output to Tastytrade website. Values now match within normal market fluctuation range. There might be issues with other position types that I don't use.

- Add position direction multiplier (m) to all pnl_day calculations
- Fix BWD calculation to use underlying stock price instead of option mark price

Fixes incorrect Day P/L signs for short positions and inflated BWD values.
@Graeme22

Copy link
Copy Markdown
Member

Thanks! Let me test this tomorrow when the market is open, sometimes the prices are weird after hours.

@Graeme22
Graeme22 merged commit 0aaa541 into tastyware:main Nov 3, 2025
@autojake autojake mentioned this pull request May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants