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

git pu

parent 3abc4a99
...@@ -367,12 +367,25 @@ async function adder(sig, qty, date, allData,pair) { ...@@ -367,12 +367,25 @@ async function adder(sig, qty, date, allData,pair) {
if (typeof d.id !== "undefined") { if (typeof d.id !== "undefined") {
await sleep(30000) await sleep(30000)
d = await exchange.fetchOrder(d.id, d.info.symbol) try {
console.log('Add Suc With id', d.id, sig) d = await exchange.fetchOrder(d.id, d.info.symbol)
const [add] = await client console.log('Add Suc With id', d.id, sig)
.multi() const [add] = await client
.set(sig, JSON.stringify({pair: d.info.symbol, side: d.side, qty: d.amount, price: d.average})) .multi()
.exec(); .set(sig, JSON.stringify({pair: d.info.symbol, side: d.side, qty: d.amount, price: d.average}))
.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