AgentStack
SKILL verified MIT Self-run

Czsc Ccxt Analysis

skill-lzh-xbccz-hermes-finance-czsc-ccxt-analysis · by Lzh-xbccz

缠论技术分析 — czsc官方全API,CCXT数据源,多级别联立,lightweight-charts可视化+自动Markdown报告。触发: 缠论/czsc/中枢/分型/笔

No reviews yet
0 installs
2 views
0.0% view→install

Install

$ agentstack add skill-lzh-xbccz-hermes-finance-czsc-ccxt-analysis

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Czsc Ccxt Analysis? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

缠论技术分析 (czsc v4.0 — v1.0.0rc8 全API + lightweight-charts)

> 基于 waditu/czsc v1.0.0rc8(2026-06-16 从源码构建) > 官方全链路:ccxt_connector → CZSC → call_signal → lightweight-charts → Markdown 报告


环境

已安装: czsc 1.0.0rc8 (源码构建), ccxt 4.5.59

从源码升级

bash install.sh  # 一键: Rust + czsc编译 + Python依赖

详见 references/czsc-build.md


API 速查

1. 数据获取

from czsc.connectors.ccxt_connector import get_raw_bars
from czsc import format_standard_kline, Freq

df = get_raw_bars('BTCUSDT', '4h', sdt='20260601', edt='20260616')
bars = format_standard_kline(df, Freq.F240)  # ⚠️ 必须传 Freq!

2. 缠论核心对象

c = CZSC(bars, max_bi_num=50)
c.bi_list       # List[BI]: .fx_a, .fx_b, .direction, .power, .high, .low
c.fx_list       # List[FX]: .dt, .fx, .has_zs, .low, .high
c.ubi_fxs       # 中枢信息在这里: [f for f in c.ubi_fxs if f.has_zs]
c.ubi           # ⚠️ List[str],不是BI对象!

3. 信号系统(222个信号,v1.0.0rc8)

from czsc._native.signals import call_signal

# v1.0.0rc8 新 API:信号名字符串调用
res = call_signal('cxt_first_buy_V221126', c)   # 一买
res = call_signal('cxt_decision_V240614', c)     # 综合决策(⭐最重要)
res = call_signal('cxt_bi_end_V230104', c)       # 笔结束

# 结果: [Signal('240分钟_D1B_BUY1_其他_任意_任意_0')]

4. 可视化(lightweight-charts)

from czsc.utils.plotting.lightweight import plot_czsc

# 暗色主题
plot_czsc(c, path='chart.html', theme='dark', title='BTC 4H')
plot_czsc(c, path='chart.html', theme='dark', tail_bars=200)  # 仅最近200根

GitHub HEAD 新功能(v1.0.0rc8 已安装)

| 功能 | 状态 | |------|------| | lightweight-charts | ✅ plot_czsc(c, output="html") | | CLI (czsc analyze/backtest/plot/signals/bench) | ✅ | | models 模块 | ✅ | | resample_bars | ⚠️ Freq.D/W/M 可用,F240 报错(市场时区) |


⚡ 实战决策信号优先级

cxt_decision_V240614 是最高价值信号 — 直接给出交易方向:

  • "开多_任意_任意_0" → 🟢 做多
  • "开空_任意_任意_0" → 🔴 做空

多级别共振决断(2026-06-16 BTC 15min 验证):

综合决策=开多 + 二买 + 5min反转↑ → 🟢 强做多
综合决策=开多 + 一买 + 笔结束      → 🟢 做多
二买 + 笔结束 + 无综合决策         → 🟡 观望偏多
中枢破位 + 一卖                    → 🔴 不做多

⛔ 关键坑点

1. getrawbars API

# ❌ 旧: get_raw_bars('ZECUSDT', '1h', 'binance', num=100)
# ✅ 新: get_raw_bars('ZECUSDT', '1h', sdt='20260601', edt='20260616')

2. formatstandardkline 需要 Freq

# ❌ format_standard_kline(df)
# ✅ format_standard_kline(df, Freq.F240)

3. CZSC.toecharts/toplotly 返回 "not implemented"

lightweight.plot_czsc() 替代,支持 dark theme + tail_bars

4. 日线漏笔(MINBILEN=6)

快速崩盘用 4H (F240) 分析

5. CZSC 构造不接受 freq/verbose

# ✅ CZSC(bars, max_bi_num=50)

6. c.ubi 是 List[str]

只判长度 len(c.ubi),不能遍历取属性

7. resample_bars 限制

Freq.D/W/M ✅ | Freq.F240/F60 ❌(市场时区问题) 需4H数据直接用 get_raw_bars(period='4h')

8. generateczscsignals warmup

需要 init_n(=500) 根以上 K线,不够用 init_n=50


🖥️ 平台注意事项

  • 终端安全层会隐藏 ghp_ 令牌(替换为 ***),用 xxd 确认原始字节

级别选择

| 级别 | Freq | period | 适用 | |------|------|--------|------| | 日线 | D | 1d | 月级趋势 | | 4H | F240 | 4h | 短线核心 | | 1H | F60 | 1h | 日内 | | 15min | F15 | 15m | 入场确认 |

# 多级别联立 + 信号 + dark 图表 + 报告(含背驰+模式识别)
python3 scripts/czsc_analyze.py BTCUSDT --chart --report
python3 scripts/czsc_analyze.py ETHUSDT --freqs 4h,1h,15m --chart

🆕 v4.1 新增:背驰分析 + 模式识别(源自 zengbin93/czsc_skills)

scripts/czsc_analyze.py 自动输出以下额外分析:

背驰分析

  • 同方向相邻笔 → 比较振幅 → 判断趋势衰竭
  • 下跌背驰:创新低但振幅 < 前笔 70% → 🟢 一买机会
  • 上涨背驰:创新高但振幅 < 前笔 70% → ⚠️ 一卖风险

买卖点模式识别

  • 分型回调手动判断:一买/二买/一卖/二卖候补
  • 含具体价位和判断条件
  • 与信号函数互补(信号给 ✅/❌,模式给"为什么")

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.