chore: 删除未使用的 SpreadReverseExitPct 配置字段
This commit is contained in:
@@ -39,7 +39,6 @@ type Config struct {
|
||||
|
||||
// Exit/risk parameters
|
||||
TakeProfitPct float64 // net profit % threshold for take-profit
|
||||
SpreadReverseExitPct float64 // spread reversal % threshold for exit
|
||||
PositionTimeout time.Duration // max position hold time before auto-close
|
||||
LegDelay time.Duration // delay between placing long and short legs
|
||||
|
||||
@@ -81,7 +80,6 @@ type jsonConfig struct {
|
||||
|
||||
// New: exit/risk parameters
|
||||
TakeProfitPct float64 `json:"take_profit_pct"`
|
||||
SpreadReverseExitPct float64 `json:"spread_reverse_exit_pct"`
|
||||
PositionTimeoutSec int `json:"position_timeout_sec"`
|
||||
LegDelayMs int `json:"leg_delay_ms"`
|
||||
ReversalTolerancePct float64 `json:"reversal_tolerance_pct"`
|
||||
@@ -145,7 +143,6 @@ func LoadConfig() *Config {
|
||||
|
||||
// Exit/risk parameters
|
||||
TakeProfitPct: getFloat("TAKE_PROFIT_PCT", jsonCfg.TakeProfitPct),
|
||||
SpreadReverseExitPct: getFloat("SPREAD_REVERSE_EXIT_PCT", jsonCfg.SpreadReverseExitPct),
|
||||
PositionTimeout: time.Duration(getFloat("POSITION_TIMEOUT_SEC", float64(jsonCfg.PositionTimeoutSec))) * time.Second,
|
||||
LegDelay: time.Duration(getFloat("LEG_DELAY_MS", float64(jsonCfg.LegDelayMs))) * time.Millisecond,
|
||||
ReversalTolerancePct: getFloat("REVERSAL_TOLERANCE_PCT", jsonCfg.ReversalTolerancePct),
|
||||
@@ -182,7 +179,6 @@ func loadJSONConfig() jsonConfig {
|
||||
|
||||
// Exit/risk parameters
|
||||
TakeProfitPct: 0.20, // 0.20% net profit take-profit
|
||||
SpreadReverseExitPct: 0.02, // 0.02% spread reversal exit
|
||||
PositionTimeoutSec: 1800, // 30 minutes
|
||||
LegDelayMs: 300, // 300ms between legs
|
||||
ReversalTolerancePct: 0.1, // 0.1% tolerance for entry sanity check
|
||||
@@ -244,9 +240,6 @@ func loadJSONConfig() jsonConfig {
|
||||
if cfg.TakeProfitPct != 0 {
|
||||
def.TakeProfitPct = cfg.TakeProfitPct
|
||||
}
|
||||
if cfg.SpreadReverseExitPct != 0 {
|
||||
def.SpreadReverseExitPct = cfg.SpreadReverseExitPct
|
||||
}
|
||||
if cfg.PositionTimeoutSec != 0 {
|
||||
def.PositionTimeoutSec = cfg.PositionTimeoutSec
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user