From 7933bd20b6c3bdb64a8f8c0cfc03b635e7f57970 Mon Sep 17 00:00:00 2001
From: variyaone <variyaone@example.com>
Date: Tue, 07 Apr 2026 10:06:54 +0800
Subject: [PATCH] chore: remove .trae and .commander from tracking

---
 code/portfolio/portfolio_tracker.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/code/portfolio/portfolio_tracker.py b/code/portfolio/portfolio_tracker.py
index df497bb..6d2e434 100644
--- a/code/portfolio/portfolio_tracker.py
+++ b/code/portfolio/portfolio_tracker.py
@@ -86,6 +86,17 @@
             except Exception as e:
                 print(f"⚠️ 加载持仓状态失败: {e}")
     
+    @property
+    def state(self) -> Dict:
+        """获取持仓状态"""
+        return {
+            'last_update': datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
+            'total_assets': self.total_assets,
+            'cash': self.cash,
+            'portfolio_value': self.portfolio_value,
+            'positions': [asdict(pos) for pos in self.positions.values()]
+        }
+    
     def _save_state(self):
         """保存持仓状态"""
         os.makedirs(os.path.dirname(self.state_file), exist_ok=True)

--
Gitblit v1.8.0