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

Commit

Permalink
Move startTimeMinusCandleSize inside realtime if check
Browse files Browse the repository at this point in the history
  • Loading branch information
ansonphong authored and askmike committed Jan 30, 2018
1 parent 8dcff91 commit d2b1129
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/tradingAdvisor/baseTradingMethod.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ Base.prototype.propogateTick = function(candle) {
// whether candle start time is > startTime
var isPremature;

// Subtract number of minutes in current candle for instant start
let startTimeMinusCandleSize = startTime.clone();
startTimeMinusCandleSize.subtract(this.tradingAdvisor.candleSize, "minutes");

if(mode === 'realtime'){
// Subtract number of minutes in current candle for instant start
let startTimeMinusCandleSize = startTime.clone();
startTimeMinusCandleSize.subtract(this.tradingAdvisor.candleSize, "minutes");

isPremature = candle.start < startTimeMinusCandleSize;
}
else{
Expand Down

0 comments on commit d2b1129

Please sign in to comment.