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
f7f48a40
Commit
f7f48a40
authored
Nov 01, 2021
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
7d7c306d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
24 deletions
+20
-24
result.js
result.js
+20
-24
No files found.
result.js
View file @
f7f48a40
let
fs
=
require
(
'
fs
'
)
let
fs
=
require
(
'
fs
'
)
let
_
=
require
(
'
lodash
'
)
let
sort
=
'
profitPerMonth
'
let
alocatedReserve
=
2
let
alocatedReserveCompound
=
3
let
sort
=
'
profitPerMonth
'
let
alocatedReserve
=
2
let
alocatedReserveCompound
=
3
run
()
async
function
run
()
{
let
directory
=
await
fs
.
readdirSync
(
'
result
'
)
let
arr2
=
[]
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
++
)
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
=
[]
...
...
@@ -54,23 +47,26 @@ async function run()
}
let
alocated100
=
[]
let
allocated1000compond
=
[]
for
(
let
i
=
0
;
i
<
1000
;
i
++
)
{
alocated100
.
push
(
arr20Max
[
i
])
allocated1000compond
.
push
(
arrReservCompound
[
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' + alocatedReserveCompou
nd, JSON.stringify(arrReservCompound, null, 2))
createfileADV
(
'
allocatedReservePerMonthUnder
'
+
alocated100
,
JSON
.
stringify
(
arr20Max
,
null
,
2
))
createfileADV
(
'
allocatedReserveCompoundUnder
'
+
allocated1000compo
nd
,
JSON
.
stringify
(
arrReservCompound
,
null
,
2
))
}
function
createfileADV
(
filename
,
data
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
writeFile
(
'
final/
'
+
filename
+
'
.json
'
,
data
,
'
utf8
'
,
function
(
err
)
{
fs
.
writeFile
(
'
final/
'
+
filename
+
'
.json
'
,
data
,
'
utf8
'
,
function
(
err
)
{
if
(
err
)
reject
(
err
);
else
resolve
(
data
);
});
...
...
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