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
4416f7e1
Commit
4416f7e1
authored
Aug 01, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pull
parent
4663b0ad
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
package.json
package.json
+1
-1
test_ccxt.js
test_ccxt.js
+8
-7
trade.js
trade.js
+3
-3
No files found.
package.json
View file @
4416f7e1
...
...
@@ -16,7 +16,7 @@
"
big-json
"
:
"
^3.1.0
"
,
"
body-parser
"
:
"
^1.20.0
"
,
"
bybit-api
"
:
"
^2.1.10
"
,
"
ccxt
"
:
"
^1.
83.50
"
,
"
ccxt
"
:
"
^1.
91.55
"
,
"
cors
"
:
"
^2.8.5
"
,
"
execution-time
"
:
"
^1.4.1
"
,
"
express
"
:
"
^4.18.1
"
,
...
...
test_ccxt.js
View file @
4416f7e1
...
...
@@ -2,12 +2,7 @@ const ccxt = require ('ccxt')
const
exchange
=
new
ccxt
.
bybit
({
apiKey
:
"
jCTVo1KpLd14YuLRiN
"
,
secret
:
"
ZxJ3LruKNMCisPVCyckTpRwcZazyqg3JRNM9
"
,
enableRateLimit
:
true
,
})
let
redis
=
require
(
'
redis
'
)
...
...
@@ -35,8 +30,14 @@ async function test () {
// console.log(b)
// let d = await exchange.createMarketOrder('BTCUSDT', 'Buy', 0.001, 0)
// console.log(d)
let
d
=
await
exchange
.
fetchOrders
(
'
BTCUSDT
'
)
console
.
log
(
d
)
const
exchange
=
new
ccxt
.
bybit
({
apiKey
:
"
jCTVo1KpLd14YuLRiN
"
,
secret
:
"
ZxJ3LruKNMCisPVCyckTpRwcZazyqg3JRNM9
"
,
enableRateLimit
:
true
,
})
let
d
=
await
exchange
.
fetchBalance
()
console
.
log
(
d
.
info
.
result
.
USDT
.
equity
)
// console.log(d)
//63d101c8-3169-473c-a7ee-53645599474d
// let d=await exchange.fetchOrder('63d101c8-3169-473c-a7ee-53645599474d','BTCUSDT')
...
...
trade.js
View file @
4416f7e1
...
...
@@ -158,9 +158,9 @@ async function init() {
async
function
balanceUpdater
()
{
try
{
let
d
=
await
exchange
.
fetchFreeB
alance
()
if
(
d
.
USDT
!==
balance
)
{
balance
=
d
.
USDT
let
d
=
await
exchange
.
b
alance
()
if
(
d
.
info
.
result
.
USDT
.
equity
!==
balance
)
{
balance
=
d
.
info
.
result
.
USDT
.
equity
appendBalanceProfitLog
(
balance
)
}
...
...
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