修复gate盈亏比
This commit is contained in:
@@ -1865,17 +1865,19 @@ if(addOrderForm){
|
||||
}
|
||||
const sl = Number((document.getElementById("order-sl")||{}).value);
|
||||
const tp = Number((document.getElementById("order-tp")||{}).value);
|
||||
let entry = sl;
|
||||
if(!symbol){
|
||||
if(rejectManualOrderRr(calcClientRr(direction, entry, sl, tp))) return;
|
||||
allowManualOrderSubmit(addOrderForm);
|
||||
alert("请先填写币种,以便按市价校验盈亏比");
|
||||
return;
|
||||
}
|
||||
fetch(`/api/order_defaults?symbol=${encodeURIComponent(symbol)}&direction=${encodeURIComponent(direction)}`)
|
||||
.then(r=>r.json())
|
||||
.then(data=>{
|
||||
const px = data.last_price || data.price;
|
||||
if(px) entry = Number(px);
|
||||
const px = data.last_price ?? data.price;
|
||||
const entry = Number(px);
|
||||
if(!Number.isFinite(entry) || entry <= 0){
|
||||
alert("无法获取市价,请稍后重试");
|
||||
return;
|
||||
}
|
||||
if(rejectManualOrderRr(calcClientRr(direction, entry, sl, tp))) return;
|
||||
allowManualOrderSubmit(addOrderForm);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user