rs_czsc
使用 rust 优化 czsc 库的计算性能,以更高的效率实践缠中说禅思维方式。
czsc 开源库地址:https://github.com/waditu/czsc
安装:
pip install rs_czsc -U
卸载:
pip uninstall rs_czsc
高性能研究接口(推荐)
新接口采用“配置/数据块边界”模式,回测主循环完全在 Rust 内执行,Python 仅负责策略编排和结果消费:
from rs_czsc import run_research, build_strategy_config
strategy = build_strategy_config(
symbol="000001.SZ",
base_freq="30分钟",
positions=[...],
signals_config=[...],
)
res = run_research(bars_df, strategy, sdt="20210101")
pairs = res.pairs_df()
holds = res.holds_df()
signals = res.signals_df()
如需回放落盘,可使用 run_replay(..., res_path=...),会输出 signals.parquet / pairs.parquet / holds.parquet。
迁移脚本示例见:
examples/migrate_30m_bi_long_short.py
缠论精华
学了本ID的理论,去再看其他的理论,就可以更清楚地看到其缺陷与毛病,因此,广泛地去看不同的理论,不仅不影响本ID理论的学习,更能明白本ID理论之所以与其他理论不同的根本之处。
为什么要去了解其他理论,就是这些理论操作者的行为模式,将构成以后我们猎杀的对象,他们操作模式的缺陷,就是以后猎杀他们的最好武器,这就如同学独孤九剑,必须学会发现所有派别招数的缺陷,这也是本ID理论学习中一个极为关键的步骤。
真正的预测,就是不测而测。所有预测的基础,就是分类,把所有可能的情况进行完全分类。有人可能说,分类以后,把不可能的排除,最后一个结果就是精确的。 这是脑子锈了的想法,任何的排除,等价于一次预测,每排除一个分类,按概率的乘法原则,就使得最后的所谓精确变得越不精确,最后还是逃不掉概率的套子。 对于预测分类的唯一正确原则就是不进行任何排除,而是要严格分清每种情况的边界条件。任何的分类,其实都等价于一个分段函数,就是要把这分段函数的边界条件确定清楚。 边界条件分段后,就要确定一旦发生哪种情况就如何操作,也就是把操作也同样给分段化了。然后,把所有情况交给市场本身,让市场自己去当下选择。 所有的操作,其实都是根据不同分段边界的一个结果,只是每个人的分段边界不同而已。因此,问题不是去预测什么,而是确定分段边界。
Metadata
Release files for rs-czsc 0.1.25.post260320
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| rs_czsc-0.1.25.post260320-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| rs_czsc-0.1.25.post260320-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| rs_czsc-0.1.25.post260320-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| rs_czsc-0.1.25.post260320-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| rs_czsc-0.1.25.post260320-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 68.1 MB
Release files / rs_czsc-0.1.25.post260320-cp39-abi3-win_amd64.whl
| Download URL | rs_czsc-0.1.25.post260320-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 15.1 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5bee262f9d71d3ad3e11916f7ff0be6dc8ccf92684c0d3eb77c814d8dae7ee35
|
|
BLAKE2b-256 checksum How to use checksums |
0eebab043250501bdb44d64b56f86c1771a9d39eccc5b44ca77c4cc6632765ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / rs_czsc-0.1.25.post260320-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rs_czsc-0.1.25.post260320-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 14.2 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
297caac8d2ca18c13ab02491ccf3f95a2d7a8b06dfc2c49b6ba06cd70265d1bd
|
|
BLAKE2b-256 checksum How to use checksums |
d38712de962774b85a83463d741a9a809b214ebf60e9a125fd9971fd0fcdd419
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / rs_czsc-0.1.25.post260320-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rs_czsc-0.1.25.post260320-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 12.8 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c4c906b748ace76d01c2796a840d65befdd636fae49f73e03f3580cc238cac3b
|
|
BLAKE2b-256 checksum How to use checksums |
e39629b6620d08c16f581874b0066f00bf44d490f9e37380da76cf249dfd89fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / rs_czsc-0.1.25.post260320-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | rs_czsc-0.1.25.post260320-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 12.4 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e6c45f47306acea2d4c930f7336c82c21faf13406adc233eca607b4fecd77f46
|
|
BLAKE2b-256 checksum How to use checksums |
db75aa43b17c65f32c4b7e8a5d1e56ce6f16c1a0b519c342bf1bf7c34ea2db9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / rs_czsc-0.1.25.post260320-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | rs_czsc-0.1.25.post260320-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 13.6 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
a1e6d72159c6119e4bbfbe46186d7e4ab6cf265459cdf1913c6aae1e6f20e112
|
|
BLAKE2b-256 checksum How to use checksums |
f1b45642793b75208b6a5e14f409f3dac4601966290726a5783f490200b91e37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|