diff --git a/web/src/components/strategy/GridConfigEditor.tsx b/web/src/components/strategy/GridConfigEditor.tsx index 1bc31e42..6f605fc6 100644 --- a/web/src/components/strategy/GridConfigEditor.tsx +++ b/web/src/components/strategy/GridConfigEditor.tsx @@ -1,4 +1,4 @@ -import { Grid, DollarSign, TrendingUp, Shield } from 'lucide-react' +import { Grid, DollarSign, TrendingUp, Shield, Compass } from 'lucide-react' import type { GridStrategyConfig } from '../../types' interface GridConfigEditorProps { @@ -23,6 +23,8 @@ export const defaultGridConfig: GridStrategyConfig = { stop_loss_pct: 5, daily_loss_limit_pct: 10, use_maker_only: true, + enable_direction_adjust: false, + direction_bias_ratio: 0.7, } export function GridConfigEditor({ @@ -77,6 +79,14 @@ export function GridConfigEditor({ dailyLossLimitDesc: { zh: '每日最大亏损百分比', en: 'Maximum daily loss percentage' }, useMakerOnly: { zh: '仅使用 Maker 订单', en: 'Maker Only Orders' }, useMakerOnlyDesc: { zh: '使用限价单以降低手续费', en: 'Use limit orders for lower fees' }, + + // 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)' }, + directionExplain: { zh: '短期箱体突破 → 偏向,中期箱体突破 → 全仓,价格回归 → 逐步恢复中性', en: 'Short box breakout → bias, Mid box breakout → full, Price return → gradually recover to neutral' }, } return translations[key]?.[language] || key } @@ -419,6 +429,77 @@ export function GridConfigEditor({ + + {/* Direction Auto-Adjust */} +
+ {t('enableDirectionAdjustDesc')} +
++ 💡 {t('directionExplain')} +
++ {t('directionBiasRatioDesc')} +
+