Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
added debugging for to fix #106
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Jan 11, 2014
1 parent 541d6b5 commit e897f38
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/candleManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,12 @@ Manager.prototype.processTrades = function(data) {
}

log.debug('processing', _.size(trades), 'trade(s)');
log.debug(
'from',
moment.unix(_.first(trades).date).utc().format(),
'to',
moment.unix(_.last(trades).date).utc().format()
);

var candles = this.calculateCandles(trades);

Expand Down Expand Up @@ -642,8 +648,10 @@ Manager.prototype.addEmtpyCandles = function(candles, start, end) {

var empty, prevClose;

if(min > max)
if(min > max) {
console.log('c', candles, 's', start, 'e', end);
throw 'Weird error 2';
}

while(min !== max) {
empty = _.clone(c);
Expand Down Expand Up @@ -793,7 +801,7 @@ Manager.prototype.setDay = function(m) {
}

// how many days are in this trade batch?
Manager.prototype.fetchHasNewDay = function(trades) {
Manager.prototype.fetchHasNewDay = function() {
return !equals(this.fetch.end.day, this.current.day);
}

Expand Down

0 comments on commit e897f38

Please sign in to comment.