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 线数据文件,创建观察者
obs = chanlun.观察者.读取数据文件("path/to/data.nb", config)

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

# 或使用立体分析器进行多周期分析
analyzer = chanlun.立体分析器("BTCUSD", ["1min", "5min", "30min"], 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
./build.sh test      # 运行集成测试

导出类

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

兼容性

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

许可

MIT

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-2605.11.tar.gz (40.0 kB view details)

Uploaded Source

Built Distributions

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

chanlun-2605.11-cp312-cp312-win_amd64.whl (680.0 kB view details)

Uploaded CPython 3.12Windows x86-64

chanlun-2605.11-cp312-cp312-macosx_11_0_arm64.whl (779.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

chanlun-2605.11-cp312-cp312-macosx_10_12_x86_64.whl (792.3 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

chanlun-2605.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (855.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for chanlun-2605.11.tar.gz
Algorithm Hash digest
SHA256 f37adab1686b2ca0cade285807d6671b36bd1de17db95ae46de1a9b8dd8a1451
MD5 17718ed6557be65a785bdbaa7b60ea41
BLAKE2b-256 eec6d8161d9c4c0808ee4b3d1f2674c1eeec1473980781572128081bc30ba3d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for chanlun-2605.11.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-2605.11-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: chanlun-2605.11-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 680.0 kB
  • 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-2605.11-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 87fbe2a032dc83dc3b60ca7a4f0f55aee761f5323106718f894cd0a5639ad3d9
MD5 d4c9481f172b33a3812efdb574c80514
BLAKE2b-256 32779a8dd3aabf5873a69c570a0221e9f1be3d5ebdcd13f7268e38768ff1f86e

See more details on using hashes here.

Provenance

The following attestation bundles were made for chanlun-2605.11-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-2605.11-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for chanlun-2605.11-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ec32adf35a0415ea84cad36a708c0e85e5dc16d1063bd61bac9e7abaf1220283
MD5 abc3ba7f8983799e5be6ddfecd6538c3
BLAKE2b-256 05b8853dbcde68c1d3a40c7a89a15ea16c252e1561d091af3dd19c42b506a0af

See more details on using hashes here.

Provenance

The following attestation bundles were made for chanlun-2605.11-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-2605.11-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for chanlun-2605.11-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 eac3b95970912f660bf4c38a0cd21023dafccc37900249d7ad223b7233fdbc0f
MD5 86144fc6ae484c59f5c6a09cd3740bb5
BLAKE2b-256 eaf2cb74813a568eb5a1082ca120b5e6f2b558ec87a281ee2df2a54f7d5a03cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for chanlun-2605.11-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-2605.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for chanlun-2605.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d5e7c3b17426e7ff8d160e5c0d09c4d6cb0ff3009700cf20e7ef53077fb8cd2e
MD5 c796e9f50160f7823a8b5ac027c23f47
BLAKE2b-256 4bccd378d142c97372240c5127583ac06e12ff7d8422ffdc607b17a16cf642da

See more details on using hashes here.

Provenance

The following attestation bundles were made for chanlun-2605.11-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