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
751ef51d
Commit
751ef51d
authored
Feb 28, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
10c9baf8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
ai.js
ai.js
+21
-1
No files found.
ai.js
View file @
751ef51d
...
@@ -451,6 +451,7 @@ function inlineCheck(money, com, data, profit, lastCom, tar, riskFree, targetPer
...
@@ -451,6 +451,7 @@ function inlineCheck(money, com, data, profit, lastCom, tar, riskFree, targetPer
let
reserve
=
percentage
(
money
,
data
.
drawDown
)
let
reserve
=
percentage
(
money
,
data
.
drawDown
)
let
profitMoney
=
percentageMinus
(
money
,
data
.
profit
)
let
profitMoney
=
percentageMinus
(
money
,
data
.
profit
)
let
targetPrice
=
getTargetPrice
(
money
,
target
,
data
.
openPrice
,
data
.
side
)
let
diff
=
reserve
-
money
let
diff
=
reserve
-
money
diff
=
diff
-
com
-
lastCom
+
profit
diff
=
diff
-
com
-
lastCom
+
profit
...
@@ -472,6 +473,7 @@ function inlineCheck(money, com, data, profit, lastCom, tar, riskFree, targetPer
...
@@ -472,6 +473,7 @@ function inlineCheck(money, com, data, profit, lastCom, tar, riskFree, targetPer
profit
:
profitMoney
,
profit
:
profitMoney
,
lastCom
:
lastCom
,
lastCom
:
lastCom
,
com
:
com
,
com
:
com
,
targetPrice
:
targetPrice
,
target
:
target
,
target
:
target
,
targetDetail
:
targetDetail
targetDetail
:
targetDetail
}
}
...
@@ -486,12 +488,30 @@ function inlineCheck(money, com, data, profit, lastCom, tar, riskFree, targetPer
...
@@ -486,12 +488,30 @@ function inlineCheck(money, com, data, profit, lastCom, tar, riskFree, targetPer
lastMoney
:
money
,
lastMoney
:
money
,
com
:
com
,
com
:
com
,
target
:
target
,
target
:
target
,
targetDetail
:
targetDetail
targetDetail
:
targetDetail
,
targetPrice
:
targetPrice
}
}
}
}
function
getTargetPrice
(
money
,
target
,
basePrice
,
side
)
{
let
diffMoney
=
calPer
(
money
,
target
)
if
(
side
===
'
LONG
'
)
return
percentageAdv
(
basePrice
,
diffMoney
)
else
return
percentageAdv
(
basePrice
,
(
-
1
*
diffMoney
))
}
function
percentageAdv
(
base
,
per
)
{
base
=
parseFloat
(
base
)
per
=
parseFloat
(
per
)
let
percentager
=
per
/
100
let
temp
=
base
*
percentager
return
base
+
temp
}
function
calPer
(
entry
,
last
)
{
function
calPer
(
entry
,
last
)
{
return
((
last
-
entry
)
/
entry
)
*
100
return
((
last
-
entry
)
/
entry
)
*
100
...
...
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