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
331860ea
Commit
331860ea
authored
Jun 03, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pu
parent
a68383f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
30 deletions
+39
-30
change.js
change.js
+39
-30
No files found.
change.js
View file @
331860ea
...
@@ -326,16 +326,16 @@ async function closer(sig, date, bigData, id, pair) {
...
@@ -326,16 +326,16 @@ async function closer(sig, date, bigData, id, pair) {
}
}
}
}
}
}
await
sleep
(
60000
)
//
await sleep(60000)
d
=
await
exchange
.
fetchOrder
(
d
.
id
,
d
.
info
.
symbol
)
//
d = await exchange.fetchOrder(d.id, d.info.symbol)
let
profit
=
getCalculateProfit
(
newData
.
price
,
d
.
average
)
//
let profit = getCalculateProfit(newData.price, d.average)
if
(
newData
.
side
===
'
sell
'
)
//
if (newData.side === 'sell')
profit
=
profit
*
-
1
//
profit = profit * -1
//
let
det
=
'
side:
'
+
newData
.
side
+
'
bybit open price:
'
+
newData
.
price
+
'
bybit close price:
'
+
d
.
average
//
let det = 'side:' + newData.side + ' bybit open price:' + newData.price + ' bybit close price:' + d.average
//
let
t
=
id
+
'
:
'
+
det
+
'
bybit profit:
'
+
'
'
+
profit
+
'
yashil profit:
'
+
bigData
.
profit
+
'
diff:
'
+
(
profit
-
bigData
.
profit
)
//
let t = id + ' :' + det + ' bybit profit:' + ' ' + profit + ' yashil profit:' + bigData.profit + ' diff:' + (profit - bigData.profit)
appendDiffProfitLog
(
t
)
//
appendDiffProfitLog(t)
}
}
...
@@ -364,29 +364,38 @@ async function adder(sig, qty, date, allData,pair) {
...
@@ -364,29 +364,38 @@ async function adder(sig, qty, date, allData,pair) {
}
}
console
.
log
(
d
)
if
(
typeof
d
.
id
!==
"
undefined
"
)
{
if
(
typeof
d
.
id
!==
"
undefined
"
)
{
console
.
log
(
'
Add Suc With id
'
,
d
.
id
,
sig
)
await
sleep
(
60000
)
const
[
add
]
=
await
client
try
{
.
multi
()
d
=
await
exchange
.
fetchOrder
(
d
.
id
,
d
.
info
.
symbol
)
.
set
(
sig
,
JSON
.
stringify
({
pair
:
d
.
info
.
symbol
,
side
:
d
.
side
,
qty
:
d
.
amount
,
price
:
d
.
price
}))
console
.
log
(
'
Add Suc With id
'
,
d
.
id
,
sig
)
.
exec
();
const
[
add
]
=
await
client
.
multi
()
.
set
(
sig
,
JSON
.
stringify
({
pair
:
d
.
info
.
symbol
,
side
:
d
.
side
,
qty
:
d
.
amount
,
price
:
d
.
average
}))
.
exec
();
}
catch
(
e
)
{
console
.
log
(
'
Add Suc With id
'
,
d
.
id
,
sig
)
console
.
log
(
sig
,
'
Have Problem Reding Order so try offline
'
)
const
[
add
]
=
await
client
.
multi
()
.
set
(
sig
,
JSON
.
stringify
({
pair
:
d
.
info
.
symbol
,
side
:
d
.
side
,
qty
:
d
.
amount
,
price
:
d
.
price
}))
.
exec
();
}
}
}
// console.log(d)
// if (typeof d.id !== "undefined") {
// await sleep(60000)
// try {
// d = await exchange.fetchOrder(d.id, d.info.symbol)
// console.log('Add Suc With id', d.id, sig)
// const [add] = await client
// .multi()
// .set(sig, JSON.stringify({pair: d.info.symbol, side: d.side, qty: d.amount, price: d.average}))
// .exec();
// }
// catch (e)
// {
//
// console.log('Add Suc With id', d.id, sig)
// console.log(sig,'Have Problem Reding Order so try offline')
// const [add] = await client
// .multi()
// .set(sig, JSON.stringify({pair: d.info.symbol, side: d.side, qty: d.amount, price: d.price}))
// .exec();
// }
//
// }
}
}
...
...
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