nonebot-plugin-weather-fighter
📖 介绍
本项目基于weather-fighter二次开发
可以先给原项目一个star哦(●′ω`●)
💿 安装(以下选择其一安装即可)
nb plugin install nonebot-plugin-weather-fighter
使用 pip 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装pip install nonebot-plugin-weather-fighter
如果安装完插件不载入的话,在nonebot文件夹中找到pyproject.toml,在plugins里面添加nonebot-plugin-beatsaberscore就完成了
如果你的Nonebot2项目下已经启用虚拟环境,可以使用Pipenv安装到项目中,但你需要安装pipenv包
使用 pipenv 安装
先安装pipenvpip install pipenv
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
pipenv install nonebot-plugin-weather-fighter
uv sync
uv add nonebot-plugin-weather-fighter
🔄 更新
使用 nb-cli 更新
在 nonebot2 项目的根目录下打开命令行, 输入以下指令更新nb plugin install nonebot-plugin-weather-fighter --upgrade
使用 pip 更新
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可更新pip install nonebot-plugin-weather-fighter --upgrade
🎉 命令
| 命令 | 说明 |
|---|---|
天气 [省份/城市] |
主图截图 + 现在天气 + 今日高低温 + 未来 1 小时;行情 / 大盘 / K线 是同一命令的别名;不用开盘 |
买入 [省份] [金额] [倍数 N] |
做多;金额不填默认 20%;可选 倍数 5 / 杠杆 5 |
卖出 [省份] [金额] [倍数 N] |
写金额做空;不写金额默认平仓;可选 倍数 5 / 杠杆 5 |
| `到价 [省份] 价格 买入 | 卖出 [金额]` |
到价 [省份] 价格 平 |
价格触及自动平掉该省 |
平仓 [省份] |
平掉(全部卖掉)该省;不带省平掉全部持仓(只平仓,不主动结算) |
撤单 |
取消自己的到价单 |
倍数 [N] |
设置杠杆倍数(1~上限,有持仓时不能改);不带参数查看当前倍数 |
帮助 [省份] |
命令说明 / 省份详情 |
📝 PS
- 所有群共用一个盘:所有群共用一条行情时间轴
- 每个玩家的余额、持仓、到价单互相独立;可以同时在多个省持仓,每个省最多一个持仓;账户按群隔离。
- 真实交易时间:周一至周五
09:30-11:30、13:00-15:00;11:30-13:00午休;周末休市。 - 完全按真实时间连续运行,没有盘到期;发命令时懒补齐到当前真实时间。
- 简化规则:投入多少最多亏多少;不显示手续费/滑点/保证金/强平价/手数;倍数默认 1 倍,可在下单时带
杠杆 5,或先用倍数 5设置;上限由WEATHER_FIGHTER_LEVERAGE决定。 - 地区当前只开放全国 34 个省级行政区的天气;352 城数据保留在
regions.json,后续开放。 - 法定节假日:使用
chinesecalendar(随依赖更新) - 彩云 v2.6 客户端预留,如果没配置彩云天气的API(
WEATHER_FIGHTER_CAIYUN_TOKEN)默认使用免费的Open-Meteo数据 - 缓存:懒刷新 + 30 分钟桶 + 单飞 + 负缓存 + 旧值兜底,尽可能减少请求次数
- 保底机制: 没钱可以等着吃
保底,低于默认余额(WEATHER_FIGHTER_PRINCIPAL)的20%(2,000)时进入保底;每个真实自然日补默认余额的5%(500),补到35%(3,500)停止。 - 中文字体已随插件打包,不需要系统安装 CJK 字体。
- 如果你有更好的想法和建议,随时欢迎提出issues~(●´∀`●)
配置
| 环境变量 | 默认值 | 说明 |
|---|---|---|
WEATHER_FIGHTER_BUCKET_BARS |
1800 | 15 分钟行情桶(秒) |
WEATHER_FIGHTER_STALE_SECONDS |
21600 | 旧值最多可用时长 |
WEATHER_FIGHTER_HTTP_TIMEOUT |
30 | 单次 HTTP 超时(秒) |
WEATHER_FIGHTER_PRINCIPAL |
10000 | 每个玩家在每个群的初始余额 |
WEATHER_FIGHTER_LEVERAGE |
100 | 杠杆上限(玩家可在 1~该值之间自选) |
WEATHER_FIGHTER_SAFETY_ENTRY_PCT |
20 | 低于默认余额的百分比时进入保底 |
WEATHER_FIGHTER_SAFETY_GRANT_PCT |
5 | 每个真实自然日补默认余额的百分比 |
WEATHER_FIGHTER_SAFETY_TARGET_PCT |
35 | 补到默认余额的百分比后停止触发 |
WEATHER_FIGHTER_CHART_BARS |
64 | 主图节点数(64 根 ≈ 4 个交易日,其中约 15% 为预测尾段) |
WEATHER_FIGHTER_ENABLE_REGION |
true | 是否加载同省区域指数 |
WEATHER_FIGHTER_DEFAULT_PROVINCE |
河北 | 启动时用于建盘的默认省份 |
WEATHER_FIGHTER_CAIYUN_TOKEN |
空 | 彩云 token(预留) |
主图
这只是一个示例~~~。
Metadata
Release files for nonebot-plugin-weather-fighter 0.5.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_weather_fighter-0.5.2.1.tar.gz | 901.7 kB | With provenance | Details for nonebot_plugin_weather_fighter-0.5.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_weather_fighter-0.5.2.1-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_weather_fighter-0.5.2.1-py3-none-any.whl |
Total release size: 1.6 MB
Release files / nonebot_plugin_weather_fighter-0.5.2.1.tar.gz
| Download URL | nonebot_plugin_weather_fighter-0.5.2.1.tar.gz |
|---|---|
| Size | 901.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5319b6842ee3fe52bc9be12d5fefe241532de745e923bed9119a9b7a5a641b25
|
|
BLAKE2b-256 checksum How to use checksums |
4722b2899d8c03bfb8f55ce7299396274593ca84770cd379b7fb160dd17f69cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logRelease files / nonebot_plugin_weather_fighter-0.5.2.1-py3-none-any.whl
| Download URL | nonebot_plugin_weather_fighter-0.5.2.1-py3-none-any.whl |
|---|---|
| Size | 693.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a925169577ee3b4bf5a6c8bbe288c19e6d31510d5ecf038825e4aeb52e4e8af
|
|
BLAKE2b-256 checksum How to use checksums |
8cb550ff5eb1c4a4e30ad9d0ccca39eba72073873086a3bdc97411b57a4ea36d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logSecurity for nonebot-plugin-weather-fighter 0.5.2.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for nonebot_plugin_weather_fighter-0.5.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logA 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.