Commit 9e3c2d05 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent e2aabfe2
...@@ -293,7 +293,7 @@ async function adder(sig, qty, date) { ...@@ -293,7 +293,7 @@ async function adder(sig, qty, date) {
.exec(); .exec();
} }
} else { } else {
let d = exchange.createMarketOrder('ETHUSDT', 'Sell', qty, 0, {order_link_id: lastToken}) let d = await exchange.createMarketOrder('ETHUSDT', 'Sell', qty, 0, {order_link_id: lastToken})
// console.log('Add Suc With id',sig) // console.log('Add Suc With id',sig)
if (typeof d.id !=="undefined") { if (typeof d.id !=="undefined") {
console.log('Add Suc With id',d.id,sig) console.log('Add Suc With id',d.id,sig)
......
...@@ -10,16 +10,37 @@ const exchange = new ccxt.bybit ({ ...@@ -10,16 +10,37 @@ const exchange = new ccxt.bybit ({
}) })
exchange.urls['api'] = exchange.urls['test']; exchange.urls['api'] = exchange.urls['test'];
let redis = require('redis')
const client = redis.createClient(
{url: 'redis://default:p@db.zignaly.xyz:7001'}
);
async function test () {
const orders = await exchange.createMarketOrder('ETHUSDT','Buy',1,0) init()
console.log(orders.id) async function init() {
client.on('error', (err) => console.log('Redis Client Error', err));
await client.connect();
test()
}
async function test () {
let d = exchange.createMarketOrder('ETHUSDT', 'Sell', 0.01, 0, {order_link_id: 'id1_Sell_1012.05.24 21:34'})
// console.log('Add Suc With id',sig)
console.log(d)
if (typeof d.id !== "undefined") {
console.log('Add Suc With id', d.id, 'sell')
const [add] = await client
.multi()
.set('sell', JSON.stringify({qty: 0.1}))
.exec();
// log (asTable (orders.map (order => ccxt.omit (order, [ 'timestamp', 'info' ])))) // log (asTable (orders.map (order => ccxt.omit (order, [ 'timestamp', 'info' ]))))
...@@ -27,6 +48,6 @@ async function test () { ...@@ -27,6 +48,6 @@ async function test () {
// const order = await exchange.fetchOrder (orders[0]['id']) // const order = await exchange.fetchOrder (orders[0]['id'])
}
} }
test ()
\ No newline at end of file
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