Skip to main content

CLI stock strategy assistant

Project description

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 会自动创建默认配置、数据库和报告目录。完整参数说明见 命令说明

更多文档

免责声明

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stock_up-0.3.1.tar.gz (45.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stock_up-0.3.1-py3-none-any.whl (35.9 kB view details)

Uploaded Python 3

File details

Details for the file stock_up-0.3.1.tar.gz.

File metadata

  • Download URL: stock_up-0.3.1.tar.gz
  • Upload date:
  • Size: 45.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for stock_up-0.3.1.tar.gz
Algorithm Hash digest
SHA256 226aa79deee6ab0efb2bc817271a9cbff4b9bb1ee9fadfe76cc8fdd20fe3866f
MD5 5e66f5ebc24d9a3572784ee71146b29e
BLAKE2b-256 209948f113468bf95031c9f45d651fbf1091c067b6cda782f27c8e979d63a941

See more details on using hashes here.

File details

Details for the file stock_up-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: stock_up-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 35.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for stock_up-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f849e69d1ed09c877698abae914f7c7614945dae84d06b9f10b2c49fec297c1
MD5 6896cbaf9b0f9ecc6a767d541e4c6550
BLAKE2b-256 92b0f234b6e3c6813022f6deb2f1d3e6462c564345e13bc520bc740a3e46b2fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page