A juejin quant lib to myself package
Project description
掘金量化的简化函数包(第三方)
个人自用包,出问题了欢迎提 Issue。
功能列表
A 股
获取信息
- 获取所有指数(股票市场、当前有效): get_all_index
- 获取所有股票(股票市场、当前有效): get_all_security
获取龙虎榜股票列表: get_dragon_tiger_list
执行交易
- 买指定数量的股票:
buy_count(stock: str, count: int, price: float)
- 卖指定数量的股票:
sell_count(stock: str, count: int, price: float)
- 调整仓位(到特定数量):
order_target_count(stock: str, volume: int, price: float)
- 调整仓位(到特定价值):
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
是你期望进行的统计项。
月度统计:
- 近期净值变动:
l_static_month_rate(context)
日度统计:
- 回撤区间统计:
l_static_day_back(context)
,到达历史最高净值后回落,开始计算回撤区间,下次突破最高净值时,记“起点、终点、区间最大回撤比例”为一次回撤区间
记录日志
- 日志输出且保存:
log_all(level: str, info: str, source: str = "", filetype: str = "")
- 日志不输出仅保存:
log_save(level: str, info: str, source: str = "", filetype: str = "")
- 日志输出不保存,
gm.print
即可 - 获取日志地址:
l_get_log_path()
打包
- 更新 pyproject.toml 文件
- 执行
./build.sh
- 输入 API token
旧的打包方式:
- 更新 pyproject.toml 文件
- 执行
python -m build
- 执行
python -m twine upload dist/*
- 对输入框,输入账号:
__token__
并回车 - 最后输入 API token 即可
Project details
Release history Release notifications | RSS feed
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.14.tar.gz
(5.1 kB
view hashes)