Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Crypto
/
Crypto-auto-trading
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
2019102152 김다빈
2021-12-07 07:21:14 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e314689fed6593b3eb49f71d1dfb1fcec7970390
e314689f
1 parent
cc52d853
Modify Error where the coin name doesn't come out when user get a notification
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
index.js
index.js
View file @
e314689
...
...
@@ -129,14 +129,13 @@ async function get_marketName() {
}
async
function
transaction_coin
(
coin_name
,
side
,
volume
,
price
,
ord_type
,
first
=
true
)
{
var
volume
=
volume
;
var
avg_buy_price
=
0
,
market
=
""
;
var
avg_buy_price
=
0
;
if
(
side
==
"ask"
)
{
await
User
.
findOne
({
market
:
coin_name
}).
then
((
result
)
=>
{
if
(
volume
==
""
){
volume
=
String
(
result
.
volume
);
}
avg_buy_price
=
result
.
avg_buy_price
;
market
=
result
.
market
.
split
(
'-'
)[
1
];
}).
catch
(
err
=>
{
console
.
log
(
err
.
error
)
});
}
const
body
=
{
...
...
@@ -171,10 +170,9 @@ async function transaction_coin(coin_name, side, volume, price, ord_type, first
var
my_asset
=
await
asset
(
1000
);
if
(
avg_buy_price
!=
0
){
console
.
log
(
avg_buy_price
);
lookup_order
(
result
.
uuid
,
avg_buy_price
,
market
);
lookup_order
(
result
.
uuid
,
avg_buy_price
,
result
.
market
.
split
(
"-"
)[
1
]);
}
else
{
lookup_order
(
result
.
uuid
,
0
,
market
);
lookup_order
(
result
.
uuid
,
0
,
result
.
market
.
split
(
"-"
)[
1
]
);
}
if
(
side
==
"bid"
)
{
if
(
first
)
{
...
...
@@ -438,7 +436,6 @@ function trading_notice(side, price, funds, volume,yield_data=0,market) {
'Authorization'
:
`Bearer
${
TOKEN
}
`
},
json
:
{
"messages"
:
messages
}
},
(
error
,
response
,
body
)
=>
{
...
...
Please
register
or
login
to post a comment