Commit c83945c9 by ken

depth

parent f4909e49
......@@ -167,7 +167,7 @@ function _handleDepthData(symbol, data, source) {
const bids = data.bids.slice(0, 5);
const currentJsonData = JSON.stringify({asks, bids});
if (data.timestamp > lastEventTime
|| (data.timestamp === lastEventTime /*&& currentJsonData !== lastDataMap[symbol] && (currentJsonData !== lastLastDataMap[symbol] || lastLastEventTime != data.timestamp)*/)) {
|| (data.timestamp === lastEventTime && currentJsonData !== lastDataMap[symbol] && (currentJsonData !== lastLastDataMap[symbol] || lastLastEventTime != data.timestamp))) {
if (symbol === "BTCUSDT") {
let consoleMethod = console.log;
if (data.timestamp === lastEventTime) {
......@@ -252,11 +252,11 @@ function getBalanceByRest() {
function run() {
subscribe();
const depthInterval = Math.max(60 * 1000 / (900 * ips.length / observerSymbol.length), 55);
const depthInterval = Math.max(60 * 1000 / (900 * ips.length / observerSymbol.length), 60);
console.log(depthInterval);
setInterval(() => {
for (const symbol of observerSymbol) {
// depthByRest(symbol);
depthByRest(symbol);
}
}, depthInterval);
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