|
|
|
@ -464,6 +464,7 @@ export default { |
|
|
|
clearInterval(this._time); |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
console.log(this.holdPositionList); |
|
|
|
if (this.symbol) { |
|
|
|
this.contractAccount(); |
|
|
|
|
|
|
|
@ -663,14 +664,45 @@ export default { |
|
|
|
data.amount = this.sellform.amount; |
|
|
|
data.checkbox = this.checkboxSell; |
|
|
|
} |
|
|
|
Contract.openPosition(data).then(() => { |
|
|
|
this.contractAccount(); |
|
|
|
this.buyform.amount = 0; |
|
|
|
this.sellform.amount = 0; |
|
|
|
this.$message.success(this.$t("contract.f5")); |
|
|
|
this.$emit("position"); |
|
|
|
}); |
|
|
|
|
|
|
|
if(side==1&&this.checkboxBuy){ |
|
|
|
data.tp_trigger_price = this.buyform.pri1; |
|
|
|
data.sl_trigger_price = this.buyform.pri2; |
|
|
|
// let datas = {tp_trigger_price:this.buyform.pri1,sl_trigger_price:this.buyform.pri2,position_side:side,symbol: this.symbol} |
|
|
|
// this.stoploss(datas,data) |
|
|
|
}else{ |
|
|
|
data.tp_trigger_price = this.sellform.pri1; |
|
|
|
data.sl_trigger_price = this.sellform.pri2; |
|
|
|
// let datas1 = {tp_trigger_price:this.sellform.pri1,sl_trigger_price:this.sellform.pri2,position_side:side,symbol: this.symbol} |
|
|
|
// this.stoploss(datas1,data) |
|
|
|
} |
|
|
|
Contract.openPosition(data).then(() => { |
|
|
|
if(side==1&&this.checkboxBuy){ |
|
|
|
this.buyform.pri1 = ""; |
|
|
|
this.buyform.pri2 = "" |
|
|
|
}else{ |
|
|
|
this.sellform.pri1 = "" |
|
|
|
this.sellform.pri2 = "" |
|
|
|
} |
|
|
|
this.contractAccount(); |
|
|
|
this.buyform.amount = 0; |
|
|
|
this.sellform.amount = 0; |
|
|
|
this.$message.success(this.$t("contract.f5")); |
|
|
|
this.$emit("position"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// stoploss(val,data){ |
|
|
|
// Contract.setStrategy(val).then((res) => { |
|
|
|
// if(val.position_side==1&&this.checkboxBuy){ |
|
|
|
// this.buyform.pri1 = ""; |
|
|
|
// this.buyform.pri2 = "" |
|
|
|
// }else{ |
|
|
|
// this.sellform.pri1 = "" |
|
|
|
// this.sellform.pri2 = "" |
|
|
|
// } |
|
|
|
// // this.$message.success(this.$t("contract.k0")); |
|
|
|
// }); |
|
|
|
// }, |
|
|
|
// 平仓-买卖分表单后未处理平仓的表单数据 |
|
|
|
closePosition(side) { |
|
|
|
let data = { |
|
|
|
|