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
9e3c2d05
Commit
9e3c2d05
authored
May 25, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pu
parent
e2aabfe2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
change.js
change.js
+1
-1
test_ccxt.js
test_ccxt.js
+27
-6
No files found.
change.js
View file @
9e3c2d05
...
@@ -293,7 +293,7 @@ async function adder(sig, qty, date) {
...
@@ -293,7 +293,7 @@ async function adder(sig, qty, date) {
.
exec
();
.
exec
();
}
}
}
else
{
}
else
{
let
d
=
exchange
.
createMarketOrder
(
'
ETHUSDT
'
,
'
Sell
'
,
qty
,
0
,
{
order_link_id
:
lastToken
})
let
d
=
await
exchange
.
createMarketOrder
(
'
ETHUSDT
'
,
'
Sell
'
,
qty
,
0
,
{
order_link_id
:
lastToken
})
// console.log('Add Suc With id',sig)
// console.log('Add Suc With id',sig)
if
(
typeof
d
.
id
!==
"
undefined
"
)
{
if
(
typeof
d
.
id
!==
"
undefined
"
)
{
console
.
log
(
'
Add Suc With id
'
,
d
.
id
,
sig
)
console
.
log
(
'
Add Suc With id
'
,
d
.
id
,
sig
)
...
...
test_ccxt.js
View file @
9e3c2d05
...
@@ -10,16 +10,37 @@ const exchange = new ccxt.bybit ({
...
@@ -10,16 +10,37 @@ const exchange = new ccxt.bybit ({
})
})
exchange
.
urls
[
'
api
'
]
=
exchange
.
urls
[
'
test
'
];
exchange
.
urls
[
'
api
'
]
=
exchange
.
urls
[
'
test
'
];
let
redis
=
require
(
'
redis
'
)
const
client
=
redis
.
createClient
(
{
url
:
'
redis://default:p@db.zignaly.xyz:7001
'
}
);
async
function
test
()
{
const
orders
=
await
exchange
.
createMarketOrder
(
'
ETHUSDT
'
,
'
Buy
'
,
1
,
0
)
init
(
)
console
.
log
(
orders
.
id
)
async
function
init
()
{
client
.
on
(
'
error
'
,
(
err
)
=>
console
.
log
(
'
Redis Client Error
'
,
err
));
await
client
.
connect
();
test
()
}
async
function
test
()
{
let
d
=
exchange
.
createMarketOrder
(
'
ETHUSDT
'
,
'
Sell
'
,
0.01
,
0
,
{
order_link_id
:
'
id1_Sell_1012.05.24 21:34
'
})
// console.log('Add Suc With id',sig)
console
.
log
(
d
)
if
(
typeof
d
.
id
!==
"
undefined
"
)
{
console
.
log
(
'
Add Suc With id
'
,
d
.
id
,
'
sell
'
)
const
[
add
]
=
await
client
.
multi
()
.
set
(
'
sell
'
,
JSON
.
stringify
({
qty
:
0.1
}))
.
exec
();
// log (asTable (orders.map (order => ccxt.omit (order, [ 'timestamp', 'info' ]))))
// log (asTable (orders.map (order => ccxt.omit (order, [ 'timestamp', 'info' ]))))
...
@@ -27,6 +48,6 @@ async function test () {
...
@@ -27,6 +48,6 @@ async function test () {
// const order = await exchange.fetchOrder (orders[0]['id'])
// const order = await exchange.fetchOrder (orders[0]['id'])
}
}
}
test
()
\ No newline at end of file
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