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
3b6dd61d
Commit
3b6dd61d
authored
May 09, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pu
parent
899551d0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
25 deletions
+24
-25
ai.js
ai.js
+24
-25
No files found.
ai.js
View file @
3b6dd61d
...
...
@@ -13,11 +13,11 @@ let avgRunup = 0
let
avgDrawdown
=
0
let
avgProfit
=
0
let
startt
=
30
let
baseCompund
=
100
let
baseMeta
=
0
let
baseDrawDown
=
0
let
tempMeta
=
0
let
tempDrawDown
=
0
let
baseCompund
=
100
let
baseMeta
=
0
let
baseDrawDown
=
0
let
tempMeta
=
0
let
tempDrawDown
=
0
//
function
run
(
data
,
config
,
risk
,
pfTrade
,
riskFreeLevel
,
detail
,
loss
,
durs
,
maxTradeDays
,
targetPercentage
,
candlesData
,
fft
,
ProfitZeroProfit
,
fftRunup
,
ProfitZeroProfitRunup
,
ProfitZeroDrawDownProfit
,
ProfitZeroDrawDown
,
ddPlusRunCount
,
RunupDrawDownZeroRunupDrawDown
,
ProfitZeroRunupProfit
,
ProfitZeroRunupDrawDown
,
RunUpDrawDownZeroProfit
,
RunUpDrawDownZeroDrawDownProfit
,
RunUpDrawDownZeroDrawdown
,
RunUpDrawDownZeroRunupProfit
,
RunupZeroRunupDrawDown
,
RunupZeroProfit
,
RunupZeroProfitDrawDown
,
RunupZeroDrawDown
,
RunupZeroProfitRunup
,
DrawDownZeroDrawDown
,
DrawDownnZeroProfit
,
DrawDownZeroProfitDrawDown
,
DrawDownZeroProfitRunup
,
DrawDownZeroRunupDrawDown
,
ProfitDrawDownZeroDrawDown
,
ProfitDrawDownZeroProfit
,
ProfitDrawDownZeroProfitDrawDown
,
ProfitDrawDownZeroProfitRunup
,
ProfitDrawDownZeroRunupDrawDown
...
...
@@ -255,7 +255,6 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
allDonePer
<
-
70
)
return
null
if
(
maxDays
>
maxTradeDays
)
...
...
@@ -568,24 +567,21 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
if
(
runBefore
===
false
)
continue
allDone
++
if
(
data
[
i
].
profit
>
0.1
)
baseCompund
=
baseCompund
+
(
data
[
i
].
profit
-
0.1
)
if
(
data
[
i
].
profit
>
0.1
)
baseCompund
=
baseCompund
+
(
data
[
i
].
profit
-
0.1
)
if
(
data
[
i
].
profit
>
0.1
)
{
tempMeta
=
0
tempDrawDown
=
0
if
(
data
[
i
].
profit
>
0.1
)
{
tempMeta
=
0
tempDrawDown
=
0
}
else
{
tempMeta
=
tempMeta
+
data
[
i
].
profit
+
0.1
tempDrawDown
=
tempDrawDown
+
data
[
i
].
drawDown
}
else
{
tempMeta
=
tempMeta
+
data
[
i
].
profit
+
0.1
tempDrawDown
=
tempDrawDown
+
data
[
i
].
drawDown
if
(
tempMeta
<
baseMeta
)
baseMeta
=
tempMeta
baseMeta
=
tempMeta
if
(
tempDrawDown
<
baseDrawDown
)
baseDrawDown
=
tempDrawDown
if
(
tempDrawDown
<
baseDrawDown
)
baseDrawDown
=
tempDrawDown
}
if
(
data
[
i
].
side
===
'
LONG
'
)
{
...
...
@@ -768,8 +764,11 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
runBefore
=
false
profitLossString
=
profitLossString
+
data
[
i
].
profit
+
'
_
'
if
(
data
[
i
].
profit
<=
0.1
)
{
lossDone
++
lossDonePer
=
lossDonePer
+
data
[
i
].
profit
-
0.1
}
allDonePer
=
allDonePer
+
data
[
i
].
profit
-
0.1
if
(
data
[
i
].
side
===
'
LONG
'
)
{
allLongDonePer
=
allLongDonePer
+
data
[
i
].
profit
-
0.1
...
...
@@ -913,7 +912,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
percentage
=
null
}
let
profitPerMonth
=
(
allDonePer
/
dur
)
*
30
let
profitPerMonth
=
(
allDonePer
/
dur
)
*
30
// let percentage2 = maxReserve + newT
...
...
@@ -967,7 +966,7 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
totalPlus
:
totalPlus
,
totalCompound
:
baseCompund
,
profitPerMonth
:
Math
.
abs
(
profitPerMonth
),
compoundPerMonth
:
(
baseCompund
/
dur
)
*
30
,
compoundPerMonth
:
(
baseCompund
/
dur
)
*
30
,
dateString
:
dateString
,
runupString
:
runupString
,
sideString
:
sideString
,
...
...
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