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
6f7e3884
Commit
6f7e3884
authored
Mar 27, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
aa035a5a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
22 deletions
+33
-22
ai.js
ai.js
+32
-21
generate.js
generate.js
+1
-1
No files found.
ai.js
View file @
6f7e3884
...
@@ -13,16 +13,21 @@ let timeFrame = 0
...
@@ -13,16 +13,21 @@ let timeFrame = 0
function
run
(
data
,
config
,
risk
,
pfTrade
,
riskFreeLevel
,
detail
,
loss
,
durs
,
maxTradeDays
,
targetPercentage
,
candlesData
,
fft
,
fftPercent
,
fftRunup
,
fftPercentRunup
,
fftDiffDrawDownProfit
,
usage
)
{
function
run
(
data
,
config
,
risk
,
pfTrade
,
riskFreeLevel
,
detail
,
loss
,
durs
,
maxTradeDays
,
targetPercentage
,
candlesData
,
fft
,
fftPercent
,
fftRunup
,
fftPercentRunup
,
fftDiffDrawDownProfit
,
usage
)
{
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
if
(
usage
===
'
fft
'
)
{
for
(
let
i
=
0
;
i
<
usage
.
length
;
i
++
)
type
=
type
+
'
'
+
usage
+
'
'
+
fft
{
}
else
if
(
usage
===
'
fftPercent
'
)
{
if
(
usage
[
i
]
===
'
fft
'
)
{
type
=
type
+
'
'
+
usage
+
'
'
+
fftPercent
type
=
type
+
'
'
+
usage
[
i
]
+
'
'
+
fft
+
'
'
}
else
if
(
usage
===
'
fftRunup
'
)
{
}
else
if
(
usage
[
i
]
===
'
fftPercent
'
)
{
type
=
type
+
'
'
+
usage
+
'
'
+
fftRunup
type
=
type
+
'
'
+
usage
[
i
]
+
'
'
+
fftPercent
+
'
'
}
else
if
(
usage
===
'
fftDiffDrawDownProfit
'
)
{
}
else
if
(
usage
[
i
]
===
'
fftRunup
'
)
{
type
=
type
+
'
'
+
usage
+
'
'
+
fftDiffDrawDownProfit
type
=
type
+
'
'
+
usage
[
i
]
+
'
'
+
fftRunup
+
'
'
}
else
if
(
usage
[
i
]
===
'
fftDiffDrawDownProfit
'
)
{
type
=
type
+
'
'
+
usage
[
i
]
+
'
'
+
fftDiffDrawDownProfit
+
'
'
}
}
}
let
saveData
=
[]
let
saveData
=
[]
candles
=
candlesData
candles
=
candlesData
timeFrame
=
candles
[
1
].
t
-
candles
[
0
].
t
timeFrame
=
candles
[
1
].
t
-
candles
[
0
].
t
...
@@ -114,19 +119,25 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
...
@@ -114,19 +119,25 @@ 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
===
'
fftPercent
'
)
{
}
else
if
(
usage
[
z
]
===
'
fftPercent
'
)
{
if
(
allLossProfit
>
fftPercent
)
if
(
allLossProfit
>
fftPercent
)
continue
continue
}
else
if
(
usage
===
'
fftRunup
'
)
{
}
else
if
(
usage
[
z
]
===
'
fftRunup
'
)
{
if
(
countDropRunup
<
fftRunup
)
if
(
countDropRunup
<
fftRunup
)
continue
continue
}
else
if
(
usage
===
'
fftDiffDrawDownProfit
'
)
{
}
else
if
(
usage
[
z
]
===
'
fftDiffDrawDownProfit
'
)
{
if
(
diffDrawdownProfitAll
>
fftDiffDrawDownProfit
)
if
(
diffDrawdownProfitAll
>
fftDiffDrawDownProfit
)
continue
continue
}
}
}
}
}
...
...
generate.js
View file @
6f7e3884
...
@@ -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
'
}
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
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