From d46cc5eca050426263adc0729cebae466c354ca0 Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Wed, 12 Mar 2025 15:15:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=96=E7=AD=96=E7=95=A5=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=90=8E=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=A4=B4?= =?UTF-8?q?=E5=AF=B8=E5=92=8C=E7=8E=B0=E9=87=91=E4=BD=99=E9=A2=9D=E4=B9=8B?= =?UTF-8?q?=E6=80=BB=E5=92=8C=E4=BB=A5=E5=8F=8A=E5=90=84=E8=87=AA=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index a456356..032c16e 100644 --- a/main.py +++ b/main.py @@ -75,4 +75,10 @@ print('Starting Portfolio Value: %.2f' % cerebro.broker.getvalue()) cerebro.run() # Print out the final result -print('Final Portfolio Value: %.2f' % cerebro.broker.getvalue()) +final_value = cerebro.broker.getvalue() +cash = cerebro.broker.getcash() +portfolio_value = final_value - cash + +print('Final Portfolio Value: %.2f' % final_value) +print('Cash: %.2f' % cash) +print('Portfolio Value (Positions): %.2f' % portfolio_value)