{"repo":"Shareyjp/portfolio-tracker","free":true,"listed":false,"github":"https://github.com/Shareyjp/portfolio-tracker","clone":"git clone https://github.com/Shareyjp/portfolio-tracker.git","description":"A股 ETF 组合实时跟踪工具。","language":"Python","stars":10,"topics":["a-share","etf-investments","finance","investment","portfolio","quant","stock-market","streamlit"],"license":"MIT","category":"trading","readme_excerpt":"Portfolio Tracker — ETF 组合实时跟踪 A lightweight terminal tool for tracking A-share ETF portfolios in real time — quotes, positions, P&L, moving averages, snapshot logging, and chart generation. Optional Streamlit dashboard included. 这个小工具做两件事： 1. 实时拉取行情 （无需登录券商），在终端里滚动展示你的 ETF 组合：价格、涨跌幅、仓位权重、浮盈亏。 2. 记录快照并画图 ：把轮询到的快照写入 CSV，然后一键生成「组合净值线」和「各持仓权重线」。 说明：使用的是公开行情接口（非官方），接口可能随时变更/限频；请把轮询频率控制在合理范围（例如 3–10 秒）。 快速开始 macOS 常见问题： pip 报 SSL 证书校验失败 如果你看到类似 SSLCertVerificationError: certificate verify failed ，通常是 Python 没拿到系统根证书。先在同一个终端里执行： 仍不行的话，运行 Python 自带的证书修复脚本（按你的 Python 版本改路径）： 编辑 portfolio-tracker/portfolio.json ，把你的 份额 （ shares ）和 成本 （ cost ，可选）填进去。 如果你在 positions[].name 里写了自定义名称，界面会优先显示这个名称（不会被行情源返回的官方简称覆盖）。 1) 终端实时看盘 + 记录快照 表格最右侧会显示 MA5/MA10/MA30 。这些均线来自你的 close 日快照：如果本地记录不够， close 会尝试用历史 K 线回填（默认拉近 60 个交易日），通常不用等攒够 30 天；拉取失败/没跑过 close 时会显示 - 。 现在 watch / quote once 走的是简洁口径： - 主表展示价格、涨跌、份额、市值、 TotalPnL 、 DayPnL 、 MA5/10/30 - 标题汇总展示现金/总资产/ TotalPnL / DayPnL - 若开启了 --benchmark （默认 SH000001 ），会展示指数：点位、实时涨跌、 O/H/L 如果你有场外基金，也可以在配置里加 off positions 。终端会附加展示场外基金（ OFxxxxxx ），并在标题里显示 Off(est) （盘中估值）、 Off(nav) （确认净值）或 Off(mix) （混合来源），以及 OffPnL 、 OffDay 。 场外基金优先使用新浪盘中估值；新浪未覆盖或非当日数据时，自动回退东财最新确认净值。QDII 等不提供盘中估值的基金通常会触发回退，因此组合汇总可能显示 Off(mix) 。 如果你不想频繁改 portfolio.json ，也可以临时覆盖现金： 只拉一次（不循环）： 也可以一键拉一次（自动处理 venv/依赖，macOS 可双击）： - portfolio-tracker/quote once.command - portfolio-tracker/pt.command （菜单：quote/watch/close/brief/plot） 1.5)（可选）收盘后记录一条「隐秘」日快照 收盘后运行一次，把当日快照写入一个 不太好直接看懂 的行文件（默认： data/.pt daily.","default_branch":null,"files":null,"tree":[],"storefront":"/r/Shareyjp","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Shareyjp/portfolio-tracker/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}