package entity type MarketContext struct { Symbol string `json:"symbol"` GeneratedAt int64 `json:"generatedAt"` Snapshot *Ticker24h `json:"snapshot"` Klines map[string][]Kline `json:"klines"` Derivatives DerivativesBundle `json:"derivatives"` Technical TechnicalStructure `json:"technical"` DataQuality DataQuality `json:"dataQuality"` } type DerivativesBundle struct { Funding FundingBundle `json:"funding"` 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 { Current *FundingRate `json:"current"` History []FundingRate `json:"history"` } type OpenInterestBundle struct { Current *OpenInterest `json:"current"` History []OpenInterest `json:"history"` } type LongShortBundle struct { Global []LongShortRatio `json:"global"` TopTraderPosition []LongShortRatio `json:"topTraderPosition"` } type TechnicalStructure struct { 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 { Price string `json:"price"` Strength string `json:"strength,omitempty"` Source string `json:"source,omitempty"` } type DataQuality struct { Source string `json:"source"` Warnings []string `json:"warnings"` }