Skip to content

Commit 8721654

Browse files
authored
fix(strategy): calculate total PnL percentage correctly in portfolio summary (#489)
## 📝 Pull Request Template ### 1. Related Issue Closes # (issue number) ### 2. Type of Change (select one) Type of Change: Bug Fix / New Feature / Code Refactor / Documentation Update / Other: __________ ### 3. Description Please describe the changes made and why they are necessary. ### 4. Testing - [ ] I have tested this locally. - [ ] I have updated or added relevant tests. ### 5. Checklist - [ ] I have read the [Code of Conduct](./CODE_OF_CONDUCT.md) - [ ] I have followed the [Contributing Guidelines](./CONTRIBUTING.md) - [ ] My changes follow the project's coding style
1 parent cec2234 commit 8721654

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/valuecell/server/services/strategy_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ async def get_strategy_portfolio_summary(
130130
cash=_to_optional_float(snapshot.cash),
131131
total_value=total_value,
132132
total_pnl=total_pnl,
133-
total_pnl_pct=total_pnl_pct,
133+
total_pnl_pct=_to_optional_float(total_pnl_pct) * 100.0,
134134
gross_exposure=_to_optional_float(
135135
getattr(snapshot, "gross_exposure", None)
136136
),

0 commit comments

Comments
 (0)