a
This commit is contained in:
parent
dd68223c62
commit
24b2746f12
26
backend/fix_config_category.sql
Normal file
26
backend/fix_config_category.sql
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
-- 修复配置分类的SQL脚本
|
||||||
|
-- 确保 TOP_N_SYMBOLS 和 MAX_SCAN_SYMBOLS 都在 'scan' 分类下
|
||||||
|
|
||||||
|
USE auto_trade_sys;
|
||||||
|
|
||||||
|
-- 更新 TOP_N_SYMBOLS 分类为 scan(如果当前不是)
|
||||||
|
UPDATE trading_config
|
||||||
|
SET category = 'scan'
|
||||||
|
WHERE config_key = 'TOP_N_SYMBOLS' AND category != 'scan';
|
||||||
|
|
||||||
|
-- 更新 MAX_SCAN_SYMBOLS 分类为 scan(如果当前不是)
|
||||||
|
UPDATE trading_config
|
||||||
|
SET category = 'scan'
|
||||||
|
WHERE config_key = 'MAX_SCAN_SYMBOLS' AND category != 'scan';
|
||||||
|
|
||||||
|
-- 如果 MAX_SCAN_SYMBOLS 不存在,插入它
|
||||||
|
INSERT INTO trading_config (config_key, config_value, config_type, category, description)
|
||||||
|
VALUES ('MAX_SCAN_SYMBOLS', '500', 'number', 'scan', '扫描的最大交易对数量(0表示扫描所有,建议100-500)')
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
category = 'scan',
|
||||||
|
description = '扫描的最大交易对数量(0表示扫描所有,建议100-500)';
|
||||||
|
|
||||||
|
-- 验证结果
|
||||||
|
SELECT config_key, config_value, category, description
|
||||||
|
FROM trading_config
|
||||||
|
WHERE config_key IN ('TOP_N_SYMBOLS', 'MAX_SCAN_SYMBOLS');
|
||||||
|
|
@ -55,7 +55,7 @@ def init_configs():
|
||||||
category = 'position'
|
category = 'position'
|
||||||
elif 'RISK' in key or 'STOP' in key or 'PROFIT' in key:
|
elif 'RISK' in key or 'STOP' in key or 'PROFIT' in key:
|
||||||
category = 'risk'
|
category = 'risk'
|
||||||
elif 'SCAN' in key or 'INTERVAL' in key or 'VOLUME' in key:
|
elif 'SCAN' in key or 'INTERVAL' in key or 'VOLUME' in key or 'TOP_N_SYMBOLS' in key or 'MAX_SCAN_SYMBOLS' in key:
|
||||||
category = 'scan'
|
category = 'scan'
|
||||||
else:
|
else:
|
||||||
category = 'strategy'
|
category = 'strategy'
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ const ConfigPanel = () => {
|
||||||
MIN_CHANGE_PERCENT: 2.0,
|
MIN_CHANGE_PERCENT: 2.0,
|
||||||
MIN_SIGNAL_STRENGTH: 5,
|
MIN_SIGNAL_STRENGTH: 5,
|
||||||
TOP_N_SYMBOLS: 10,
|
TOP_N_SYMBOLS: 10,
|
||||||
|
MAX_SCAN_SYMBOLS: 150,
|
||||||
MIN_VOLATILITY: 0.02
|
MIN_VOLATILITY: 0.02
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -30,6 +31,7 @@ const ConfigPanel = () => {
|
||||||
MIN_CHANGE_PERCENT: 1.5,
|
MIN_CHANGE_PERCENT: 1.5,
|
||||||
MIN_SIGNAL_STRENGTH: 4,
|
MIN_SIGNAL_STRENGTH: 4,
|
||||||
TOP_N_SYMBOLS: 12,
|
TOP_N_SYMBOLS: 12,
|
||||||
|
MAX_SCAN_SYMBOLS: 250,
|
||||||
MIN_VOLATILITY: 0.018
|
MIN_VOLATILITY: 0.018
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -40,7 +42,8 @@ const ConfigPanel = () => {
|
||||||
SCAN_INTERVAL: 300,
|
SCAN_INTERVAL: 300,
|
||||||
MIN_CHANGE_PERCENT: 1.0,
|
MIN_CHANGE_PERCENT: 1.0,
|
||||||
MIN_SIGNAL_STRENGTH: 3,
|
MIN_SIGNAL_STRENGTH: 3,
|
||||||
TOP_N_SYMBOLS: 20,
|
TOP_N_SYMBOLS: 18,
|
||||||
|
MAX_SCAN_SYMBOLS: 350,
|
||||||
MIN_VOLATILITY: 0.015
|
MIN_VOLATILITY: 0.015
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user