Commit 8fef9667 by rongjun

init

parent 76214363
const BaseCollector = require('./baseCollector'); const BaseCollector = require('./baseCollector');
const baseCurrencies = ["BIX","ETH","BTC","USDT"]; const baseCurrencies = ["ETH","BTC","USDT", "NEO", "KCS"];
const restCurrencies = ["USDT","BTC","ETH", "NEO", "KCS"]; const restCurrencies = ["USDT","BTC","ETH", "NEO", "KCS", ];
// const machine = process.env['MACHINE']; // const machine = process.env['MACHINE'];
const machine = 'K' const machine = 'K'
const biboxApi = require('./api_kucoin'); const biboxApi = require('./api_kucoin');
...@@ -30,7 +30,9 @@ class BiboxCollector extends BaseCollector{ ...@@ -30,7 +30,9 @@ class BiboxCollector extends BaseCollector{
const symbolDetails = data.data; const symbolDetails = data.data;
const symbolMap = {}; const symbolMap = {};
for(let detail of symbolDetails){ for(let detail of symbolDetails){
symbolMap[detail.symbol] = detail; if(detail.change >= 0){
symbolMap[detail.symbol] = detail;
}
} }
callback(null,symbolMap); callback(null,symbolMap);
} }
...@@ -59,13 +61,13 @@ class BiboxCollector extends BaseCollector{ ...@@ -59,13 +61,13 @@ class BiboxCollector extends BaseCollector{
// }) // })
} }
_fetchDepthByRest(symbols,depth,callback){ _fetchDepthByRest(symbols,depth,callback){
const restSymbols = []; const restSymbols = symbols;
for(let symbol of symbols){ // for(let symbol of symbols){
const midCurrency = symbol.split("-")[0]; // const midCurrency = symbol.split("-")[0];
if(restCurrencies.includes(midCurrency)){ // if(restCurrencies.includes(midCurrency)){
restSymbols.push(symbol); // restSymbols.push(symbol);
} // }
} // }
const perInterval = 500; const perInterval = 500;
const totalInterval = perInterval * restSymbols.length+50; const totalInterval = perInterval * restSymbols.length+50;
setInterval(()=>{ setInterval(()=>{
......
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