Commit 684893b0 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent e64bc2ec
......@@ -8,8 +8,10 @@ let alocatedReserveCompound = 3
run('profitPerMonth1000')
run('percentage1000')
run('compound1000')
run('allocatedReservePerMonthUnder')
run('allocatedReserveCompoundUnder')
run('allocatedReservePerMonthUnder3')
run('allocatedReserveCompoundUnder3')
run('allocatedReservePerMonthUnder2')
run('allocatedReserveCompoundUnder2')
async function run(name) {
let directory = await fs.readdirSync('result')
......@@ -30,16 +32,16 @@ async function run(name) {
}
if (name === 'profitPerMonth1000' || name === 'allocatedReservePerMonthUnder')
if (name === 'profitPerMonth1000' || name === 'allocatedReservePerMonthUnder3' || name === 'allocatedReservePerMonthUnder2')
last = _.orderBy(arr2, ['profitPerMonth'], ['desc']);
if (name === 'percentage1000')
last = _.orderBy(arr2, ['percentage'], ['asc']);
if (name === 'compound1000' || name === 'allocatedReserveCompoundUnder')
if (name === 'compound1000' || name === 'allocatedReserveCompoundUnder3' || name === 'allocatedReserveCompoundUnder2')
last = _.orderBy(arr2, ['compoundPerMonth'], ['desc']);
if (name === 'allocatedReservePerMonthUnder') {
if (name === 'allocatedReservePerMonthUnder2' || name === 'allocatedReservePerMonthUnder3') {
let arr20Max = []
for (let i = 0; i < last.length; i++) {
......@@ -51,7 +53,7 @@ async function run(name) {
last = arr20Max
}
if (name === 'allocatedReserveCompoundUnder') {
if (name === 'allocatedReserveCompoundUnder2' || name === 'allocatedReserveCompoundUnder3') {
let arr20Max = []
for (let i = 0; i < last.length; i++) {
......
......@@ -75,8 +75,28 @@ async function run() {
createfileADV('profitPerMonth1000', JSON.stringify(arr3, null, 2))
createfileADV('percentage1000', JSON.stringify(arrResrv200, null, 2))
createfileADV('compound1000', JSON.stringify(arr1000Compound, null, 2))
createfileADV('allocatedReservePerMonthUnder', JSON.stringify(arr20Max, null, 2))
createfileADV('allocatedReserveCompoundUnder' , JSON.stringify(arrReservCompound, null, 2))
createfileADV('allocatedReservePerMonthUnder3', JSON.stringify(arr20Max, null, 2))
createfileADV('allocatedReserveCompoundUnder3' , JSON.stringify(arrReservCompound, null, 2))
arr20Max=[]
for (let i = 0; i < arr2.length; i++) {
if (arr2[i].allocatedReserve < 2)
arr20Max.push(arr2[i])
}
arrCompound=[]
for (let i = 0; i < arrCompound.length; i++) {
if (arrCompound[i].allocatedReserve < 2)
arrReservCompound.push(arrCompound[i])
}
createfileADV('allocatedReservePerMonthUnder2', JSON.stringify(arr20Max, null, 2))
createfileADV('allocatedReserveCompoundUnder2' , JSON.stringify(arrReservCompound, null, 2))
console.log('Done')
await makeStatus(directory, '0')
......
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