Commit cf146b92 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 3edddcac
......@@ -34,6 +34,8 @@ async function work() {
}
run('profitPerMonth1000', arr, timestamp)
// run('percentage1000', arr, timestamp)
run('compound1000', arr, timestamp)
run('profitPerMonth1000Start', arr, timestamp)
......@@ -62,8 +64,10 @@ async function run(name, directory, timestamp) {
arrFinal = await Promise.all(arrFinal)
for (let i = 0; i < arrFinal.length; i++) {
let inline = arrFinal[i]
console.log(inline)
for (let z = 0; z < inline.length; z++)
......@@ -71,6 +75,9 @@ async function run(name, directory, timestamp) {
}
// console.log(arr2)
if (name === 'profitPerMonth1000' || name === 'allocatedReservePerMonthUnder3' || name === 'allocatedReservePerMonthUnder2' || name === 'profitPerMonth1000Start')
last = _.orderBy(arr2, ['profitPerMonthDrawDown'], ['desc']);
......@@ -80,6 +87,8 @@ async function run(name, directory, timestamp) {
if (name === 'compound1000' || name === 'allocatedReserveCompoundUnder3' || name === 'allocatedReserveCompoundUnder2' || name === 'compound1000Start')
last = _.orderBy(arr2, ['CompoundPerMonthDrawDown'], ['desc']);
// if (name === 'allocatedReservePerMonthUnder2' || name === 'allocatedReservePerMonthUnder3') {
// let arr20Max = []
// for (let i = 0; i < last.length; i++) {
......@@ -128,25 +137,16 @@ async function readFile(name, directory) {
let sortByProfit = []
let file = await fs.readFileSync('./result/' + directory + '/' + name + '.json', 'utf8')
file = JSON.parse(file)
// file = _.orderBy(file, sort, ['desc']);
for (let j = 0; j < file.length; j++) {
sortByProfit.push(file[j])
}
// let sortByPercentage = []
// file = _.orderBy(file, ['percentage'], ['asc']);
// for (let j = 0; j < file.length; j++) {
//
// sortByPercentage.push(file[j])
// }
//
// let sortByCompound = []
// file =_.orderBy(file, ['compoundPerMonth'], ['desc']);
// for (let j = 0; j < file.length; j++) {
//
// sortByCompound.push(file[j])
// }
return file
}
......
......@@ -148,8 +148,11 @@ async function startAgain(arr,start){
let arrResrv200 = []
let arrReservCompound = []
for (let i = 0; i < 1000; i++) {
if(typeof arr2[i] !=="undefined")
arr3.push(arr2[i])
if(typeof arrReserv[i] !=="undefined")
arrResrv200.push(arrReserv[i])
if(typeof arrCompound[i] !=="undefined")
arr1000Compound.push(arrCompound[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