@@ -486,6 +486,8 @@ type Config struct {
486486 MinOrderValue float64 `yaml:"min_order_value"` // 最小訂單價值(USDT),預設 6U,小於此值不掛單
487487 BuyWindowSize int `yaml:"buy_window_size"`
488488 SellWindowSize int `yaml:"sell_window_size"` // 賣單視窗大小
489+ // ShortOpenWindowSize BOTH 模式:向上開空層數;0 時用 SellWindowSize,仍為 0 則用 BuyWindowSize
490+ ShortOpenWindowSize int `yaml:"short_open_window_size" json:"short_open_window_size"`
489491 ReconcileInterval int `yaml:"reconcile_interval"`
490492 OrderCleanupThreshold int `yaml:"order_cleanup_threshold"` // 訂單清理上限(預設 100)
491493 CleanupBatchSize int `yaml:"cleanup_batch_size"` // 清理批次大小(預設 10)
@@ -1276,6 +1278,7 @@ type SymbolConfig struct {
12761278 MinOrderValue float64 `yaml:"min_order_value" json:"min_order_value"` // 最小訂單價值
12771279 BuyWindowSize int `yaml:"buy_window_size" json:"buy_window_size"` // 買單窗口(主配置,未配置 profiles 时使用)
12781280 SellWindowSize int `yaml:"sell_window_size" json:"sell_window_size"` // 賣單視窗(主配置,未配置 profiles 时使用)
1281+ ShortOpenWindowSize int `yaml:"short_open_window_size,omitempty" json:"short_open_window_size,omitempty"` // BOTH:向上開空層數;0=繼承 sell/buy
12791282 ReconcileInterval int `yaml:"reconcile_interval" json:"reconcile_interval"` // 對账间隔(秒)
12801283 OrderCleanupThreshold int `yaml:"order_cleanup_threshold" json:"order_cleanup_threshold"` // 訂單清理上限
12811284 CleanupBatchSize int `yaml:"cleanup_batch_size" json:"cleanup_batch_size"` // 清理批次大小
@@ -1411,6 +1414,7 @@ type BotConfig struct {
14111414 MinOrderValue float64 `yaml:"min_order_value" json:"min_order_value"` // 最小訂單價值
14121415 BuyWindowSize int `yaml:"buy_window_size" json:"buy_window_size"` // 買單窗口
14131416 SellWindowSize int `yaml:"sell_window_size" json:"sell_window_size"` // 賣單視窗
1417+ ShortOpenWindowSize int `yaml:"short_open_window_size,omitempty" json:"short_open_window_size,omitempty"` // BOTH:向上開空層數,0 繼承 sell/buy 窗口
14141418 ReconcileInterval int `yaml:"reconcile_interval" json:"reconcile_interval"` // 對賬間隔(秒)
14151419 OrderCleanupThreshold int `yaml:"order_cleanup_threshold" json:"order_cleanup_threshold"` // 訂單清理上限
14161420 CleanupBatchSize int `yaml:"cleanup_batch_size" json:"cleanup_batch_size"` // 清理批次大小
@@ -1600,6 +1604,7 @@ func SymbolConfigToBotConfig(sc SymbolConfig, exchangeTestnet bool) BotConfig {
16001604 MinOrderValue : sc .MinOrderValue ,
16011605 BuyWindowSize : sc .BuyWindowSize ,
16021606 SellWindowSize : sc .SellWindowSize ,
1607+ ShortOpenWindowSize : sc .ShortOpenWindowSize ,
16031608 ReconcileInterval : sc .ReconcileInterval ,
16041609 OrderCleanupThreshold : sc .OrderCleanupThreshold ,
16051610 CleanupBatchSize : sc .CleanupBatchSize ,
@@ -1681,6 +1686,7 @@ func BotConfigToSymbolConfig(bc BotConfig) SymbolConfig {
16811686 MinOrderValue : bc .MinOrderValue ,
16821687 BuyWindowSize : bc .BuyWindowSize ,
16831688 SellWindowSize : bc .SellWindowSize ,
1689+ ShortOpenWindowSize : bc .ShortOpenWindowSize ,
16841690 ReconcileInterval : bc .ReconcileInterval ,
16851691 OrderCleanupThreshold : bc .OrderCleanupThreshold ,
16861692 CleanupBatchSize : bc .CleanupBatchSize ,
@@ -2512,6 +2518,7 @@ func (c *Config) Validate() error {
25122518 MinOrderValue : c .Trading .MinOrderValue ,
25132519 BuyWindowSize : c .Trading .BuyWindowSize ,
25142520 SellWindowSize : c .Trading .SellWindowSize ,
2521+ ShortOpenWindowSize : c .Trading .ShortOpenWindowSize ,
25152522 Direction : direction ,
25162523 ReconcileInterval : c .Trading .ReconcileInterval ,
25172524 OrderCleanupThreshold : c .Trading .OrderCleanupThreshold ,
@@ -2543,6 +2550,7 @@ func (c *Config) Validate() error {
25432550 c .Trading .MinOrderValue = primary .MinOrderValue
25442551 c .Trading .BuyWindowSize = primary .BuyWindowSize
25452552 c .Trading .SellWindowSize = primary .SellWindowSize
2553+ c .Trading .ShortOpenWindowSize = primary .ShortOpenWindowSize
25462554 c .Trading .ReconcileInterval = primary .ReconcileInterval
25472555 c .Trading .OrderCleanupThreshold = primary .OrderCleanupThreshold
25482556 c .Trading .CleanupBatchSize = primary .CleanupBatchSize
0 commit comments