fix: remove inline estimated TP preview from fixed RR order form
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -411,7 +411,6 @@
|
||||
<span class="symbol-live-price-note">下单成交价以交易所成交回报为准</span>
|
||||
<input id="order-sl" name="sl" step="any" placeholder="止损价格" required>
|
||||
<input id="order-fixed-rr" name="fixed_rr" type="number" min="0.01" step="0.01" placeholder="盈亏比(默认1.5)" value="1.5" title="止盈距离=止损距离×盈亏比">
|
||||
<span id="order-tp-preview" style="display:none;font-size:.8rem;color:#8fc8ff;align-self:center">预估止盈:—</span>
|
||||
<input id="order-tp" name="tgt" step="any" placeholder="止盈价格" style="display:none">
|
||||
<input id="order-sl-pct" name="sl_pct" type="number" min="0.01" step="0.01" placeholder="止损%" style="display:none">
|
||||
<input id="order-tp-pct" name="tp_pct" type="number" min="0.01" step="0.01" placeholder="止盈%" style="display:none">
|
||||
@@ -1501,20 +1500,6 @@ function calcTpFromFixedRr(direction, entry, sl, rr){
|
||||
return e + (e - s) * r;
|
||||
}
|
||||
function refreshOrderTpPreview(entryPx){
|
||||
const mode = (document.getElementById("sltp-mode")||{}).value || "fixed_rr";
|
||||
const preview = document.getElementById("order-tp-preview");
|
||||
if(!preview) return;
|
||||
if(mode !== "fixed_rr"){
|
||||
preview.style.display = "none";
|
||||
return;
|
||||
}
|
||||
preview.style.display = "";
|
||||
const direction = (document.getElementById("order-direction")||{}).value || "long";
|
||||
const sl = Number((document.getElementById("order-sl")||{}).value);
|
||||
const rr = Number((document.getElementById("order-fixed-rr")||{}).value) || MANUAL_FIXED_RR_DEFAULT;
|
||||
const entry = entryPx != null && Number.isFinite(Number(entryPx)) ? Number(entryPx) : sl;
|
||||
const tp = calcTpFromFixedRr(direction, entry, sl, rr);
|
||||
preview.textContent = tp == null ? "预估止盈:—" : ("预估止盈:" + formatPriceForInput(tp));
|
||||
if(window.ManualOrderRrPreview) ManualOrderRrPreview.schedule();
|
||||
}
|
||||
function calcClientRr(direction, entry, sl, tp){
|
||||
|
||||
@@ -390,7 +390,6 @@
|
||||
<span class="symbol-live-price-note">下单成交价以交易所成交回报为准</span>
|
||||
<input id="order-sl" name="sl" step="any" placeholder="止损价格" required>
|
||||
<input id="order-fixed-rr" name="fixed_rr" type="number" min="0.01" step="0.01" placeholder="盈亏比(默认1.5)" value="1.5" title="止盈距离=止损距离×盈亏比">
|
||||
<span id="order-tp-preview" style="display:none;font-size:.8rem;color:#8fc8ff;align-self:center">预估止盈:—</span>
|
||||
<input id="order-tp" name="tgt" step="any" placeholder="止盈价格" style="display:none">
|
||||
<input id="order-sl-pct" name="sl_pct" type="number" min="0.01" step="0.01" placeholder="止损%" style="display:none">
|
||||
<input id="order-tp-pct" name="tp_pct" type="number" min="0.01" step="0.01" placeholder="止盈%" style="display:none">
|
||||
@@ -1467,20 +1466,6 @@ function calcTpFromFixedRr(direction, entry, sl, rr){
|
||||
return e + (e - s) * r;
|
||||
}
|
||||
function refreshOrderTpPreview(entryPx){
|
||||
const mode = (document.getElementById("sltp-mode")||{}).value || "fixed_rr";
|
||||
const preview = document.getElementById("order-tp-preview");
|
||||
if(!preview) return;
|
||||
if(mode !== "fixed_rr"){
|
||||
preview.style.display = "none";
|
||||
return;
|
||||
}
|
||||
preview.style.display = "";
|
||||
const direction = (document.getElementById("order-direction")||{}).value || "long";
|
||||
const sl = Number((document.getElementById("order-sl")||{}).value);
|
||||
const rr = Number((document.getElementById("order-fixed-rr")||{}).value) || MANUAL_FIXED_RR_DEFAULT;
|
||||
const entry = entryPx != null && Number.isFinite(Number(entryPx)) ? Number(entryPx) : sl;
|
||||
const tp = calcTpFromFixedRr(direction, entry, sl, rr);
|
||||
preview.textContent = tp == null ? "预估止盈:—" : ("预估止盈:" + formatPriceForInput(tp));
|
||||
if(window.ManualOrderRrPreview) ManualOrderRrPreview.schedule();
|
||||
}
|
||||
function calcClientRr(direction, entry, sl, tp){
|
||||
|
||||
@@ -419,7 +419,6 @@
|
||||
<span class="symbol-live-price-note">下单成交价以交易所成交回报为准</span>
|
||||
<input id="order-sl" name="sl" step="any" placeholder="止损价格" required>
|
||||
<input id="order-fixed-rr" name="fixed_rr" type="number" min="0.01" step="0.01" placeholder="盈亏比(默认1.5)" value="1.5" title="止盈距离=止损距离×盈亏比">
|
||||
<span id="order-tp-preview" style="display:none;font-size:.8rem;color:#8fc8ff;align-self:center">预估止盈:—</span>
|
||||
<input id="order-tp" name="tgt" step="any" placeholder="止盈价格" style="display:none">
|
||||
<input id="order-sl-pct" name="sl_pct" type="number" min="0.01" step="0.01" placeholder="止损%" style="display:none">
|
||||
<input id="order-tp-pct" name="tp_pct" type="number" min="0.01" step="0.01" placeholder="止盈%" style="display:none">
|
||||
@@ -1496,20 +1495,6 @@ function calcTpFromFixedRr(direction, entry, sl, rr){
|
||||
return e + (e - s) * r;
|
||||
}
|
||||
function refreshOrderTpPreview(entryPx){
|
||||
const mode = (document.getElementById("sltp-mode")||{}).value || "fixed_rr";
|
||||
const preview = document.getElementById("order-tp-preview");
|
||||
if(!preview) return;
|
||||
if(mode !== "fixed_rr"){
|
||||
preview.style.display = "none";
|
||||
return;
|
||||
}
|
||||
preview.style.display = "";
|
||||
const direction = (document.getElementById("order-direction")||{}).value || "long";
|
||||
const sl = Number((document.getElementById("order-sl")||{}).value);
|
||||
const rr = Number((document.getElementById("order-fixed-rr")||{}).value) || MANUAL_FIXED_RR_DEFAULT;
|
||||
const entry = entryPx != null && Number.isFinite(Number(entryPx)) ? Number(entryPx) : sl;
|
||||
const tp = calcTpFromFixedRr(direction, entry, sl, rr);
|
||||
preview.textContent = tp == null ? "预估止盈:—" : ("预估止盈:" + formatPriceForInput(tp));
|
||||
if(window.ManualOrderRrPreview) ManualOrderRrPreview.schedule();
|
||||
}
|
||||
function calcClientRr(direction, entry, sl, tp){
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
- **价格模式**:填完币种、方向、止损价、止盈价后,调用 `GET /api/order_defaults` 取标记价,按几何距离计算 RR。
|
||||
- **百分比模式**:填完币种、方向、止损%、止盈% 后拉快照校验币种,再显示 RR(`止盈% / 止损%`)。
|
||||
- **固定盈亏比模式**:不显示预估盈亏比(盈亏比由输入框直接指定;仍保留原有「预估止盈」)。
|
||||
- **固定盈亏比模式**:盈亏比由输入框直接指定;下方预览条显示预估风险/盈利/盈亏比(不再在表单行内显示预估止盈价)。
|
||||
|
||||
- **以损定仓**(`POSITION_SIZING_MODE=risk`):预估风险 = 当前交易基数 × `risk%`。
|
||||
- **全仓杠杆**(`full_margin`):预估风险 = 合约可用 × 缓冲比例 × 杠杆(BTC/ETH 与山寨按 `.env` 配置)× 止损距离比例,与开仓时 `calc_risk_amount_from_plan` 一致。
|
||||
|
||||
@@ -766,20 +766,6 @@ function calcTpFromFixedRr(direction, entry, sl, rr){
|
||||
return e + (e - s) * r;
|
||||
}
|
||||
function refreshOrderTpPreview(entryPx){
|
||||
const mode = (document.getElementById("sltp-mode")||{}).value || "fixed_rr";
|
||||
const preview = document.getElementById("order-tp-preview");
|
||||
if(!preview) return;
|
||||
if(mode !== "fixed_rr"){
|
||||
preview.style.display = "none";
|
||||
return;
|
||||
}
|
||||
preview.style.display = "";
|
||||
const direction = (document.getElementById("order-direction")||{}).value || "long";
|
||||
const sl = Number((document.getElementById("order-sl")||{}).value);
|
||||
const rr = Number((document.getElementById("order-fixed-rr")||{}).value) || MANUAL_FIXED_RR_DEFAULT;
|
||||
const entry = entryPx != null && Number.isFinite(Number(entryPx)) ? Number(entryPx) : sl;
|
||||
const tp = calcTpFromFixedRr(direction, entry, sl, rr);
|
||||
preview.textContent = tp == null ? "预估止盈:—" : ("预估止盈:" + formatPriceForInput(tp));
|
||||
if(window.ManualOrderRrPreview) ManualOrderRrPreview.schedule();
|
||||
}
|
||||
function calcClientRr(direction, entry, sl, tp){
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
<span class="symbol-live-price-note">下单成交价以交易所成交回报为准</span>
|
||||
<input id="order-sl" name="sl" step="any" placeholder="止损价格" required>
|
||||
<input id="order-fixed-rr" name="fixed_rr" type="number" min="0.01" step="0.01" placeholder="盈亏比(默认1.5)" value="1.5" title="止盈距离=止损距离×盈亏比">
|
||||
<span id="order-tp-preview" style="display:none;font-size:.8rem;color:#8fc8ff;align-self:center">预估止盈:—</span>
|
||||
<input id="order-tp" name="tgt" step="any" placeholder="止盈价格" style="display:none">
|
||||
<input id="order-sl-pct" name="sl_pct" type="number" min="0.01" step="0.01" placeholder="止损%" style="display:none">
|
||||
<input id="order-tp-pct" name="tp_pct" type="number" min="0.01" step="0.01" placeholder="止盈%" style="display:none">
|
||||
|
||||
Reference in New Issue
Block a user