Show pure-option source and net PnL on dashboard.

Restore 纯期权 label for non-hedge option rows and use close-preview net PnL instead of exchange upl.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-17 14:32:43 +08:00
parent c4c8ad172a
commit 549d8a015c
4 changed files with 40 additions and 13 deletions
+3 -2
View File
@@ -51,8 +51,9 @@ class TestDashboardPositionSource(unittest.TestCase):
"顺势加仓",
)
def test_options_plain_is_dash(self):
self.assertEqual(_options_source_label({"source": "option", "source_label": "纯期权"}), "")
def test_options_plain_is_pure(self):
self.assertEqual(_options_source_label({"source": "option", "source_label": "纯期权"}), "纯期权")
self.assertEqual(_options_source_label({"source": "option"}), "纯期权")
self.assertEqual(
_options_source_label({"source": "options_options", "source_label": "期期对冲"}),
"期期对冲",