Commit ec193f8f authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

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