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

Commit

Permalink
make sure to flush the batcher, fix #2329
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Aug 29, 2018
1 parent eb30a7b commit 60b6eb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/tools/dataStitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ Stitcher.prototype.seedLocalData = function(from, to, next) {
});

this.batcher.write(rows);
this.batcher.flush();
this.reader.close();
next();

Expand Down
5 changes: 3 additions & 2 deletions plugins/tradingAdvisor/tradingAdvisor.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,15 @@ Actor.prototype.processCandle = function(candle, done) {
this.next = done;
} else {
done();
this.next = _.noop;
this.next = false;
}
this.batcher.flush();
}

// propogate a custom sized candle to the trading strategy
Actor.prototype.emitStratCandle = function(candle) {
this.strategy.tick(candle, this.next);
const next = this.next || _.noop;
this.strategy.tick(candle, next);
}

Actor.prototype.processTradeCompleted = function(trade) {
Expand Down

0 comments on commit 60b6eb8

Please sign in to comment.