Fix running status color; add ETH qty settings with Chinese labels.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -24,6 +24,8 @@ export default function SettingsPage() {
|
||||
const [exitPts, setExitPts] = useState(30);
|
||||
const [rest, setRest] = useState(300);
|
||||
const [maxRounds, setMaxRounds] = useState(3);
|
||||
const [perpQty, setPerpQty] = useState(1);
|
||||
const [optQty, setOptQty] = useState(2);
|
||||
const [stratOk, setStratOk] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
@@ -33,6 +35,8 @@ export default function SettingsPage() {
|
||||
setExitPts(s.exit_move_points);
|
||||
setRest(s.rest_seconds);
|
||||
setMaxRounds(s.max_rounds);
|
||||
setPerpQty(s.perp_qty_eth ?? 1);
|
||||
setOptQty(s.option_qty_eth ?? 2);
|
||||
})
|
||||
.catch(() => undefined);
|
||||
}, []);
|
||||
@@ -80,6 +84,8 @@ export default function SettingsPage() {
|
||||
exit_move_points: exitPts,
|
||||
rest_seconds: rest,
|
||||
max_rounds: maxRounds,
|
||||
perp_qty_eth: perpQty,
|
||||
option_qty_eth: optQty,
|
||||
}),
|
||||
});
|
||||
setStratOk("策略参数已保存");
|
||||
@@ -111,13 +117,37 @@ export default function SettingsPage() {
|
||||
{tab === "strategy" ? (
|
||||
<div className="card">
|
||||
<p style={{ color: "var(--muted)", marginTop: 0 }}>
|
||||
标的波动 N 点全平、轮次休息、费率(滑点=1×费率)。
|
||||
标的波动 N 点全平、轮次休息、仓位数量、费率(滑点=1×费率)。
|
||||
</p>
|
||||
{stratOk ? <div style={{ color: "var(--up)", marginBottom: 12 }}>{stratOk}</div> : null}
|
||||
{err && tab === "strategy" ? <div className="err">{err}</div> : null}
|
||||
<form onSubmit={onSaveStrategy}>
|
||||
<div className="field">
|
||||
<label htmlFor="exit">EXIT_MOVE_POINTS(标的波动点数)</label>
|
||||
<label htmlFor="perp">永续 ETH 数量</label>
|
||||
<input
|
||||
id="perp"
|
||||
className="mono"
|
||||
type="number"
|
||||
step="0.01"
|
||||
min="0.01"
|
||||
value={perpQty}
|
||||
onChange={(e) => setPerpQty(Number(e.target.value))}
|
||||
/>
|
||||
</div>
|
||||
<div className="field">
|
||||
<label htmlFor="opt">期权 ETH 数量</label>
|
||||
<input
|
||||
id="opt"
|
||||
className="mono"
|
||||
type="number"
|
||||
step="0.01"
|
||||
min="0.01"
|
||||
value={optQty}
|
||||
onChange={(e) => setOptQty(Number(e.target.value))}
|
||||
/>
|
||||
</div>
|
||||
<div className="field">
|
||||
<label htmlFor="exit">标的波动点数(全平阈值)</label>
|
||||
<input
|
||||
id="exit"
|
||||
className="mono"
|
||||
@@ -128,7 +158,7 @@ export default function SettingsPage() {
|
||||
/>
|
||||
</div>
|
||||
<div className="field">
|
||||
<label htmlFor="rest">REST_SECONDS(轮间休息秒)</label>
|
||||
<label htmlFor="rest">轮间休息秒数</label>
|
||||
<input
|
||||
id="rest"
|
||||
className="mono"
|
||||
@@ -139,7 +169,7 @@ export default function SettingsPage() {
|
||||
/>
|
||||
</div>
|
||||
<div className="field">
|
||||
<label htmlFor="rounds">MAX_ROUNDS</label>
|
||||
<label htmlFor="rounds">每日最大轮次</label>
|
||||
<input
|
||||
id="rounds"
|
||||
className="mono"
|
||||
@@ -150,7 +180,7 @@ export default function SettingsPage() {
|
||||
/>
|
||||
</div>
|
||||
<div className="field">
|
||||
<label htmlFor="fee">FEE_RATE</label>
|
||||
<label htmlFor="fee">手续费率</label>
|
||||
<input
|
||||
id="fee"
|
||||
className="mono"
|
||||
|
||||
Reference in New Issue
Block a user