a
This commit is contained in:
parent
9ed4d4259a
commit
3e1e3392b7
|
|
@ -1049,6 +1049,80 @@ const GlobalConfig = ({ currentUser }) => {
|
|||
</section>
|
||||
)}
|
||||
|
||||
|
||||
|
||||
{/* 预设方案快速切换(仅管理员 + 全局策略账号) */}
|
||||
{isAdmin && isGlobalStrategyAccount && (
|
||||
<section className="global-section preset-section">
|
||||
<div className="preset-header">
|
||||
<h3>快速切换方案</h3>
|
||||
<div className="current-preset-status">
|
||||
<span className="status-label">当前方案:</span>
|
||||
<span className={`status-badge ${currentPreset ? 'preset' : 'custom'}`}>
|
||||
{currentPreset && presets && presets[currentPreset] ? presets[currentPreset].name : '自定义'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="preset-guide">
|
||||
<div className="preset-guide-title">怎么选更不迷糊</div>
|
||||
<ul className="preset-guide-list">
|
||||
<li>
|
||||
<strong>先选入场机制</strong>:纯限价(更控频但可能撤单) vs 智能入场(更少漏单但需限制追价)。
|
||||
</li>
|
||||
<li>
|
||||
<strong>再看"会不会下单"</strong>:如果你发现几乎不出单,优先把 <code>AUTO_TRADE_ONLY_TRENDING</code> 关掉、把 <code>AUTO_TRADE_ALLOW_4H_NEUTRAL</code> 打开。
|
||||
</li>
|
||||
<li>
|
||||
<strong>最后再微调</strong>:想更容易成交 → 调小 <code>LIMIT_ORDER_OFFSET_PCT</code>、调大 <code>ENTRY_CONFIRM_TIMEOUT_SEC</code>。
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div className="preset-groups">
|
||||
{presetGroups.map((g) => (
|
||||
<div key={g.key} className="preset-group">
|
||||
<div className="preset-group-header">
|
||||
<div className="preset-group-title">{g.title}</div>
|
||||
<div className="preset-group-desc">{g.desc}</div>
|
||||
</div>
|
||||
<div className="preset-buttons">
|
||||
{g.presetKeys
|
||||
.filter((k) => presets && presets[k])
|
||||
.map((k) => {
|
||||
const preset = presets && presets[k] ? presets[k] : null
|
||||
if (!preset) return null
|
||||
const meta = presetUiMeta && presetUiMeta[k] ? presetUiMeta[k] : { group: g.key, tag: '' }
|
||||
return (
|
||||
<button
|
||||
key={k}
|
||||
className={`preset-btn ${currentPreset === k ? 'active' : ''}`}
|
||||
onClick={() => {
|
||||
if (typeof applyPreset === 'function') {
|
||||
applyPreset(k)
|
||||
}
|
||||
}}
|
||||
disabled={saving}
|
||||
title={preset.desc}
|
||||
>
|
||||
<div className="preset-name">
|
||||
{preset.name}
|
||||
{meta.tag ? (
|
||||
<span className={`preset-tag preset-tag--${meta.group}`}>{meta.tag}</span>
|
||||
) : null}
|
||||
{currentPreset === k ? <span className="active-indicator">✓</span> : null}
|
||||
</div>
|
||||
<div className="preset-desc">{preset.desc}</div>
|
||||
</button>
|
||||
)
|
||||
})
|
||||
.filter(Boolean)}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
{/* 全局策略配置项编辑(仅管理员) */}
|
||||
{isAdmin && (
|
||||
<section className="global-section config-section">
|
||||
|
|
@ -1123,77 +1197,7 @@ const GlobalConfig = ({ currentUser }) => {
|
|||
</section>
|
||||
)}
|
||||
|
||||
{/* 预设方案快速切换(仅管理员 + 全局策略账号) */}
|
||||
{isAdmin && isGlobalStrategyAccount && (
|
||||
<section className="global-section preset-section">
|
||||
<div className="preset-header">
|
||||
<h3>快速切换方案</h3>
|
||||
<div className="current-preset-status">
|
||||
<span className="status-label">当前方案:</span>
|
||||
<span className={`status-badge ${currentPreset ? 'preset' : 'custom'}`}>
|
||||
{currentPreset && presets && presets[currentPreset] ? presets[currentPreset].name : '自定义'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="preset-guide">
|
||||
<div className="preset-guide-title">怎么选更不迷糊</div>
|
||||
<ul className="preset-guide-list">
|
||||
<li>
|
||||
<strong>先选入场机制</strong>:纯限价(更控频但可能撤单) vs 智能入场(更少漏单但需限制追价)。
|
||||
</li>
|
||||
<li>
|
||||
<strong>再看"会不会下单"</strong>:如果你发现几乎不出单,优先把 <code>AUTO_TRADE_ONLY_TRENDING</code> 关掉、把 <code>AUTO_TRADE_ALLOW_4H_NEUTRAL</code> 打开。
|
||||
</li>
|
||||
<li>
|
||||
<strong>最后再微调</strong>:想更容易成交 → 调小 <code>LIMIT_ORDER_OFFSET_PCT</code>、调大 <code>ENTRY_CONFIRM_TIMEOUT_SEC</code>。
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div className="preset-groups">
|
||||
{presetGroups.map((g) => (
|
||||
<div key={g.key} className="preset-group">
|
||||
<div className="preset-group-header">
|
||||
<div className="preset-group-title">{g.title}</div>
|
||||
<div className="preset-group-desc">{g.desc}</div>
|
||||
</div>
|
||||
<div className="preset-buttons">
|
||||
{g.presetKeys
|
||||
.filter((k) => presets && presets[k])
|
||||
.map((k) => {
|
||||
const preset = presets && presets[k] ? presets[k] : null
|
||||
if (!preset) return null
|
||||
const meta = presetUiMeta && presetUiMeta[k] ? presetUiMeta[k] : { group: g.key, tag: '' }
|
||||
return (
|
||||
<button
|
||||
key={k}
|
||||
className={`preset-btn ${currentPreset === k ? 'active' : ''}`}
|
||||
onClick={() => {
|
||||
if (typeof applyPreset === 'function') {
|
||||
applyPreset(k)
|
||||
}
|
||||
}}
|
||||
disabled={saving}
|
||||
title={preset.desc}
|
||||
>
|
||||
<div className="preset-name">
|
||||
{preset.name}
|
||||
{meta.tag ? (
|
||||
<span className={`preset-tag preset-tag--${meta.group}`}>{meta.tag}</span>
|
||||
) : null}
|
||||
{currentPreset === k ? <span className="active-indicator">✓</span> : null}
|
||||
</div>
|
||||
<div className="preset-desc">{preset.desc}</div>
|
||||
</button>
|
||||
)
|
||||
})
|
||||
.filter(Boolean)}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
{/* 用户管理 */}
|
||||
<section className="global-section">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user