fix: HK stocks store HKD, calc_total_assets converts to CNY at aggregation
This commit is contained in:
+2
-2
@@ -250,7 +250,7 @@ def refresh_data_prices():
|
||||
if s['code'] in prices:
|
||||
price, _, change_pct = prices[s['code']]
|
||||
if price > 0:
|
||||
# 港股API返回HKD,直接存HKD原值。港股标价存HKD,A股标价存CNY
|
||||
# 港股存 HKD 原值(跟股软一致),总资产汇总时由 calc_total_assets 统一转 CNY
|
||||
old = s.get('price') or 0
|
||||
if abs(old - price) > 0.001:
|
||||
s['price'] = round(price, 2)
|
||||
@@ -299,11 +299,11 @@ def refresh_data_prices():
|
||||
if s['code'] in prices:
|
||||
price, _, change_pct = prices[s['code']]
|
||||
if price > 0:
|
||||
# 港股存 HKD 原值(跟股软一致)
|
||||
old = s.get('price') or 0
|
||||
if abs(old - price) > 0.001:
|
||||
s['price'] = round(price, 2)
|
||||
s['change_pct'] = float(change_pct) if change_pct else 0
|
||||
s['currency'] = 'HKD' if is_hk_stock(s['code']) else 'CNY'
|
||||
updated += 1
|
||||
changed = True
|
||||
if changed:
|
||||
|
||||
Reference in New Issue
Block a user