Commit 00623ba2 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent 3abc4a99
...@@ -367,6 +367,7 @@ async function adder(sig, qty, date, allData,pair) { ...@@ -367,6 +367,7 @@ async function adder(sig, qty, date, allData,pair) {
if (typeof d.id !== "undefined") { if (typeof d.id !== "undefined") {
await sleep(30000) await sleep(30000)
try {
d = await exchange.fetchOrder(d.id, d.info.symbol) d = await exchange.fetchOrder(d.id, d.info.symbol)
console.log('Add Suc With id', d.id, sig) console.log('Add Suc With id', d.id, sig)
const [add] = await client const [add] = await client
...@@ -374,6 +375,18 @@ async function adder(sig, qty, date, allData,pair) { ...@@ -374,6 +375,18 @@ async function adder(sig, qty, date, allData,pair) {
.set(sig, JSON.stringify({pair: d.info.symbol, side: d.side, qty: d.amount, price: d.average})) .set(sig, JSON.stringify({pair: d.info.symbol, side: d.side, qty: d.amount, price: d.average}))
.exec(); .exec();
} }
catch (e)
{
console.log('Add Suc With id', d.id, sig)
console.log(sig,'Have Problem Reding Order so try offline')
const [add] = await client
.multi()
.set(sig, JSON.stringify({pair: d.info.symbol, side: d.side, qty: d.amount, price: d.price}))
.exec();
}
}
} }
......
...@@ -32,12 +32,14 @@ async function init() { ...@@ -32,12 +32,14 @@ async function init() {
async function test () { async function test () {
let d = await exchange.createMarketOrder('BNBUSDT', 'Sell', 1, 0) // let d = await exchange.createMarketOrder('BNBUSDT', 'Sell', 1, 0)
console.log(d) // console.log(d)
// console.log(d) // console.log(d)
//63d101c8-3169-473c-a7ee-53645599474d //63d101c8-3169-473c-a7ee-53645599474d
// let d=await exchange.fetchOrder('63d101c8-3169-473c-a7ee-53645599474d','BTCUSDT') // let d=await exchange.fetchOrder('63d101c8-3169-473c-a7ee-53645599474d','BTCUSDT')
// console.log(d) // console.log(d)
let b=await exchange.fetchBalance()
console.log(b)
// for (let i=0;i<d.length;i++) // for (let i=0;i<d.length;i++)
......
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