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
59c40a1f
Commit
59c40a1f
authored
Nov 03, 2021
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
eadbcf9d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
32 deletions
+27
-32
final.js
final.js
+27
-32
No files found.
final.js
View file @
59c40a1f
...
@@ -7,22 +7,18 @@ let alocatedReserve = 3
...
@@ -7,22 +7,18 @@ let alocatedReserve = 3
let
alocatedReserveCompound
=
3
let
alocatedReserveCompound
=
3
work
()
work
()
async
function
work
()
{
async
function
work
()
{
let
directory
=
await
fs
.
readdirSync
(
'
result
'
)
let
directory
=
await
fs
.
readdirSync
(
'
result
'
)
for
(
let
i
=
0
;
i
<
directory
.
length
;
i
=
i
+
1000
)
for
(
let
i
=
0
;
i
<
directory
.
length
;
i
=
i
+
1000
)
{
{
// console.log('hi')
console
.
log
(
'
hi
'
)
let
arr
=
[]
let
arr
=
[]
for
(
let
j
=
0
;
j
<
1000
;
j
++
)
{
for
(
let
j
=
0
;
j
<
1000
;
j
++
)
{
try
{
try
{
arr
.
push
(
directory
[
j
+
i
])
if
((
j
+
i
)
<
directory
.
length
)
}
arr
.
push
(
directory
[
j
+
i
])
catch
(
e
)
}
catch
(
e
)
{
{
}
}
...
@@ -30,37 +26,36 @@ async function work()
...
@@ -30,37 +26,36 @@ async function work()
}
}
if
(
arr
.
length
!==
0
)
if
(
arr
.
length
!==
0
)
{
{
let
timestamp
=
Date
.
now
()
let
timestamp
=
Date
.
now
()
try
{
try
{
await
fs
.
mkdirSync
(
'
last1000/
'
+
timestamp
)
await
fs
.
mkdirSync
(
'
last1000/
'
+
timestamp
)
}
catch
(
e
)
{
}
catch
(
e
)
{
}
}
run
(
'
profitPerMonth1000
'
,
arr
,
timestamp
)
run
(
'
profitPerMonth1000
'
,
arr
,
timestamp
)
run
(
'
percentage1000
'
,
arr
,
timestamp
)
run
(
'
percentage1000
'
,
arr
,
timestamp
)
run
(
'
compound1000
'
,
arr
,
timestamp
)
run
(
'
compound1000
'
,
arr
,
timestamp
)
run
(
'
allocatedReservePerMonthUnder3
'
,
arr
,
timestamp
)
run
(
'
allocatedReservePerMonthUnder3
'
,
arr
,
timestamp
)
run
(
'
allocatedReserveCompoundUnder3
'
,
arr
,
timestamp
)
run
(
'
allocatedReserveCompoundUnder3
'
,
arr
,
timestamp
)
run
(
'
allocatedReservePerMonthUnder2
'
,
arr
,
timestamp
)
run
(
'
allocatedReservePerMonthUnder2
'
,
arr
,
timestamp
)
await
run
(
'
allocatedReserveCompoundUnder2
'
,
arr
,
timestamp
)
await
run
(
'
allocatedReserveCompoundUnder2
'
,
arr
,
timestamp
)
}
}
}
}
}
}
async
function
run
(
name
,
directory
,
timestamp
)
{
async
function
run
(
name
,
directory
,
timestamp
)
{
// let directory = await fs.readdirSync('result')
// let directory = await fs.readdirSync('result')
let
arr2
=
[]
let
arr2
=
[]
let
arrFinal
=
[]
let
arrFinal
=
[]
let
last
=
[]
let
last
=
[]
for
(
let
f
=
0
;
f
<
directory
.
length
;
f
++
)
console
.
log
(
directory
)
{
for
(
let
f
=
0
;
f
<
directory
.
length
;
f
++
)
{
if
(
typeof
directory
[
f
]
===
"
undefined
"
)
if
(
typeof
directory
[
f
]
===
"
undefined
"
)
continue
continue
console
.
log
(
directory
[
f
])
arrFinal
.
push
(
readFile
(
name
,
directory
[
f
]))
arrFinal
.
push
(
readFile
(
name
,
directory
[
f
]))
}
}
...
@@ -115,9 +110,9 @@ async function run(name,directory,timestamp) {
...
@@ -115,9 +110,9 @@ async function run(name,directory,timestamp) {
las
.
push
(
last
[
i
])
las
.
push
(
last
[
i
])
createfileADV
(
timestamp
,
name
,
JSON
.
stringify
(
las
,
null
,
2
))
createfileADV
(
timestamp
,
name
,
JSON
.
stringify
(
las
,
null
,
2
))
last
=
[]
last
=
[]
}
}
...
@@ -148,9 +143,9 @@ async function readFile(name, directory) {
...
@@ -148,9 +143,9 @@ async function readFile(name, directory) {
return
file
return
file
}
}
function
createfileADV
(
timestamp
,
filename
,
data
)
{
function
createfileADV
(
timestamp
,
filename
,
data
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
writeFile
(
'
last1000/
'
+
timestamp
+
'
/
'
+
filename
+
'
.json
'
,
data
,
'
utf8
'
,
function
(
err
)
{
fs
.
writeFile
(
'
last1000/
'
+
timestamp
+
'
/
'
+
filename
+
'
.json
'
,
data
,
'
utf8
'
,
function
(
err
)
{
if
(
err
)
reject
(
err
);
if
(
err
)
reject
(
err
);
else
resolve
(
data
);
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