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
38a0a4cc
Commit
38a0a4cc
authored
May 05, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pu
parent
3b1d99fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
ai.js
ai.js
+26
-0
test_json.js
test_json.js
+1
-1
No files found.
ai.js
View file @
38a0a4cc
...
@@ -163,6 +163,10 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
...
@@ -163,6 +163,10 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
let
lossDone
=
0
let
lossDone
=
0
let
allDone
=
0
let
allDone
=
0
let
allDonePer
=
0
let
allDonePer
=
0
let
allLongDone
=
0
let
allLongDonePer
=
0
let
allShortDone
=
0
let
allShortDonePer
=
0
let
lossDonePer
=
0
let
lossDonePer
=
0
let
lossPlusDone
=
0
let
lossPlusDone
=
0
let
lossPlusDonePer
=
0
let
lossPlusDonePer
=
0
...
@@ -656,6 +660,14 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
...
@@ -656,6 +660,14 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
if
(
runBefore
===
false
)
if
(
runBefore
===
false
)
continue
continue
allDone
++
allDone
++
if
(
data
[
i
].
side
===
'
LONG
'
)
{
allLongDone
++
}
else
{
allShortDone
++
}
if
(
step
===
0
)
{
if
(
step
===
0
)
{
dateString
=
dateString
+
data
[
i
].
openDate
.
split
(
'
'
)[
0
]
+
'
_
'
dateString
=
dateString
+
data
[
i
].
openDate
.
split
(
'
'
)[
0
]
+
'
_
'
runupString
=
runupString
+
data
[
i
].
runUp
+
'
_
'
runupString
=
runupString
+
data
[
i
].
runUp
+
'
_
'
...
@@ -817,6 +829,12 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
...
@@ -817,6 +829,12 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
targetDone
++
targetDone
++
allDonePer
=
allDonePer
+
config
.
target
allDonePer
=
allDonePer
+
config
.
target
targetDonePer
=
targetDonePer
+
config
.
target
targetDonePer
=
targetDonePer
+
config
.
target
if
(
data
[
i
].
side
===
'
LONG
'
)
allLongDonePer
=
allLongDonePer
+
config
.
target
else
allShortDonePer
=
allShortDonePer
+
config
.
target
if
(
!
d
.
riskFree
)
if
(
!
d
.
riskFree
)
total
++
total
++
...
@@ -826,6 +844,10 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
...
@@ -826,6 +844,10 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
lossDone
++
lossDone
++
lossDonePer
=
lossDonePer
+
data
[
i
].
profit
-
0.1
lossDonePer
=
lossDonePer
+
data
[
i
].
profit
-
0.1
allDonePer
=
allDonePer
+
data
[
i
].
profit
-
0.1
allDonePer
=
allDonePer
+
data
[
i
].
profit
-
0.1
if
(
data
[
i
].
side
===
'
LONG
'
)
allLongDonePer
=
allLongDonePer
+
data
[
i
].
profit
-
0.1
else
allShortDonePer
=
allShortDonePer
+
data
[
i
].
profit
-
0.1
if
(
data
[
i
].
profit
>
0.1
)
if
(
data
[
i
].
profit
>
0.1
)
{
{
lossPlusDone
++
lossPlusDone
++
...
@@ -981,6 +1003,10 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
...
@@ -981,6 +1003,10 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
allTotal
:
allTotal
,
allTotal
:
allTotal
,
allDone
:
allDone
,
allDone
:
allDone
,
allDonePer
:
allDonePer
,
allDonePer
:
allDonePer
,
allLongDone
:
allLongDone
,
allLongDonePer
:
allLongDonePer
,
allShortDone
:
allShortDone
,
allShortDonePer
:
allShortDonePer
,
targetDone
:
targetDone
,
targetDone
:
targetDone
,
targetDonePer
:
targetDonePer
,
targetDonePer
:
targetDonePer
,
lossDone
:
lossDone
,
lossDone
:
lossDone
,
...
...
test_json.js
View file @
38a0a4cc
...
@@ -8,6 +8,6 @@ let t='-1.42_-1.4_-2.51_-2.09_-2.61_-1.98_-1.18_-0.91_-0.78_-0.45_-1.87_-2.22_-2
...
@@ -8,6 +8,6 @@ let t='-1.42_-1.4_-2.51_-2.09_-2.61_-1.98_-1.18_-0.91_-0.78_-0.45_-1.87_-2.22_-2
let
f
=
t
.
split
(
'
_
'
)
let
f
=
t
.
split
(
'
_
'
)
let
arr
=
[]
let
arr
=
[]
for
(
let
i
=
0
;
i
<
f
.
length
;
i
++
)
for
(
let
i
=
0
;
i
<
f
.
length
;
i
++
)
if
(
parseFloat
(
f
[
i
])
>
0
)
if
(
parseFloat
(
f
[
i
])
>
0
.1
)
arr
.
push
(
f
[
i
])
arr
.
push
(
f
[
i
])
console
.
log
(
arr
)
console
.
log
(
arr
)
\ 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