From 0c71439e383fac7143d8a1fc823388f57438e792 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 8 Feb 2020 13:58:33 +0100 Subject: [PATCH] Accepting since before the begining of the market --- Historic-Trades/User.Bot.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Historic-Trades/User.Bot.js b/Historic-Trades/User.Bot.js index b89352ef4..652699b32 100644 --- a/Historic-Trades/User.Bot.js +++ b/Historic-Trades/User.Bot.js @@ -17,7 +17,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, fileSt let statusDependencies const ONE_MINUTE = 60000 - const MAX_TRADES_PER_EXECUTION = 100000 + const MAX_TRADES_PER_EXECUTION = 10000 const symbol = bot.market.baseAsset + '/' + bot.market.quotedAsset const ccxt = require('ccxt') @@ -367,6 +367,16 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, fileSt } function createMissingEmptyFiles(begin, end) { + /* + If this range is too wide, we will consider this means that the begin is before the begining of this market at this exchange. + In that case we will change the begin and the beginingOfMarket + */ + + if ((end - begin) / 60 / 24 > 7) { + begin = end + beginingOfMarket = new Date(end * ONE_MINUTE) + } + for (let j = begin + 1; j < end; j++) { let fileName = bot.market.baseAsset + '_' + bot.market.quotedAsset + '.json' filesToCreate++