feat: redesign indicator editor with required raw klines and improved UX

Backend:
- Add enable_raw_klines field to IndicatorConfig (always true, required)
- Change defaults: disable EMA/MACD/RSI/ATR, keep volume/OI/funding enabled

Frontend:
- Completely redesign IndicatorEditor with 4 clear sections:
  1. Market Data: Raw OHLCV (required, locked) + timeframe selection
  2. Technical Indicators: EMA/MACD/RSI/ATR (optional, AI can calculate)
  3. Market Sentiment: Volume/OI/Funding Rate
  4. Quant Data: External API integration
- Add helpful tips and descriptions in both Chinese and English
- Improve visual hierarchy with section headers and color coding
- Auto-ensure enable_raw_klines is always true
This commit is contained in:
tinkle-community
2025-12-08 13:02:51 +08:00
parent 7a6e6f2d92
commit 9c53a266c0
3 changed files with 273 additions and 162 deletions

View File

@@ -75,13 +75,15 @@ type CoinSourceConfig struct {
type IndicatorConfig struct {
// K-line configuration
Klines KlineConfig `json:"klines"`
// raw kline data (OHLCV) - always enabled, required for AI analysis
EnableRawKlines bool `json:"enable_raw_klines"`
// technical indicator switches
EnableEMA bool `json:"enable_ema"`
EnableMACD bool `json:"enable_macd"`
EnableRSI bool `json:"enable_rsi"`
EnableATR bool `json:"enable_atr"`
EnableVolume bool `json:"enable_volume"`
EnableOI bool `json:"enable_oi"` // open interest
EnableOI bool `json:"enable_oi"` // open interest
EnableFundingRate bool `json:"enable_funding_rate"` // funding rate
// EMA period configuration
EMAPeriods []int `json:"ema_periods,omitempty"` // default [20, 50]
@@ -92,8 +94,8 @@ type IndicatorConfig struct {
// external data sources
ExternalDataSources []ExternalDataSource `json:"external_data_sources,omitempty"`
// quantitative data sources (capital flow, position changes, price changes)
EnableQuantData bool `json:"enable_quant_data"` // whether to enable quantitative data
QuantDataAPIURL string `json:"quant_data_api_url,omitempty"` // quantitative data API address
EnableQuantData bool `json:"enable_quant_data"` // whether to enable quantitative data
QuantDataAPIURL string `json:"quant_data_api_url,omitempty"` // quantitative data API address
}
// KlineConfig K-line configuration
@@ -203,10 +205,11 @@ func GetDefaultStrategyConfig(lang string) StrategyConfig {
EnableMultiTimeframe: true,
SelectedTimeframes: []string{"5m", "15m", "1h", "4h"},
},
EnableEMA: true,
EnableMACD: true,
EnableRSI: true,
EnableATR: true,
EnableRawKlines: true, // Required - raw OHLCV data for AI analysis
EnableEMA: false,
EnableMACD: false,
EnableRSI: false,
EnableATR: false,
EnableVolume: true,
EnableOI: true,
EnableFundingRate: true,