Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
forex
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
forex
Commits
7d7c306d
Commit
7d7c306d
authored
Nov 01, 2021
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
aa55d60d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
0 deletions
+79
-0
result.bat
result.bat
+1
-0
result.js
result.js
+78
-0
No files found.
result.bat
0 → 100644
View file @
7d7c306d
node --max-old-space-size=4096 result.js
\ No newline at end of file
result.js
0 → 100644
View file @
7d7c306d
let
fs
=
require
(
'
fs
'
)
let
_
=
require
(
'
lodash
'
)
let
sort
=
'
profitPerMonth
'
let
alocatedReserve
=
2
let
alocatedReserveCompound
=
3
run
()
async
function
run
()
{
let
directory
=
await
fs
.
readdirSync
(
'
result
'
)
let
arr2
=
[]
let
arr3
=
[]
for
(
let
i
=
0
;
i
<
directory
.
length
;
i
++
)
{
let
file
=
await
fs
.
readFileSync
(
'
./result/
'
+
directory
[
i
]
+
'
/allDataSortedByProfit.json
'
,
'
utf8
'
)
file
=
JSON
.
parse
(
file
)
for
(
let
j
=
0
;
j
<
file
.
length
;
j
++
)
arr2
.
push
(
file
[
j
])
}
arr2
=
_
.
orderBy
(
arr2
,
sort
,
[
'
desc
'
]);
let
arr20Max
=
[]
let
arr1000Compound
=
[]
let
arrReserv
=
_
.
orderBy
(
arr2
,
[
'
percentage
'
],
[
'
asc
'
]);
let
arrCompound
=
_
.
orderBy
(
arr2
,
[
'
compoundPerMonth
'
],
[
'
desc
'
]);
let
arrResrv200
=
[]
let
arrReservCompound
=
[]
for
(
let
i
=
0
;
i
<
1000
;
i
++
)
{
arr3
.
push
(
arr2
[
i
])
arrResrv200
.
push
(
arrReserv
[
i
])
arr1000Compound
.
push
(
arrCompound
[
i
])
}
for
(
let
i
=
0
;
i
<
arr3
.
length
;
i
++
)
{
if
(
arr3
[
i
].
allocatedReserve
<
alocatedReserve
)
arr20Max
.
push
(
arr3
[
i
])
}
for
(
let
i
=
0
;
i
<
arrCompound
.
length
;
i
++
)
{
if
(
arrCompound
[
i
].
allocatedReserve
<
alocatedReserveCompound
)
arrReservCompound
.
push
(
arrCompound
[
i
])
}
createfileADV
(
'
profitPerMonth1000
'
,
JSON
.
stringify
(
arr3
,
null
,
2
))
createfileADV
(
'
percentage1000
'
,
JSON
.
stringify
(
arrResrv200
,
null
,
2
))
createfileADV
(
'
compound1000
'
,
JSON
.
stringify
(
arr1000Compound
,
null
,
2
))
// createfileADV('allocatedReservePerMonthUnder' + alocatedReserve, JSON.stringify(arr20Max, null, 2))
// createfileADV('allocatedReserveCompoundUnder' + alocatedReserveCompound, JSON.stringify(arrReservCompound, null, 2))
}
function
createfileADV
(
filename
,
data
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
writeFile
(
'
final/
'
+
filename
+
'
.json
'
,
data
,
'
utf8
'
,
function
(
err
)
{
if
(
err
)
reject
(
err
);
else
resolve
(
data
);
});
});
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment