Commit e2aabfe2 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent cec3934a
......@@ -260,13 +260,14 @@ async function closer(sig) {
if (delStatus !== 1) {
console.log('Cant Find ' + sig + ' in db So dont try reduce')
return
}
let qty = JSON.parse(data)
qty = qty.qty
console.log('try reduce',sig,qty)
if (sig.includes('Buy')) {
exchange.createMarketOrder('ETHUSDT', 'Sell', qty, 0, {reduceOnly: true})
} else {
......@@ -285,7 +286,7 @@ async function adder(sig, qty, date) {
let d = await exchange.createMarketOrder('ETHUSDT', 'Buy', qty, 0, {order_link_id: lastToken})
// console.log('Add Suc With id',sig)
if (typeof d.id !=="undefined") {
console.log('Add Suc With id',d.id,sig)
console.log('Suc Exchange id',d.id,sig)
const [add] = await client
.multi()
.set(sig, JSON.stringify({qty: qty}))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment