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
f252580a
Commit
f252580a
authored
Dec 04, 2021
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
e9884e2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
run.js
run.js
+72
-0
No files found.
run.js
View file @
f252580a
...
...
@@ -117,6 +117,7 @@ async function run() {
startAgain
(
arr
,
configs
.
start
)
generateBaseDrawDown
(
arr2
)
generateDrawDownBaseStart
(
arr2
,
configs
.
start
)
console
.
log
(
'
Done
'
)
await
makeStatus
(
directory
,
'
0
'
)
// process.exit(0)
...
...
@@ -180,6 +181,77 @@ async function generateBaseDrawDown(arrLast)
}
}
async
function
generateDrawDownBaseStart
(
arrLast
,
start
)
{
for
(
let
z
=
0
;
z
<
drawDown
.
length
;
z
++
)
{
let
arr2
=
[]
let
newArr
=
[]
let
arr3
=
[]
for
(
let
i
=
0
;
i
<
arr2
.
length
;
i
++
)
{
// console.log(arr2[i].drawDown)
if
(
arr2
[
i
].
drawDown
>=
drawDown
[
z
]
&&
arr2
[
i
].
maxAllocatedMoney
<
start
)
newArr
.
push
(
arr2
[
i
])
}
// console.log(arr2)
arr2
=
newArr
arr2
=
_
.
without
(
arr2
,
undefined
,
null
);
arr2
=
_
.
orderBy
(
arr2
,
[
'
profitPerMonthDrawDown
'
],
[
'
desc
'
]);
let
arr20Max
=
[]
let
arr1000Compound
=
[]
let
arrReserv
=
_
.
orderBy
(
arr2
,
[
'
percentage
'
],
[
'
asc
'
]);
let
arrCompound
=
_
.
orderBy
(
arr2
,
[
'
CompoundPerMonthDrawDown
'
],
[
'
desc
'
]);
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
])
}
// for (let i = 0; i < arr2.length; i++) {
//
// if (arr2[i].allocatedReserve < 3)
// arr20Max.push(arr2[i])
// }
// for (let i = 0; i < arrCompound.length; i++) {
//
// if (arrCompound[i].allocatedReserve < 3)
// arrReservCompound.push(arrCompound[i])
// }
let
arr20MaxNew
=
[]
let
arrReservCompoundNew
=
[]
for
(
let
i
=
0
;
i
<
1000
;
i
++
)
{
if
(
typeof
arr20Max
!==
"
undefined
"
)
if
(
i
<
arr20Max
.
length
)
arr20MaxNew
.
push
(
arr20Max
[
i
])
if
(
typeof
arrReservCompound
!==
"
undefined
"
)
if
(
i
<
arrReservCompound
.
length
)
arrReservCompoundNew
.
push
(
arrReservCompound
[
i
])
}
// await fs.unlinkSync(directory + '/' + csvFile)
// createfileADV('allDataSortedByProfit', JSON.stringify(arr2, null, 2))
createfileADV
(
'
drawDown
'
+
drawDown
[
z
],
'
profitPerMonth1000StartDrawDown
'
+
drawDown
[
z
],
JSON
.
stringify
(
arr3
,
null
,
2
))
// createfileADV('percentage1000', JSON.stringify(arrResrv200, null, 2))
createfileADV
(
'
drawDown
'
+
drawDown
[
z
],
'
compound1000StartDrawDown
'
+
drawDown
[
z
],
JSON
.
stringify
(
arr1000Compound
,
null
,
2
))
// createfileADV('allocatedReservePerMonthUnder3', JSON.stringify(arr20MaxNew, null, 2))
// createfileADV('allocatedReserveCompoundUnder3' , JSON.stringify(arrReservCompoundNew, null, 2))
}
}
async
function
startAgain
(
arr
,
start
)
{
let
count
=
0
...
...
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