From 542ad88c0d24e2f4c5fac22193057be163c9d3bc Mon Sep 17 00:00:00 2001 From: lizhixin <382352532@qq.com> Date: Sat, 12 Jun 2021 02:00:09 +0800 Subject: [PATCH] =?UTF-8?q?N=E5=8F=82=E6=95=B0=E4=BF=AE=E6=94=B9/=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ReCheck/AccountInfo.vue | 2 +- src/pages/ReCheck/index.vue | 210 +++++++++++++++--------------- src/pages/prePages/js/columns.js | 6 + 3 files changed, 112 insertions(+), 106 deletions(-) diff --git a/src/pages/ReCheck/AccountInfo.vue b/src/pages/ReCheck/AccountInfo.vue index f55dd49..df4e5a7 100644 --- a/src/pages/ReCheck/AccountInfo.vue +++ b/src/pages/ReCheck/AccountInfo.vue @@ -79,7 +79,7 @@ }}%)

-

实际运营成本: {{ accountInfo.RealCost }}

+

历史周转资金: {{ accountInfo.RealCost }}

持仓成本: {{ accountInfo.TotalPurchasePrice }}

波段盈亏 :{{ accountInfo.HistoryProfit }}

币本位盈亏: {{ accountInfo.BBWProfit }}

diff --git a/src/pages/ReCheck/index.vue b/src/pages/ReCheck/index.vue index 5178005..efd0040 100644 --- a/src/pages/ReCheck/index.vue +++ b/src/pages/ReCheck/index.vue @@ -496,7 +496,7 @@ export default { for (let i = 0; i < data.length; i++) { if (i == 0) continue; let subArray = []; - let postObj = { N: null }; + let postObj = { N: [] }; for (let j = 0; j < data[i].length; j++) { if (j == 0) { if ( @@ -550,7 +550,7 @@ export default { data[i][j] != "NaN" && data[i][j] != NaN ) - postObj.N = 10; + postObj.N.push(10); } else if (j == 9) { if ( data[i][j] != 0 && @@ -558,15 +558,15 @@ export default { data[i][j] != "NaN" && data[i][j] != NaN ) - postObj.N = 11; + postObj.N.push(11); } else if (j == 10) { - if (data[i][j] != 0) postObj.N = 2; + if (data[i][j] != 0) postObj.N.push(2); } else if (j == 12) { - if (data[i][j] != 0) postObj.N = 3; + if (data[i][j] != 0) postObj.N.push(3); } else if (j == 15) { subArray[6] = {}; if (data[i][j] != 0) { - postObj.N = 1; + postObj.N.push(1); subArray[6] = { name: "卖出Point", symbol: "diamond", @@ -587,7 +587,7 @@ export default { } else if (j == 14) { subArray[5] = {}; if (data[i][j] != 0) { - postObj.N = 0; + postObj.N.push(0); subArray[5] = { name: "买入Point", coord: [ @@ -612,105 +612,105 @@ export default { }, //订底回测数据处理 - topMutateData(data) { - let result = []; - let postResult = []; - if (data.length > 1) { - for (let i = 0; i < data.length; i++) { - if (i == 0) continue; - let subArray = []; - let postObj = { N: null }; - for (let j = 0; j < data[i].length; j++) { - if (j == 0) { - if ( - this.startTime && - this.endTime && - !moment(data[i][j] * 1000).isBetween( - this.startTime.startOf("day"), - this.endTime.endOf("day") - ) - ) { - break; - } else if ( - this.startTime && - !moment(data[i][j] * 1000).isAfter( - this.startTime.startOf("day") - ) - ) { - break; - } + // topMutateData(data) { + // let result = []; + // let postResult = []; + // if (data.length > 1) { + // for (let i = 0; i < data.length; i++) { + // if (i == 0) continue; + // let subArray = []; + // let postObj = { N: null }; + // for (let j = 0; j < data[i].length; j++) { + // if (j == 0) { + // if ( + // this.startTime && + // this.endTime && + // !moment(data[i][j] * 1000).isBetween( + // this.startTime.startOf("day"), + // this.endTime.endOf("day") + // ) + // ) { + // break; + // } else if ( + // this.startTime && + // !moment(data[i][j] * 1000).isAfter( + // this.startTime.startOf("day") + // ) + // ) { + // break; + // } - subArray[0] = moment(data[i][j] * 1000).format( - "YYYY-MM-DD HH:mm:ss" - ); - postObj.T = data[i][j]; - } else if (j == 1) { - //open - subArray[1] = data[i][j]; - postObj.OpenPrice = data[i][j]; - } else if (j == 2) { - //highest - subArray[4] = data[i][j]; - postObj.H = data[i][j]; - } else if (j == 3) { - //lowest - subArray[3] = data[i][j]; - postObj.L = data[i][j]; - } else if (j == 4) { - //close - subArray[2] = data[i][j]; - postObj.C = data[i][j]; - } else if (j == 5) { - postObj.TP = data[i][j]; - } else if (j == 6) { - if (data[i][j] != 0) postObj.N = 3; - } else if (j == 7) { - subArray[5] = {}; - if (data[i][j] && data[i][j] != 0) { - postObj.N = 1; - subArray[5] = { - name: "买入Point", - coord: [ - `${moment(data[i][0] * 1000).format( - "YYYY-MM-DD HH:mm:ss" - )}`, - data[i][3] - ], - value: data[i][j], - itemStyle: { - color: "rgb(23,160,93)" - } - }; - } - } else if (j == 8) { - subArray[6] = {}; - if (data[i][j] && data[i][j] != 0) { - postObj.N = 0; - subArray[6] = { - name: "卖出Point", - symbol: "diamond", - symbolSize: [15, 25], - symbolOffset: [0, 25], - coord: [ - `${moment(data[i][0] * 1000).format( - "YYYY-MM-DD HH:mm:ss" - )}`, - data[i][2] - ], - value: data[i][j], - itemStyle: { - color: "rgb(221,82,70)" - } - }; - } - } - } - if (subArray.length > 0) result.push(subArray); - if (postObj.T != null) postResult.push(postObj); - } - } - return { kLineData: result, postData: postResult }; - }, + // subArray[0] = moment(data[i][j] * 1000).format( + // "YYYY-MM-DD HH:mm:ss" + // ); + // postObj.T = data[i][j]; + // } else if (j == 1) { + // //open + // subArray[1] = data[i][j]; + // postObj.OpenPrice = data[i][j]; + // } else if (j == 2) { + // //highest + // subArray[4] = data[i][j]; + // postObj.H = data[i][j]; + // } else if (j == 3) { + // //lowest + // subArray[3] = data[i][j]; + // postObj.L = data[i][j]; + // } else if (j == 4) { + // //close + // subArray[2] = data[i][j]; + // postObj.C = data[i][j]; + // } else if (j == 5) { + // postObj.TP = data[i][j]; + // } else if (j == 6) { + // if (data[i][j] != 0) postObj.N = 3; + // } else if (j == 7) { + // subArray[5] = {}; + // if (data[i][j] && data[i][j] != 0) { + // postObj.N = 1; + // subArray[5] = { + // name: "买入Point", + // coord: [ + // `${moment(data[i][0] * 1000).format( + // "YYYY-MM-DD HH:mm:ss" + // )}`, + // data[i][3] + // ], + // value: data[i][j], + // itemStyle: { + // color: "rgb(23,160,93)" + // } + // }; + // } + // } else if (j == 8) { + // subArray[6] = {}; + // if (data[i][j] && data[i][j] != 0) { + // postObj.N = 0; + // subArray[6] = { + // name: "卖出Point", + // symbol: "diamond", + // symbolSize: [15, 25], + // symbolOffset: [0, 25], + // coord: [ + // `${moment(data[i][0] * 1000).format( + // "YYYY-MM-DD HH:mm:ss" + // )}`, + // data[i][2] + // ], + // value: data[i][j], + // itemStyle: { + // color: "rgb(221,82,70)" + // } + // }; + // } + // } + // } + // if (subArray.length > 0) result.push(subArray); + // if (postObj.T != null) postResult.push(postObj); + // } + // } + // return { kLineData: result, postData: postResult }; + // }, test() { if (this.policyMode == 0) this.executeTest(); diff --git a/src/pages/prePages/js/columns.js b/src/pages/prePages/js/columns.js index 0c0a76f..7865b3a 100644 --- a/src/pages/prePages/js/columns.js +++ b/src/pages/prePages/js/columns.js @@ -184,6 +184,12 @@ export const tradeColumns = [ key: "Count", customSlot: "Count" }, + { + name: "历史周转资金", + prop: "HistoryRealCost", + key: "HistoryRealCost" + // customSlot: "HistoryRealCost" + }, { name: "最大浮亏", prop: "MaxLossRatio",