Commit 79e7179b authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent 3a89ebe7
let _=require('lodash') let _=require('lodash')
let arr=[2,3,5,1,2,2] let arr=[2,3,5,1,2,2]
let t='last.json-220217123102_O1_BNC_ETHUSDT_Lp919_1ETH8.csv'
console.log(_.orderBy(arr)) console.log(t.split('-'))
\ No newline at end of file \ No newline at end of file
...@@ -28,6 +28,7 @@ async function run() { ...@@ -28,6 +28,7 @@ async function run() {
total.push(config[j].total) total.push(config[j].total)
let dateString = config[j].dateString.split('_') let dateString = config[j].dateString.split('_')
let runUpString = config[j].runupString.split('_') let runUpString = config[j].runupString.split('_')
let platfrom=config[j].platform.split('-')[1]
let arrDate = [] let arrDate = []
for (let z = 0; z < dateString.length - 1; z++) for (let z = 0; z < dateString.length - 1; z++)
...@@ -52,6 +53,7 @@ async function run() { ...@@ -52,6 +53,7 @@ async function run() {
addShortLong(config[j].total, countOfshort, countOfLong) addShortLong(config[j].total, countOfshort, countOfLong)
addPoftrade(config[j].total, config[j].pftrade) addPoftrade(config[j].total, config[j].pftrade)
addRunup(config[j].total, arrRunup[0],arrRunup[arrRunup.length-1]) addRunup(config[j].total, arrRunup[0],arrRunup[arrRunup.length-1])
addPlatform(config[j].total,platfrom)
} }
...@@ -103,6 +105,15 @@ async function run() { ...@@ -103,6 +105,15 @@ async function run() {
} }
} }
for (let i = 0; i < adder.length; i++) {
for (let z = i + 1; z < adder.length; z++) {
let platfrom = adder[z].platfrom
for (let l = 0; l < platfrom.length; l++)
addPlatform(adder[i].total, platfrom[l])
}
}
var endTime = performance.now() var endTime = performance.now()
console.log(`Call to doSomething took ${endTime - startTime} milliseconds`) console.log(`Call to doSomething took ${endTime - startTime} milliseconds`)
...@@ -116,7 +127,10 @@ async function run() { ...@@ -116,7 +127,10 @@ async function run() {
adder[i].type = _.uniq(adder[i].type) adder[i].type = _.uniq(adder[i].type)
adder[i].type = _.orderBy(adder[i].type) adder[i].type = _.orderBy(adder[i].type)
adder[i].countOfType=adder[i].type.length adder[i].countOfType=adder[i].type.length
adder[i].platfrom = _.uniq(adder[i].platfrom)
adder[i].countOfPlatform=adder[i].platfrom.length
delete adder[i].platfrom
adder[i].pfTrade = _.orderBy(adder[i].pfTrade) adder[i].pfTrade = _.orderBy(adder[i].pfTrade)
let temp=[] let temp=[]
...@@ -183,7 +197,7 @@ function add(total, dates, type) { ...@@ -183,7 +197,7 @@ function add(total, dates, type) {
if (found) if (found)
return return
adder.push({total: total, dates: dates, countDay: dates.length, type: [type], pfTrade: [],short:0,long:0,minRunup:100,maxRunup:0}) adder.push({total: total, dates: dates, countDay: dates.length, type: [type], pfTrade: [],short:0,long:0,minRunup:100,maxRunup:0,platfrom:[]})
} }
...@@ -206,6 +220,15 @@ function addPoftrade(total, pfTrade) { ...@@ -206,6 +220,15 @@ function addPoftrade(total, pfTrade) {
} }
} }
function addPlatform(total, platform) {
for (let i = 0; i < adder.length; i++)
if (adder[i].total === total) {
adder[i].platfrom.push(platform)
}
}
function addRunup(total, minRunup,maxRunup) { function addRunup(total, minRunup,maxRunup) {
for (let i = 0; i < adder.length; i++) for (let i = 0; i < adder.length; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment