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
8ddbdefe
Commit
8ddbdefe
authored
Jun 16, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pull
parent
99a2ab7b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
13 deletions
+21
-13
change2.js
change2.js
+9
-6
info.json
info.json
+1
-0
test_json.js
test_json.js
+11
-7
No files found.
change2.js
View file @
8ddbdefe
...
...
@@ -17,12 +17,7 @@ let balance = 0
const
ccxt
=
require
(
'
ccxt
'
)
const
exchange
=
new
ccxt
.
bybit
({
apiKey
:
"
JIYbRCdXjr7Hi0GyUB
"
,
secret
:
"
vMTlNjgUNZJNQ7LzgNWr4549cNrehrkFpGzC
"
,
enableRateLimit
:
true
,
})
let
exchange
exchange
.
urls
[
'
api
'
]
=
exchange
.
urls
[
'
test
'
];
...
...
@@ -35,6 +30,14 @@ async function init() {
client
.
on
(
'
error
'
,
(
err
)
=>
console
.
log
(
'
Redis Client Error
'
,
err
));
await
client
.
connect
();
let
info
=
await
fs
.
readFileSync
(
'
info.json
'
,
'
utf8
'
);
info
=
JSON
.
parse
(
info
)
exchange
=
new
ccxt
.
bybit
({
apiKey
:
"
JIYbRCdXjr7Hi0GyUB
"
,
secret
:
"
vMTlNjgUNZJNQ7LzgNWr4549cNrehrkFpGzC
"
,
enableRateLimit
:
true
,
})
run
()
}
...
...
info.json
0 → 100644
View file @
8ddbdefe
{
"apiKey"
:
""
,
"secret"
:
""
}
\ No newline at end of file
test_json.js
View file @
8ddbdefe
...
...
@@ -30,13 +30,17 @@ let _ = require('lodash')
// sum = sum / arr.length
// console.log(arr, sum)
let
t
=
'
last.json-220519074704_O1_BNC_BTCUSDT_Lp3654_3BTC7425192022.csv
'
t
=
t
.
split
(
'
_
'
)
let
pair
=
t
[
3
].
replace
(
'
usdt
'
,
''
).
replace
(
'
usd
'
,
''
)
let
lp
=
t
[
4
].
replace
(
'
lp
'
,
'
Lp
'
)
let
p
=
t
[
t
.
length
-
1
].
split
(
'
.
'
)
p
=
p
[
0
].
split
(
pair
)[
0
]
console
.
log
(
p
)
// let t='last.json-220519074704_O1_BNC_BTCUSDT_Lp3654_3BTC7425192022.csv'
// t = t.split('_')
// let pair = t[3].replace('usdt', '').replace('usd', '')
// let lp = t[4].replace('lp','Lp')
// let p=t[t.length-1].split('.')
// p=p[0].split(pair)[0]
// console.log(p)
let
t
=
{
apiKey
:
''
,
secret
:
''
}
console
.
log
(
JSON
.
stringify
(
t
))
//
...
...
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