From ec582a6ec49ca1abe0613941223eefe53025b4b0 Mon Sep 17 00:00:00 2001 From: tinkle-community Date: Fri, 6 Feb 2026 14:59:12 +0800 Subject: [PATCH] feat(web): improve grid direction adjustment UI clarity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename 'Bias Ratio' to 'Bias Strength' (偏向强度) - Add direction modes explanation (neutral/long/short/long_bias/short_bias) - Show actual buy/sell ratios for both long_bias and short_bias modes - Add bilingual support (Chinese/English) - Clarify that X% applies differently to long_bias vs short_bias --- .../components/strategy/GridConfigEditor.tsx | 52 +++++++++++++++---- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/web/src/components/strategy/GridConfigEditor.tsx b/web/src/components/strategy/GridConfigEditor.tsx index 6f605fc6..5c7dd736 100644 --- a/web/src/components/strategy/GridConfigEditor.tsx +++ b/web/src/components/strategy/GridConfigEditor.tsx @@ -83,10 +83,17 @@ export function GridConfigEditor({ // Direction adjustment directionAdjust: { zh: '方向自动调整', en: 'Direction Auto-Adjust' }, enableDirectionAdjust: { zh: '启用方向调整', en: 'Enable Direction Adjust' }, - enableDirectionAdjustDesc: { zh: '根据箱体突破自动调整网格方向(做多/做空/偏多/偏空)', en: 'Auto-adjust grid direction based on box breakouts (long/short/long_bias/short_bias)' }, - directionBiasRatio: { zh: '偏向比例', en: 'Bias Ratio' }, - directionBiasRatioDesc: { zh: '偏多/偏空模式下的买卖比例(如 0.7 表示 70% 买 + 30% 卖)', en: 'Buy/sell ratio for bias modes (e.g., 0.7 = 70% buy + 30% sell)' }, + enableDirectionAdjustDesc: { zh: '根据箱体突破自动调整网格方向', en: 'Auto-adjust grid direction based on box breakouts' }, + directionBiasRatio: { zh: '偏向强度', en: 'Bias Strength' }, + directionBiasRatioDesc: { zh: '偏多/偏空模式的强度', en: 'Strength for long_bias/short_bias modes' }, + directionBiasExplain: { zh: '偏多模式:X%买 + (100-X)%卖 | 偏空模式:(100-X)%买 + X%卖', en: 'Long bias: X% buy + (100-X)% sell | Short bias: (100-X)% buy + X% sell' }, directionExplain: { zh: '短期箱体突破 → 偏向,中期箱体突破 → 全仓,价格回归 → 逐步恢复中性', en: 'Short box breakout → bias, Mid box breakout → full, Price return → gradually recover to neutral' }, + directionModes: { zh: '方向模式说明', en: 'Direction Modes' }, + modeNeutral: { zh: '中性:50%买 + 50%卖(默认)', en: 'Neutral: 50% buy + 50% sell (default)' }, + modeLongBias: { zh: '偏多:X%买 + (100-X)%卖', en: 'Long Bias: X% buy + (100-X)% sell' }, + modeLong: { zh: '全多:100%买 + 0%卖', en: 'Long: 100% buy + 0% sell' }, + modeShortBias: { zh: '偏空:(100-X)%买 + X%卖', en: 'Short Bias: (100-X)% buy + X% sell' }, + modeShort: { zh: '全空:0%买 + 100%卖', en: 'Short: 0% buy + 100% sell' }, } return translations[key]?.[language] || key } @@ -465,21 +472,34 @@ export function GridConfigEditor({ {config.enable_direction_adjust && ( <> - {/* Direction Explanation */} -
-

+ {/* Direction Modes Explanation */} +

+

+ 📊 {t('directionModes')} +

+
+
• {t('modeNeutral')}
+
{t('modeLongBias')}
+
{t('modeLong')}
+
{t('modeShortBias')}
+
{t('modeShort')}
+
+

💡 {t('directionExplain')}

- {/* Bias Ratio */} + {/* Bias Strength */}
-

+

{t('directionBiasRatioDesc')}

+

+ {t('directionBiasExplain')} +

- - {Math.round((config.direction_bias_ratio ?? 0.7) * 100)}% / {Math.round((1 - (config.direction_bias_ratio ?? 0.7)) * 100)}% + + X = {Math.round((config.direction_bias_ratio ?? 0.7) * 100)}%
+
+
+ 偏多/Long Bias: + {Math.round((config.direction_bias_ratio ?? 0.7) * 100)}% 买 + {Math.round((1 - (config.direction_bias_ratio ?? 0.7)) * 100)}% 卖 +
+
+ 偏空/Short Bias: + {Math.round((1 - (config.direction_bias_ratio ?? 0.7)) * 100)}% 买 + {Math.round((config.direction_bias_ratio ?? 0.7) * 100)}% 卖 +
+
)}