现金更正 + 法拉电子清仓记录

截图确认:
- 可用资金 92,664.20(含天添利)
- 冻结 39,481.40
- 总现金 132,145.60
- 总资产 = 持仓市值1,107,670 + 现金132,145.60 = 1,239,815.60

法拉电子 189.20卖出100股已记录
This commit is contained in:
知微
2026-06-29 12:40:50 +08:00
parent 13b4dcbcf0
commit 6a97d93018
34 changed files with 14336 additions and 30071 deletions
+12 -3
View File
@@ -5,11 +5,13 @@ import_holding_xls.py — 从 holding.xls 导入持仓到全系统
用法:
python3 import_holding_xls.py [--cash 现金] [--total 总资产] [--mv 市值]
--cash 必传!holding文件不含现金行,不传则现金=0。
不传 --total/--mv 则从 holding.xls 计算(可能有价格时差误差)。
建议传截图上的真实数字。
示例:
python3 import_holding_xls.py --cash 20230.10 --total 1008860.62 --mv 988512.96
python3 import_holding_xls.py --cash 73758.0 --total 874598.90 --mv 800840.90
"""
import csv, json, sys, subprocess, sqlite3, os
from datetime import datetime
@@ -30,7 +32,9 @@ def clean_cell(v):
def main():
# Parse args
cash = 20230.10
# ⚠️ 现金不从holding文件读取。holding只有股票持仓,现金必须单独提供(截图)。
# 不传 --cash 则默认为0,会在后面警告。
cash = 0.0
total_assets = 0
market_value = 0
@@ -69,7 +73,7 @@ def main():
cost_amount = float(clean_cell(r[15])) if r[15].strip() and r[15].strip() != '--' else 0
rate_str = clean_cell(r[16])
rate = float(rate_str) if rate_str and rate_str != '--' else 0.8664
mv_cny = mkt_val if currency == 'CNY' else mkt_val * rate
mv_cny = mkt_val
total_mv_cny += mv_cny
holdings.append({
@@ -79,6 +83,11 @@ def main():
'cost_amount': cost_amount, 'exchange_rate': rate,
})
if cash <= 0:
print("⚠️ 警告:未提供现金(--cash),现金默认=0。Dad可能给了截图现金数!")
print(" holding文件不含现金行,必须手动提供。可以用:")
print(f" python3 import_holding_xls.py --cash 73758.0")
# Use provided values or calculate
if total_assets <= 0:
total_assets = total_mv_cny + cash