Skip to main content

stock-up

CI PyPI version Python versions License: MIT

命令行版个人股票策略执行助手。

AI agent / 编程助手请先阅读 AGENTS.md,里面有安装、使用、开发和提交约定。

安装

从 PyPI 安装:

python3 -m pip install stock-up

验证安装:

stock-up --help

快速开始

普通使用只需要关注这几个命令:

1. 初始化

stock-up init

初始化本地配置、数据库和报告目录。

2. 添加持仓

stock-up hold add 300308 --name 中际旭创 --cost 120 --qty 100 --rule both

常用规则:

wolf_swing = 狼大波段规则,偏趋势持股
hai_long   = 海指导规则,偏长线仓/时间验证
both       = 两套规则同时开启

3. 盘中检查

stock-up tick

更新观察池和持仓池的实时行情,并检查是否有需要动作的信号。

stock-up 不常驻,建议用系统定时任务在交易时间内每 20 秒调用一次。

4. 每日复盘

stock-up daily

建议每日 16:00 以后执行。默认使用 StockAPI,并自动扫描龙虎榜加入观察池,生成 Markdown 日报。

daily 依赖的数据源通常在每日 16:00 以后更新;太早执行可能拿不到当天最新数据。

~/.stock-up/reports/YYYY-MM-DD.md

5. 必要时刷新高低点

如果历史数据里的高低点不准确,可以用 QQ 实时行情刷新:

stock-up watch refresh-range
stock-up hold refresh-range

6. 检查持仓

stock-up hold check

手动查看当前持仓是否触发止损、止盈、RSI 死叉或增持观察。

7. 卖出后关闭持仓

stock-up hold close 300308 --price 135 --reason 止盈

如果卖出后还想继续观察:

stock-up hold close 300308 --price 135 --reason 止盈 --watch

开发环境

git clone https://github.com/Guitenbay/stock-up.git
cd stock-up
python3 -m pip install -e '.[dev]'
pytest -q

如果开发时要使用 AkShare:

python3 -m pip install -e '.[dev,akshare]'

配置文件

默认配置文件位置:

~/.stock-up/config.yaml

stock-up init 会自动创建默认配置、数据库和报告目录。完整参数说明见 命令说明。

更多文档

免责声明

本工具仅用于个人复盘和策略辅助,不构成投资建议。

Metadata

Release files for stock-up 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stock-up 0.3.2
File Size Uploaded Provenance Actions
stock_up-0.3.2.tar.gz 45.7 kB Without provenance Details for stock_up-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stock-up 0.3.2
File Interpreter ABI Platform Actions
stock_up-0.3.2-py3-none-any.whl Python 3 none any Details for stock_up-0.3.2-py3-none-any.whl

Total release size: 81.7 kB

Release files / stock_up-0.3.2.tar.gz

Download URL stock_up-0.3.2.tar.gz
Size 45.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4aaddb3672a301d2dfba7e4d355f5ddd7694c83b062246928ba46a4bc705f8c9
BLAKE2b-256 checksum
How to use checksums
942fa253eba632606c35226ade744f843299b681067c6d45a7a96685305aaab3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release files / stock_up-0.3.2-py3-none-any.whl

Download URL stock_up-0.3.2-py3-none-any.whl
Size 36.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15f3928194b65978e1073e8ea10f57033af56a40aeda6544a5b76bf28209f0cb
BLAKE2b-256 checksum
How to use checksums
597e37f6f0249226acbe3f53052ca65231a63adebcdec7c1fc07c24148ae2e0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Security for stock-up 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page