Skip to main content

缠论技术分析库 — Rust 高性能实现

Project description

chanlun — 缠论技术分析 Python 绑定

PyPI License: MIT

基于 chanlun Rust 核心库的 PyO3 高性能 Python 绑定,API 参考 chan.py 设计,高度兼容。

安装

pip install chanlun

快速开始

import chanlun

# 创建配置(全部默认值)
config = chanlun.缠论配置()

# 读取 K 线数据文件(文件名需遵循 `符号-周期-起始时间戳-结束时间戳.nb` 格式,如 `btcusd-300-1631772074-1632222374.nb`)
obs = chanlun.观察者.读取数据文件("path/to/btcusd-300-1631772074-1632222374.nb", config)

# 查看各层级序列
print(f"K线数量: {len(obs.普通K线序列)}")
print(f"笔数量: {len(obs.笔序列)}")
print(f"线段数量: {len(obs.线段序列)}")
print(f"中枢数量: {len(obs.中枢序列)}")

# 或使用立体分析器进行多周期分析
analyzer = chanlun.立体分析器("BTCUSD", [60, 60*5, 60*5*6], config)
# 逐根投喂 K 线...

从源码构建

前置依赖: Rust + maturin

pip install maturin

# 开发模式(直接安装到当前 venv)
maturin develop

# 或构建 wheel
maturin build --release
pip install target/wheels/chanlun-*.whl

也可使用项目内的 build.sh:

./build.sh develop   # 开发安装
./build.sh wheel     # 构建 wheel

导出类

类别 类名 说明
枚举 买卖点类型, 相对方向, 分型结构 缠论基础枚举
数据 缺口, K线, 缠论K线 K 线数据结构
结构 分型, 虚线, 线段特征, 特征分型 分析层级结构
指标 平滑异同移动平均线, 相对强弱指数, 随机指标 MACD/RSI/KDJ
算法 , 线段, 中枢, 背驰分析 识别算法
业务 缠论配置, 基础买卖点, 买卖点, 观察者, K线合成器, 立体分析器 分析框架

兼容性

  • Python 3.9+
  • 类名 / 方法名 / 字段名与 chan.py 保持一致
  • 支持 .nb 二进制文件格式(大端字节序)

许可

本项目主体采用 MIT 许可。包含以下第三方开源代码:czsc(Apache 2.0)、parse(MIT)、termcolor(MIT)。

详见 NOTICELICENSES/ 目录。

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

chanlun-2606.47.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

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

chanlun-2606.47-cp312-cp312-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.12Windows x86-64

chanlun-2606.47-cp312-cp312-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

chanlun-2606.47-cp312-cp312-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

chanlun-2606.47-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

Details for the file chanlun-2606.47.tar.gz.

File metadata

  • Download URL: chanlun-2606.47.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chanlun-2606.47.tar.gz
Algorithm Hash digest
SHA256 30bae244b25aed50a999d3f13d7fcd14dbb020ff4bde58cf371ac59a5302210e
MD5 67538c20abbb279fe0693094d5e7ecbc
BLAKE2b-256 6f2fa3d6f1677fc34912515cae87d04f855b6ed10dc1e3738fe537328b8e0345

See more details on using hashes here.

Provenance

The following attestation bundles were made for chanlun-2606.47.tar.gz:

Publisher: publish.yml on YuYuKunKun/chanlun.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chanlun-2606.47-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: chanlun-2606.47-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chanlun-2606.47-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 411571286f22cbe3511f922f364ecc6e3a28b44fb70197e6084ff89ff6ac0086
MD5 88c1d38f24c803a77f099cd858a706e5
BLAKE2b-256 79bb9e112aae7e40e2ea0e4f620fd0ff10a5e5e14be4a0ca04e20fb9b84066c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for chanlun-2606.47-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on YuYuKunKun/chanlun.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chanlun-2606.47-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for chanlun-2606.47-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 871afb5904186fb2c6728c5fbcfc457ddad0f07a43b1de014943242e139835e9
MD5 05fdce3d1c850383de8f07c79cac7d01
BLAKE2b-256 6eed1c4d0b778ea2c74c406c556a7d4a18b931e629799cc0278045460856ab6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for chanlun-2606.47-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on YuYuKunKun/chanlun.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chanlun-2606.47-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for chanlun-2606.47-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a892abfcfef9a06709ad317c3996d6f199c9eceaca95f886093b2397916f48cd
MD5 1841e2baa5f1c3359f77cda379a0af5b
BLAKE2b-256 54f307a3352dc5836b417635e102fafd6259ea9e7c663cae4b7a372d0aad99e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for chanlun-2606.47-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: publish.yml on YuYuKunKun/chanlun.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chanlun-2606.47-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for chanlun-2606.47-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c241fe86fbd6e30ee14a52380daa789b4f6b02ab887fef660c5db63a7e0f1a6b
MD5 0fa33a11114277a959e468c8f524e18b
BLAKE2b-256 d117bb5c91038fb08f6db47c8b8d3233bdf58f6b25a68513346e5493dbdb440e

See more details on using hashes here.

Provenance

The following attestation bundles were made for chanlun-2606.47-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on YuYuKunKun/chanlun.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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