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
16a1e113
Commit
16a1e113
authored
Apr 04, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
99af0f80
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
25 deletions
+70
-25
ai.js
ai.js
+1
-1
analyse.js
analyse.js
+69
-24
No files found.
ai.js
View file @
16a1e113
...
@@ -23,7 +23,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
...
@@ -23,7 +23,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
type
=
type
+
'
'
+
usage
+
'
'
+
fftDiffDrawDownProfit
type
=
type
+
'
'
+
usage
+
'
'
+
fftDiffDrawDownProfit
}
}
else
if
(
usage
===
'
fftPercentRunup
'
)
{
else
if
(
usage
===
'
fftPercentRunup
'
)
{
type
=
type
+
'
'
+
usage
+
'
'
+
fftPercentRunup
type
=
type
+
'
'
+
usage
+
'
Count:
'
+
fftPercentRunup
.
count
+
'
Percent:
'
+
fftPercentRunup
.
percent
}
}
let
saveData
=
[]
let
saveData
=
[]
...
...
analyse.js
View file @
16a1e113
...
@@ -38,43 +38,88 @@ async function format(name) {
...
@@ -38,43 +38,88 @@ async function format(name) {
let
newCon
=
0
let
newCon
=
0
let
newCounter
=
0
let
newCounter
=
0
let
diffCount
=
0
let
diffCount
=
0
// console.log(res)
let
maxRed
=
0
let
maxGreen
=
0
let
redCounter
=
0
let
allGreeeCon
=
0
let
greenCounter
=
0
let
maxGreenArray
=
[]
let
maxRedArray
=
[]
for
(
let
i
=
1
;
i
<
(
res
.
length
-
1
);
i
++
)
{
for
(
let
i
=
1
;
i
<
(
res
.
length
-
1
);
i
++
)
{
let
d
=
res
[
i
].
split
(
'
,
'
)
try
{
try
{
let
d
=
res
[
i
].
split
(
'
,
'
)
let
profit
=
parseFloat
(
d
[
8
])
let
open
=
parseFloat
(
d
[
1
])
let
close
=
parseFloat
(
d
[
4
])
if
(
close
<
open
)
{
con
++
if
(
greenCounter
!==
0
)
allProfit
=
allProfit
+
profit
maxGreenArray
.
push
(
greenCounter
)
if
(
greenCounter
>
maxGreen
)
if
(
profit
>=
3.4065813474551385
)
maxGreen
=
greenCounter
newCon
++
greenCounter
=
0
redCounter
++
con
++
if
(
profit
<=
3.4065813474551385
)
{
diffCount
++
}
else
{
}
else
{
if
(
diffCount
>=
38
)
if
(
redCounter
!==
0
)
newCounter
++
maxRedArray
.
push
(
redCounter
)
diffCount
=
0
if
(
redCounter
>
maxRed
)
maxRed
=
redCounter
redCounter
=
0
greenCounter
++
allGreeeCon
++
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
}
}
}
}
allProfit
=
allProfit
+
(
con
*
0.1
)
let
avg
=
(
allProfit
/
con
)
avg
=
avg
+
0.1
let
newTemp
=
newCon
/
con
let
twoCounter
=
0
console
.
log
(
newCounter
)
// for (let i=0;i<maxRedArray.length;i++)
// if (maxRedArray[i] ===1)
// twoCounter++
console
.
log
(
'
from
'
+
res
.
length
+
'
red
'
+
con
,
'
max red:
'
+
maxRed
,
'
green:
'
+
allGreeeCon
+
'
max green:
'
+
maxGreen
)
// console.log('total '+con +' avg runup:'+(allProfit/con))
// console.log('total '+con +' avg runup:'+(allProfit/con))
maxRedArray
=
_
.
orderBy
(
maxRedArray
)
maxRedArray
=
_
.
reverse
(
maxRedArray
)
// console.log('Max Red Candle Array:')
// console.log(maxRedArray)
maxGreenArray
=
_
.
orderBy
(
maxGreenArray
)
maxGreenArray
=
_
.
reverse
(
maxGreenArray
)
// console.log('Max Green Candle Array:')
// console.log(maxGreenArray)
let
newxGreenArray
=
[]
for
(
let
i
=
0
;
i
<
maxGreenArray
.
length
;
i
++
)
{
let
counter
=
1
for
(
let
j
=
0
;
j
<
maxGreenArray
.
length
;
j
++
)
if
(
maxGreenArray
[
i
]
===
maxRedArray
[
j
])
counter
++
newxGreenArray
.
push
({
item
:
maxGreenArray
[
i
],
count
:
counter
})
}
let
newxRedArray
=
[]
for
(
let
i
=
0
;
i
<
maxRedArray
.
length
;
i
++
)
{
let
counter
=
1
for
(
let
j
=
0
;
j
<
maxRedArray
.
length
;
j
++
)
if
(
maxRedArray
[
i
]
===
maxRedArray
[
j
])
counter
++
newxRedArray
.
push
({
item
:
maxRedArray
[
i
],
count
:
counter
})
}
newxGreenArray
=
_
.
uniqBy
(
newxGreenArray
,
'
item
'
);
newxRedArray
=
_
.
uniqBy
(
newxRedArray
,
'
item
'
);
console
.
log
(
'
Max Red Candle Array:
'
)
console
.
log
(
newxRedArray
)
console
.
log
(
'
Max Green Candle Array:
'
)
console
.
log
(
newxGreenArray
)
}
}
...
...
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