Commit ec193f8f authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent 8ddbdefe
......@@ -18,6 +18,7 @@ const ccxt = require('ccxt')
let exchange
let info
exchange.urls['api'] = exchange.urls['test'];
......@@ -30,11 +31,11 @@ async function init() {
client.on('error', (err) => console.log('Redis Client Error', err));
await client.connect();
let info = await fs.readFileSync('info.json', 'utf8');
info = await fs.readFileSync('info.json', 'utf8');
info=JSON.parse(info)
exchange= new ccxt.bybit({
apiKey: "JIYbRCdXjr7Hi0GyUB",
secret: "vMTlNjgUNZJNQ7LzgNWr4549cNrehrkFpGzC",
apiKey: info.apiKey,
secret: info.secret,
enableRateLimit: true,
})
......@@ -283,8 +284,8 @@ async function closer(sig, date, bigData, id, pair) {
lastToken = lastToken.replace(/_/g, '').replace(/Lp/g, '').replace(/BTC/g, '').replace(/ /g, '')
const [data, delStatus] = await client
.multi()
.get(sig)
.del(sig)
.get(info.apiKey+sig)
.del(info.apiKey+sig)
.exec();
......@@ -371,7 +372,7 @@ async function adder(sig, qty, date, allData,pair) {
console.log('Add Suc With id', d.id, sig)
const [add] = await client
.multi()
.set(sig, JSON.stringify({pair: d.info.symbol, side: d.side, qty: d.amount, price: d.price}))
.set(info.apiKey+sig, JSON.stringify({pair: d.info.symbol, side: d.side, qty: d.amount, price: d.price}))
.exec();
}
......
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