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
cf146b92
Commit
cf146b92
authored
Dec 02, 2021
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
3edddcac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
16 deletions
+19
-16
final.js
final.js
+16
-16
run.js
run.js
+3
-0
No files found.
final.js
View file @
cf146b92
...
...
@@ -34,6 +34,8 @@ async function work() {
}
run
(
'
profitPerMonth1000
'
,
arr
,
timestamp
)
// run('percentage1000', arr, timestamp)
run
(
'
compound1000
'
,
arr
,
timestamp
)
run
(
'
profitPerMonth1000Start
'
,
arr
,
timestamp
)
...
...
@@ -62,8 +64,10 @@ async function run(name, directory, timestamp) {
arrFinal
=
await
Promise
.
all
(
arrFinal
)
for
(
let
i
=
0
;
i
<
arrFinal
.
length
;
i
++
)
{
let
inline
=
arrFinal
[
i
]
console
.
log
(
inline
)
for
(
let
z
=
0
;
z
<
inline
.
length
;
z
++
)
...
...
@@ -71,6 +75,9 @@ async function run(name, directory, timestamp) {
}
// console.log(arr2)
if
(
name
===
'
profitPerMonth1000
'
||
name
===
'
allocatedReservePerMonthUnder3
'
||
name
===
'
allocatedReservePerMonthUnder2
'
||
name
===
'
profitPerMonth1000Start
'
)
last
=
_
.
orderBy
(
arr2
,
[
'
profitPerMonthDrawDown
'
],
[
'
desc
'
]);
...
...
@@ -80,6 +87,8 @@ async function run(name, directory, timestamp) {
if
(
name
===
'
compound1000
'
||
name
===
'
allocatedReserveCompoundUnder3
'
||
name
===
'
allocatedReserveCompoundUnder2
'
||
name
===
'
compound1000Start
'
)
last
=
_
.
orderBy
(
arr2
,
[
'
CompoundPerMonthDrawDown
'
],
[
'
desc
'
]);
// if (name === 'allocatedReservePerMonthUnder2' || name === 'allocatedReservePerMonthUnder3') {
// let arr20Max = []
// for (let i = 0; i < last.length; i++) {
...
...
@@ -128,25 +137,16 @@ async function readFile(name, directory) {
let
sortByProfit
=
[]
let
file
=
await
fs
.
readFileSync
(
'
./result/
'
+
directory
+
'
/
'
+
name
+
'
.json
'
,
'
utf8
'
)
file
=
JSON
.
parse
(
file
)
// file = _.orderBy(file, sort, ['desc']);
for
(
let
j
=
0
;
j
<
file
.
length
;
j
++
)
{
sortByProfit
.
push
(
file
[
j
])
}
// let sortByPercentage = []
// file = _.orderBy(file, ['percentage'], ['asc']);
// for (let j = 0; j < file.length; j++) {
//
// sortByPercentage.push(file[j])
// }
//
// let sortByCompound = []
// file =_.orderBy(file, ['compoundPerMonth'], ['desc']);
// for (let j = 0; j < file.length; j++) {
//
// sortByCompound.push(file[j])
// }
return
file
}
...
...
run.js
View file @
cf146b92
...
...
@@ -148,8 +148,11 @@ async function startAgain(arr,start){
let
arrResrv200
=
[]
let
arrReservCompound
=
[]
for
(
let
i
=
0
;
i
<
1000
;
i
++
)
{
if
(
typeof
arr2
[
i
]
!==
"
undefined
"
)
arr3
.
push
(
arr2
[
i
])
if
(
typeof
arrReserv
[
i
]
!==
"
undefined
"
)
arrResrv200
.
push
(
arrReserv
[
i
])
if
(
typeof
arrCompound
[
i
]
!==
"
undefined
"
)
arr1000Compound
.
push
(
arrCompound
[
i
])
}
...
...
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