Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ai
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
ai
Commits
d16291a5
Commit
d16291a5
authored
May 09, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pu
parent
343419b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
ai.js
ai.js
+13
-3
test_json.js
test_json.js
+8
-5
No files found.
ai.js
View file @
d16291a5
...
@@ -570,7 +570,9 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
...
@@ -570,7 +570,9 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
continue
continue
allDone
++
allDone
++
if
(
data
[
i
].
profit
>
0.1
)
if
(
data
[
i
].
profit
>
0.1
)
baseCompund
=
baseCompund
+
percentageAdv
(
baseCompund
,
data
[
i
].
profit
-
0.1
)
baseCompund
=
baseCompund
+
percentage2
(
baseCompund
,
data
[
i
].
profit
-
0.1
)
if
(
data
[
i
].
profit
>
0.1
)
{
if
(
data
[
i
].
profit
>
0.1
)
{
tempMeta
=
0
tempMeta
=
0
...
@@ -679,7 +681,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
...
@@ -679,7 +681,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
obj
.
currentDrawDown
=
0
obj
.
currentDrawDown
=
0
obj
.
maxReserve
=
baseDrawDown
obj
.
maxReserve
=
baseDrawDown
obj
.
maxMeta
=
baseMeta
obj
.
maxMeta
=
baseMeta
obj
.
maxAllocatedMoney
=
maxAllocatedMoney
obj
.
maxAllocatedMoney
=
maxAllocatedMoney
obj
.
maxLevel
=
maxLevel
obj
.
maxLevel
=
maxLevel
obj
.
step
=
step
obj
.
step
=
step
...
@@ -1196,6 +1198,14 @@ function percentage(base, per) {
...
@@ -1196,6 +1198,14 @@ function percentage(base, per) {
let
temp
=
base
*
percentager
let
temp
=
base
*
percentager
return
base
+
temp
return
base
+
temp
}
}
function
percentage2
(
base
,
per
)
{
base
=
parseFloat
(
base
)
per
=
parseFloat
(
per
)
let
percentager
=
per
/
100
let
temp
=
base
*
percentager
return
temp
}
function
percentageMinus
(
base
,
per
)
{
function
percentageMinus
(
base
,
per
)
{
...
...
test_json.js
View file @
d16291a5
...
@@ -14,9 +14,12 @@
...
@@ -14,9 +14,12 @@
// console.log(f.length)
// console.log(f.length)
// console.log(sum / f.length)
// console.log(sum / f.length)
console
.
log
(
percentage
(
100
,
2
))
function
percentage
(
base
,
per
)
{
let
t
=
'
2017-08-21 00:30:00
'
base
=
parseFloat
(
base
)
let
ft
=
t
.
split
(
'
-
'
)
per
=
parseFloat
(
per
)
let
y
=
parseFloat
(
ft
[
0
])
let
percentager
=
per
/
100
let
m
=
parseFloat
(
ft
[
1
])
let
temp
=
base
*
percentager
console
.
log
(
y
,
m
)
return
temp
\ No newline at end of file
}
\ 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