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

Backtesting with talib causes incorrect candle dates  #715

Closed
@southerton81

Description

I have encountered a problem when backtesting, it manifests when I add talib indicator to mock strategy. Tested on 1m and 15m candles and it produces gaps in the log. 1 hour candles work ok.

var strat = {};

strat.init = function() {

  var settingsSMA = {
    optInTimePeriod: 20
  }

  this.addTalibIndicator('mysma', 'sma', settingsSMA);
}

strat.update = function(candle) {}

strat.log = function() {}
strat.check = function(candle) {
  console.log(candle.start.format());
}

module.exports = strat;

2017-04-27T20:54:00+03:00
2017-04-27T20:54:00+03:00
2017-04-27T20:54:00+03:00
2017-04-27T20:54:00+03:00
2017-04-27T20:54:00+03:00
2017-04-27T20:54:00+03:00
2017-04-27T20:54:00+03:00
2017-04-27T21:02:00+03:00
2017-04-27T21:02:00+03:00

Here's a related closed issue, however, the case seems to be different. #681

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions