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

Commit

Permalink
pretty sure I fixed #106
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Jan 12, 2014
1 parent e897f38 commit 1545d30
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/candleManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,14 @@ Manager.prototype.processTrades = function(data) {
} else {

// we already know they are all from current day
var batch = this.addEmtpyCandles(candles, this.mostRecentCandle);

// but if the most recent candle is from yesterday ...
if(this.mostRecentCandle.s === MINUTES_IN_DAY) {
var ghostCandle = _.clone(this.mostRecentCandle);
ghostCandle.s = -1;
var batch = this.addEmtpyCandles(candles, ghostCandle);
} else
var batch = this.addEmtpyCandles(candles, this.mostRecentCandle);

this.leftovers = batch.pop();

Expand Down

0 comments on commit 1545d30

Please sign in to comment.