Skip to main content

A juejin quant lib to myself package

Project description

掘金量化的简化函数包(第三方)

个人自用包,出问题了欢迎提 Issue。

功能列表

A 股

获取信息

  1. 获取所有指数(股票市场、当前有效): get_all_index
  2. 获取所有股票(股票市场、当前有效): get_all_security
  3. 获取龙虎榜股票列表: get_dragon_tiger_list
  4. 获取交易量统计: l_get_day_volume
  5. 获取今日价格信息: l_get_one_day_price
  6. 获取当前是否实盘: is_live
  7. 获取历史数据: l_history_n

执行交易

  1. 买指定数量的股票: buy_count(stock: str, count: int, price: float)
  2. 卖指定数量的股票: sell_count(stock: str, count: int, price: float)
  3. 调整仓位(到特定数量): order_target_count(stock: str, volume: int, price: float)
  4. 调整仓位(到特定价值): order_target_money(stock: str, worth: int, price: float)

统计模块

【必须】进行初始化:l_static_init(context)

执行某个统计:

schedule(statistic_func, date_rule="1d", time_rule="07:00:00") 放在初始化区域,其中 statistic_func 是你期望进行的统计项。

月度统计:

  1. 近期净值变动: l_static_month_rate(context)

日度统计:

  1. 回撤区间统计:l_static_day_back(context),到达历史最高净值后回落,开始计算回撤区间,下次突破最高净值时,记“起点、终点、区间最大回撤比例”为一次回撤区间

记录日志

  1. 日志输出且保存: log_all(level: str, info: str, source: str = "", filetype: str = "")
  2. 日志不输出仅保存: log_save(level: str, info: str, source: str = "", filetype: str = "")
  3. 日志输出不保存,gm.print 即可
  4. 获取日志地址: l_get_log_path()

打包

  1. 更新 pyproject.toml 文件
  2. 执行 ./build.sh
  3. 输入 API token

旧的打包方式:

  1. 更新 pyproject.toml 文件
  2. 执行 python -m build
  3. 执行 python -m pip install twine upload dist/*
  4. 对输入框,输入账号: __token__ 并回车
  5. 最后输入 API token 即可

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

gm_libs-0.0.21.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

gm_libs-0.0.21-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file gm_libs-0.0.21.tar.gz.

File metadata

  • Download URL: gm_libs-0.0.21.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for gm_libs-0.0.21.tar.gz
Algorithm Hash digest
SHA256 6e370b3b578f7cb2767cabdd404de046e0213365f6e527dcc8dc60f65cfafdd9
MD5 95a40b95e38b8d6511168c668d34b5d7
BLAKE2b-256 3c9804056d530f2bb153f818c7f82d3dbf70b397857020f7751587fd0f540e52

See more details on using hashes here.

File details

Details for the file gm_libs-0.0.21-py3-none-any.whl.

File metadata

  • Download URL: gm_libs-0.0.21-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for gm_libs-0.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 8edc7f7f691d6e8c4769dc9c838a641cabd25d70a48454f0e2107404be45d84d
MD5 41772ed74698b8d0d0fe8dc5ca263361
BLAKE2b-256 1aedab8432a29b53882ee61783a04316c5d0fe4cd84eb278bedb9b4d22ca4b7b

See more details on using hashes here.

Supported by

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