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
95bd3777
Commit
95bd3777
authored
Jul 28, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pull
parent
8682f632
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
test_ccxt.js
test_ccxt.js
+11
-10
trade.js
trade.js
+1
-1
No files found.
test_ccxt.js
View file @
95bd3777
...
@@ -3,13 +3,13 @@ const ccxt = require ('ccxt')
...
@@ -3,13 +3,13 @@ const ccxt = require ('ccxt')
const
exchange
=
new
ccxt
.
bybit
({
const
exchange
=
new
ccxt
.
bybit
({
apiKey
:
"
7iW1muhWWyX8PxuQWx
"
,
apiKey
:
"
jCTVo1KpLd14YuLRiN
"
,
secret
:
"
5Bf4FFISdQNxVJqg5pqyn860CIrgjsXXy3pK
"
,
secret
:
"
ZxJ3LruKNMCisPVCyckTpRwcZazyqg3JRNM9
"
,
enableRateLimit
:
true
,
enableRateLimit
:
true
,
})
})
exchange
.
urls
[
'
api
'
]
=
exchange
.
urls
[
'
test
'
];
let
redis
=
require
(
'
redis
'
)
let
redis
=
require
(
'
redis
'
)
const
client
=
redis
.
createClient
(
const
client
=
redis
.
createClient
(
{
url
:
'
redis://default:p@db.zignaly.xyz:7001
'
}
{
url
:
'
redis://default:p@db.zignaly.xyz:7001
'
}
...
@@ -22,24 +22,25 @@ init()
...
@@ -22,24 +22,25 @@ init()
async
function
init
()
{
async
function
init
()
{
client
.
on
(
'
error
'
,
(
err
)
=>
console
.
log
(
'
Redis Client Error
'
,
err
));
//
client.on('error', (err) => console.log('Redis Client Error', err));
//
await
client
.
connect
();
//
await client.connect();
test
()
test
()
}
}
async
function
test
()
{
async
function
test
()
{
// let b=await exchange.fetchBalance()
let
d
=
await
exchange
.
createMarketOrder
(
'
ADAUSDT
'
,
'
Sell
'
,
1
,
0
)
// console.log(b)
let
d
=
await
exchange
.
createMarketOrder
(
'
BTCUSDT
'
,
'
Buy
'
,
0.001
,
0
)
console
.
log
(
d
)
console
.
log
(
d
)
// console.log(d)
// console.log(d)
//63d101c8-3169-473c-a7ee-53645599474d
//63d101c8-3169-473c-a7ee-53645599474d
// let d=await exchange.fetchOrder('63d101c8-3169-473c-a7ee-53645599474d','BTCUSDT')
// let d=await exchange.fetchOrder('63d101c8-3169-473c-a7ee-53645599474d','BTCUSDT')
// console.log(d)
// console.log(d)
let
b
=
await
exchange
.
fetchBalance
()
//
let b=await exchange.fetchBalance()
console
.
log
(
b
)
//
console.log(b)
// for (let i=0;i<d.length;i++)
// for (let i=0;i<d.length;i++)
...
...
trade.js
View file @
95bd3777
...
@@ -149,7 +149,7 @@ async function init() {
...
@@ -149,7 +149,7 @@ async function init() {
})
})
exchange
.
urls
[
'
api
'
]
=
exchange
.
urls
[
'
test
'
];
//
exchange.urls['api'] = exchange.urls['test'];
run
()
run
()
balanceUpdater
()
balanceUpdater
()
...
...
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