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
a3f7f444
Commit
a3f7f444
authored
Mar 27, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
6f7e3884
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
29 deletions
+23
-29
ai.js
ai.js
+22
-28
generate.js
generate.js
+1
-1
No files found.
ai.js
View file @
a3f7f444
...
@@ -15,18 +15,18 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
...
@@ -15,18 +15,18 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
let
type
=
config
.
type
+
'
param:
'
+
config
.
param
+
'
base:
'
+
config
.
base
+
'
target:
'
+
config
.
target
+
'
targetPercentage:
'
+
targetPercentage
.
enable
let
type
=
config
.
type
+
'
param:
'
+
config
.
param
+
'
base:
'
+
config
.
base
+
'
target:
'
+
config
.
target
+
'
targetPercentage:
'
+
targetPercentage
.
enable
for
(
let
i
=
0
;
i
<
usage
.
length
;
i
++
)
for
(
let
i
=
0
;
i
<
usage
.
length
;
i
++
)
{
{
if
(
usage
[
i
]
===
'
fft
'
)
{
type
=
type
+
'
'
+
usage
[
i
]
+
'
'
+
fft
+
'
'
}
else
if
(
usage
[
i
]
===
'
fftPercent
'
)
{
type
=
type
+
'
'
+
usage
[
i
]
+
'
'
+
fftPercent
+
'
'
}
else
if
(
usage
[
i
]
===
'
fftRunup
'
)
{
type
=
type
+
'
'
+
usage
[
i
]
+
'
'
+
fftRunup
+
'
'
}
else
if
(
usage
[
i
]
===
'
fftDiffDrawDownProfit
'
)
{
type
=
type
+
'
'
+
usage
[
i
]
+
'
'
+
fftDiffDrawDownProfit
+
'
'
}
}
}
if
(
usage
===
'
fft
'
)
{
type
=
type
+
'
'
+
usage
+
'
'
+
fft
+
'
'
}
else
if
(
usage
===
'
fftPercent
'
)
{
type
=
type
+
'
'
+
usage
+
'
'
+
fftPercent
+
'
'
}
else
if
(
usage
===
'
fftRunup
'
)
{
type
=
type
+
'
'
+
usage
+
'
'
+
fftRunup
+
'
'
}
else
if
(
usage
===
'
fftDiffDrawDownProfit
'
)
{
type
=
type
+
'
'
+
usage
+
'
'
+
fftDiffDrawDownProfit
+
'
'
}
let
saveData
=
[]
let
saveData
=
[]
candles
=
candlesData
candles
=
candlesData
...
@@ -119,25 +119,19 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
...
@@ -119,25 +119,19 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
if
(
runBefore
===
false
)
{
if
(
runBefore
===
false
)
{
if
(
usage
===
'
fft
'
)
{
for
(
let
z
=
0
;
z
<
usage
.
length
;
z
++
)
{
if
(
usage
[
z
]
===
'
fft
'
)
{
if
(
countDrop
<
fft
)
if
(
countDrop
<
fft
)
continue
continue
}
else
if
(
usage
[
z
]
===
'
fftPercent
'
)
{
}
else
if
(
usage
===
'
fftPercent
'
)
{
if
(
allLossProfit
>
fftPercent
)
if
(
allLossProfit
>
fftPercent
)
continue
continue
}
else
if
(
usage
[
z
]
===
'
fftRunup
'
)
{
}
else
if
(
usage
===
'
fftRunup
'
)
{
if
(
countDropRunup
<
fftRunup
)
if
(
countDropRunup
<
fftRunup
)
continue
continue
}
else
if
(
usage
[
z
]
===
'
fftDiffDrawDownProfit
'
)
{
}
else
if
(
usage
===
'
fftDiffDrawDownProfit
'
)
{
if
(
diffDrawdownProfitAll
>
fftDiffDrawDownProfit
)
if
(
diffDrawdownProfitAll
>
fftDiffDrawDownProfit
)
continue
continue
}
}
}
}
}
...
...
generate.js
View file @
a3f7f444
...
@@ -20,7 +20,7 @@ run()
...
@@ -20,7 +20,7 @@ run()
async
function
run
()
async
function
run
()
{
{
let
obj
=
{
sort
:
'
profitPerMonthDrawDown
'
,
alocatedReserve
:
3
,
alocatedReserveCompound
:
3
,
risk
:
0
,
start
:
10000
,
pfTrade
:
2
,
side
:
'
both
'
,
riskFreeLevel
:
100
,
onlyShortLong
:
false
,
loss
:
0
,
level
:
200
,
dur
:
1500
,
maxTradeDays
:
40
,
targetPercentage
:{
enable
:
true
},
fft
:
1
,
fftPercent
:
-
2
,
fftRunup
:
2
,
fftPercentRunup
:
2
,
fftDiffDrawDownProfit
:
-
0.5
,
usage
:
[
'
fft
'
,
'
fftRunup
'
]
}
let
obj
=
{
sort
:
'
profitPerMonthDrawDown
'
,
alocatedReserve
:
3
,
alocatedReserveCompound
:
3
,
risk
:
0
,
start
:
10000
,
pfTrade
:
2
,
side
:
'
both
'
,
riskFreeLevel
:
100
,
onlyShortLong
:
false
,
loss
:
0
,
level
:
200
,
dur
:
1500
,
maxTradeDays
:
40
,
targetPercentage
:{
enable
:
true
},
fft
:
1
,
fftPercent
:
-
2
,
fftRunup
:
2
,
fftPercentRunup
:
2
,
fftDiffDrawDownProfit
:
-
0.5
,
usage
:
'
fft
'
}
let
detail
=
[
'
configs2.json-211021092159_O1_BNC_BTCUSD_Lp1_Y211020a - Copy_Mn.csv&zarib param:1.1 base:200 target:1
'
]
let
detail
=
[
'
configs2.json-211021092159_O1_BNC_BTCUSD_Lp1_Y211020a - Copy_Mn.csv&zarib param:1.1 base:200 target:1
'
]
obj
.
detail
=
detail
obj
.
detail
=
detail
let
all
=
[]
let
all
=
[]
...
...
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