feat(market): Phase 1 扩展 — 更多 symbol + Bollinger/Vegas + 衍生品信号

- collector.symbols 与 supportedSymbols 加 SOL/BNB/DOGE,env-default 与 README 同步
- entity 追加 TechnicalStructure.Intervals(每周期 Bollinger + Vegas,omitempty 不破坏既有字段)与 DerivativesBundle.Signal
- 新增纯解析 usecase derivatives_signal.go:fundingBias 绝对阈值、oiSignal 用 P20 baseline + 价格方向(OI up + 价格 up/down → long/short_building,funding 不参与方向)、lsrRegime 绝对阈值;signal 数据不足走 warnings 进 DataQuality
- indicator.go 加 sma/stddev/ema/bollinger/vegas + computeIntervalTechnicals;IndicatorComputer 签名收 klines map
- harness 同步:G12 扩入 derivatives_signal.go(含 Makefile G12.5/6 + ADR-0002 适用范围 + project-map / harness-health 更新)
This commit is contained in:
dela
2026-05-24 23:19:57 +08:00
parent 622ff1d317
commit fa769331c2
16 changed files with 912 additions and 66 deletions

View File

@@ -58,7 +58,34 @@ type TakerVolumeRepository interface {
// 过 kline 与 long-short ratio复用结果即可二次注入仓库引用会
// 重复 IO。
//
// klinesByInterval 是按周期分组的 K 线 map每周期一份升序切片
// primaryInterval 指定哪个周期参与 support/resistance/range/longShortLine
// 的计算(其它周期只参与 Intervals 多周期指标如 Bollinger / Vegas
// 实现可见 internal/usecase/indicator.go。
type IndicatorComputer interface {
Compute(klines []entity.Kline, longShort []entity.LongShortRatio) entity.TechnicalStructure
Compute(
klinesByInterval map[string][]entity.Kline,
primaryInterval string,
longShort []entity.LongShortRatio,
) entity.TechnicalStructure
}
// DerivativesSignalComputer 把 funding/OI/LSR 的原始数据翻译成
// 可读语义crowded_long、long_building 之类)。
//
// 与 IndicatorComputer 一样是纯函数式接口、零 repo 依赖。
//
// primaryKlines 是用来给 OI 信号做"价格方向"判定的OI 在涨时,配合
// 价格涨 → long_building价格跌 → short_buildingfunding 不参与 OI
// 判定,避免价格下跌但 funding 仍为正时被误判)。
//
// 返回 warnings 用来告诉调用方"哪一项数据不够、对应字段为什么留空"
// 由调用方合并到 DataQuality.Warnings。signal 整体不可判时返回 nil。
type DerivativesSignalComputer interface {
Compute(
currentFunding *entity.FundingRate,
oiHistory []entity.OpenInterest,
globalLSR []entity.LongShortRatio,
primaryKlines []entity.Kline,
) (*entity.DerivativesSignal, []string)
}