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:
@@ -15,6 +15,15 @@ type DerivativesBundle struct {
|
||||
OpenInterest OpenInterestBundle `json:"openInterest"`
|
||||
LongShortRatio LongShortBundle `json:"longShortRatio"`
|
||||
TakerBuySellVolume []TakerBuySellVolume `json:"takerBuySellVolume"`
|
||||
Signal *DerivativesSignal `json:"signal,omitempty"`
|
||||
}
|
||||
|
||||
// DerivativesSignal 把 funding / OI / LSR 的原始数字翻译成可读语义,
|
||||
// 供上游策略引擎直接消费。任一子字段为空字符串表示数据不足以判定。
|
||||
type DerivativesSignal struct {
|
||||
FundingBias string `json:"fundingBias,omitempty"` // crowded_long / crowded_short / neutral
|
||||
OISignal string `json:"oiSignal,omitempty"` // long_building / short_building / deleveraging / stable
|
||||
LSRRegime string `json:"lsrRegime,omitempty"` // retail_long_heavy / retail_short_heavy / balanced
|
||||
}
|
||||
|
||||
type FundingBundle struct {
|
||||
@@ -33,11 +42,36 @@ type LongShortBundle struct {
|
||||
}
|
||||
|
||||
type TechnicalStructure struct {
|
||||
Support []TechnicalLevel `json:"support"`
|
||||
Resistance []TechnicalLevel `json:"resistance"`
|
||||
RangeHigh *string `json:"rangeHigh"`
|
||||
RangeLow *string `json:"rangeLow"`
|
||||
LongShortLine *string `json:"longShortLine"`
|
||||
Support []TechnicalLevel `json:"support"`
|
||||
Resistance []TechnicalLevel `json:"resistance"`
|
||||
RangeHigh *string `json:"rangeHigh"`
|
||||
RangeLow *string `json:"rangeLow"`
|
||||
LongShortLine *string `json:"longShortLine"`
|
||||
Intervals map[string]IntervalTechnicals `json:"intervals"`
|
||||
}
|
||||
|
||||
type IntervalTechnicals struct {
|
||||
Bollinger *Bollinger `json:"bollinger,omitempty"`
|
||||
Vegas *Vegas `json:"vegas,omitempty"`
|
||||
}
|
||||
|
||||
// Bollinger 是 20 周期、2 倍标准差的布林带。
|
||||
// BandwidthPct = (upper-lower)/mid * 100,Squeeze 取 tight/normal/expanded。
|
||||
type Bollinger struct {
|
||||
Mid string `json:"mid"`
|
||||
Upper string `json:"upper"`
|
||||
Lower string `json:"lower"`
|
||||
BandwidthPct string `json:"bandwidthPct"`
|
||||
Squeeze string `json:"squeeze"`
|
||||
}
|
||||
|
||||
// Vegas 通道:EMA12/144/169 三条线 + 趋势判定。
|
||||
// Trend: bull / bear / range,按三条线的堆叠顺序判定。
|
||||
type Vegas struct {
|
||||
EMA12 string `json:"ema12"`
|
||||
EMA144 string `json:"ema144"`
|
||||
EMA169 string `json:"ema169"`
|
||||
Trend string `json:"trend"`
|
||||
}
|
||||
|
||||
type TechnicalLevel struct {
|
||||
|
||||
Reference in New Issue
Block a user