Administrator
7 days ago 3ebd59a88bc0bdcf91dff94ad2ba25e1f4fe682f
src/main/resources/static/gate-config.html
@@ -133,6 +133,7 @@
            <div class="form-group"><label>单边最大仓位量(张)</label><input id="maxPositionPerSide" type="number" placeholder="0(不限制)"></div>
            <div class="form-group"><label>加仓启动阈值(次)</label><input id="addPositionStartThreshold" type="number" placeholder="1(前N次止损不加仓)"></div>
            <div class="form-group"><label>超额止盈开关</label><select id="placeExcessTakeProfit"><option value="false" selected>关闭</option><option value="true">开启</option></select></div>
            <div class="form-group"><label>原始仓位减仓(0=关闭)</label><input id="originalPositionReduce" type="number" placeholder="0"></div>
            <!-- ===== 双开止损触发配置 ===== -->
            <div class="form-group full" style="margin-top:6px;border-top:1px solid var(--border);padding-top:8px">
                <label style="font-size:13px;font-weight:600;color:var(--text)">双开止损触发</label>
@@ -217,7 +218,7 @@
        fillForm({ gridRate:0.005, expectedProfit:0.15, maxLoss:1.5,
            baseQuantity:'2', quantity:'2', maxPositionSize:4, stopLossCount:0, takeProfitGridSpan:2, priceDriveEnabled: true, rounds: 0,
            stopLossCountMode:'dual', addPositionInterval:3, addPositionQuantity:1, maxPositionPerSide:0, addPositionStartThreshold:1, placeExcessTakeProfit: false,
            dualStopLossEnabled: false, longStopLossPrice: '', shortStopLossPrice: '' });
            originalPositionReduce: 0, dualStopLossEnabled: false, longStopLossPrice: '', shortStopLossPrice: '' });
        toast('未找到配置,已加载默认值,编辑后请保存', 'success');
    }
    currentApiKey = key;
@@ -243,6 +244,7 @@
    byId('maxPositionPerSide').value = d.maxPositionPerSide ?? 0;
    byId('addPositionStartThreshold').value = d.addPositionStartThreshold ?? 1;
    byId('placeExcessTakeProfit').value = (d.placeExcessTakeProfit === true || d.placeExcessTakeProfit === 'true') ? 'true' : 'false';
    byId('originalPositionReduce').value = d.originalPositionReduce ?? 0;
    byId('dualStopLossEnabled').value = (d.dualStopLossEnabled === true || d.dualStopLossEnabled === 'true') ? 'true' : 'false';
    byId('longStopLossPrice').value = d.longStopLossPrice || '';
    byId('shortStopLossPrice').value = d.shortStopLossPrice || '';
@@ -267,6 +269,7 @@
        maxPositionPerSide: intVal(byId('maxPositionPerSide').value, 0),
        addPositionStartThreshold: intVal(byId('addPositionStartThreshold').value, 1),
        placeExcessTakeProfit: byId('placeExcessTakeProfit').value === 'true',
        originalPositionReduce: intVal(byId('originalPositionReduce').value, 0),
        dualStopLossEnabled: byId('dualStopLossEnabled').value === 'true',
        longStopLossPrice: byId('longStopLossPrice').value,
        shortStopLossPrice: byId('shortStopLossPrice').value