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
577703b4
Commit
577703b4
authored
May 22, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pu
parent
04388310
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
26 deletions
+28
-26
change.js
change.js
+16
-14
test_ccxt.js
test_ccxt.js
+3
-7
test_json.js
test_json.js
+9
-5
No files found.
change.js
View file @
577703b4
...
@@ -131,20 +131,22 @@ async function updateVars(name) {
...
@@ -131,20 +131,22 @@ async function updateVars(name) {
lastFile
=
lastFile
.
split
(
'
\n
'
)
lastFile
=
lastFile
.
split
(
'
\n
'
)
// console.log([lastFile[lastFile.length-2]])
// console.log([lastFile[lastFile.length-2]])
let
lastData
=
lastFile
[
lastFile
.
length
-
2
]
let
lastData
=
lastFile
[
lastFile
.
length
-
2
]
let
qty
=
0
let
lp
=
name
.
split
(
'
_
'
)[
3
].
replace
(
'
Lp
'
,
''
)
if
(
name
.
includes
(
'
Lp1
'
))
lp
=
parseInt
(
lp
)
/
100
qty
=
0.01
let
qty
=
lp
else
if
(
name
.
includes
(
'
Lp2
'
))
// if (name.includes('Lp1'))
qty
=
0.02
// qty=0.01
else
if
(
name
.
includes
(
'
Lp3
'
))
// else if (name.includes('Lp2'))
qty
=
0.03
// qty=0.02
else
if
(
name
.
includes
(
'
Lp4
'
))
// else if (name.includes('Lp3'))
qty
=
0.04
// qty=0.03
// else if (name.includes('Lp4'))
else
if
(
name
.
includes
(
'
Lp5
'
))
// qty=0.04
qty
=
0.05
else
if
(
name
.
includes
(
'
Lp6
'
))
// else if (name.includes('Lp5'))
qty
=
0.05
// qty=0.05
// else if (name.includes('Lp6'))
// qty=0.05
if
(
lastData
.
includes
(
'
Buy
'
))
{
if
(
lastData
.
includes
(
'
Buy
'
))
{
// bybit.reduceOrder('Buy',qty)
// bybit.reduceOrder('Buy',qty)
exchange
.
createMarketOrder
(
'
ETHUSDT
'
,
'
Buy
'
,
qty
,
0
)
exchange
.
createMarketOrder
(
'
ETHUSDT
'
,
'
Buy
'
,
qty
,
0
)
...
...
test_ccxt.js
View file @
577703b4
...
@@ -14,15 +14,11 @@ exchange.urls['api'] = exchange.urls['test'];
...
@@ -14,15 +14,11 @@ exchange.urls['api'] = exchange.urls['test'];
async
function
test
()
{
async
function
test
()
{
// const orders = await exchange.createMarketOrder('ETHUSDT','Sell',0.1,0,{reduceOnly:true})
const
orders
=
await
exchange
.
createMarketOrder
(
'
ETHUSDT
'
,
'
Buy
'
,
0.1
,
0
,{
position_idx
:
1
})
// console.log(orders)
//fc33a4ce-2f89-486c-9f77-f52ab452f53b
console
.
log
(
orders
)
while
(
true
)
{
const
balance
=
await
exchange
.
fetchBalance
()
console
.
log
(
balance
.
info
.
result
.
USDT
)
}
// log (asTable (orders.map (order => ccxt.omit (order, [ 'timestamp', 'info' ]))))
// log (asTable (orders.map (order => ccxt.omit (order, [ 'timestamp', 'info' ]))))
...
...
test_json.js
View file @
577703b4
...
@@ -5,8 +5,12 @@
...
@@ -5,8 +5,12 @@
// console.log(i,t[i])
// console.log(i,t[i])
let
t
=
'
last.json-220217122835_O1_BNC_ETHUSDT_Lp3191_1ETH1.csv
'
// let t='last.json-220217122835_O1_BNC_ETHUSDT_Lp3191_1ETH1.csv'
t
=
t
.
split
(
'
_
'
)
// t=t.split('_')
let
p
=
t
[
t
.
length
-
1
].
split
(
'
.
'
)
// let p=t[t.length-1].split('.')
p
=
parseFloat
(
p
[
0
])
// p=parseFloat(p[0])
console
.
log
(
p
)
// console.log(p)
let
t
=
'
220522181407_O1_ETHUSDT_Lp1_ETH.csv
'
let
lp
=
t
.
split
(
'
_
'
)[
3
].
replace
(
'
Lp
'
,
''
)
console
.
log
(
parseInt
(
lp
)
/
100
)
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