Commit 32fd810f authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent d7f2b2c5
...@@ -20,7 +20,7 @@ run() ...@@ -20,7 +20,7 @@ run()
async function run() async function run()
{ {
let obj={sort:'profitPerMonth',alocatedReserve:2} let obj={sort:'profitPerMonth',alocatedReserve:2,alocatedReserveCompound:3}
let all=[] let all=[]
for (let i=0;i<arr.length;i++) for (let i=0;i<arr.length;i++)
all.push(add(arr[i])) all.push(add(arr[i]))
......
...@@ -34,9 +34,11 @@ async function run() { ...@@ -34,9 +34,11 @@ async function run() {
arr2 = _.orderBy(arr2, [configs.sort], ['desc']); arr2 = _.orderBy(arr2, [configs.sort], ['desc']);
let arr20Max=[] let arr20Max=[]
let arr1000Compound=[] let arr1000Compound=[]
let arrReserv=_.orderBy(arr2, ['percentage'], ['asc']); let arrReserv=_.orderBy(arr2, ['percentage'], ['asc']);
let arrCompound=_.orderBy(arr2, ['compoundPerMonth'], ['desc']); let arrCompound=_.orderBy(arr2, ['compoundPerMonth'], ['desc']);
let arrResrv200=[] let arrResrv200=[]
let arrReservCompound=[]
for (let i = 0; i < 1000; i++) { for (let i = 0; i < 1000; i++) {
arr3.push(arr2[i]) arr3.push(arr2[i])
arrResrv200.push(arrReserv[i]) arrResrv200.push(arrReserv[i])
...@@ -50,6 +52,13 @@ async function run() { ...@@ -50,6 +52,13 @@ async function run() {
arr20Max.push(arr3[i]) arr20Max.push(arr3[i])
} }
for (let i=0;i<arrCompound.length;i++)
{
if (arrCompound[i].allocatedReserve < configs.alocatedReserveCompound)
arrReservCompound.push(arrCompound[i])
}
// for (let i=0;i<files.length;i++) // for (let i=0;i<files.length;i++)
...@@ -58,7 +67,8 @@ async function run() { ...@@ -58,7 +67,8 @@ async function run() {
// createfileADV('percentage',JSON.stringify(arrReserv, null, 2)) // createfileADV('percentage',JSON.stringify(arrReserv, null, 2))
createfileADV('percentage1000',JSON.stringify(arrResrv200, null, 2)) createfileADV('percentage1000',JSON.stringify(arrResrv200, null, 2))
createfileADV('compound1000',JSON.stringify(arr1000Compound, null, 2)) createfileADV('compound1000',JSON.stringify(arr1000Compound, null, 2))
createfileADV('allocatedReserve',JSON.stringify(arr20Max, null, 2)) createfileADV('allocatedReservePerMonthUnder'+configs.alocatedReserve,JSON.stringify(arr20Max, null, 2))
createfileADV('allocatedReserveCompoundUnder'+configs.alocatedReserveCompound,JSON.stringify(arrReservCompound, null, 2))
// console.log(perf.stop()) // console.log(perf.stop())
console.log('Done') console.log('Done')
// process.exit(0) // process.exit(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