Skip to content

Commit

Permalink
Set default value for min_periods in trade command (DeviaVir#1738)
Browse files Browse the repository at this point in the history
Using paper mode, the `min_periods` option was used without being defined. It would lead to date calculation returning `NaN`, and thus provoking errors (at least on Binance exchange).

This commit fixes this.
  • Loading branch information
BAKFR authored and Kévin Bernard-Allies committed Oct 26, 2018
1 parent 0548e8a commit 9f22a2a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions commands/trade.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ module.exports = function (program, conf) {
console.log(('--buy_max_amt is deprecated, use --deposit instead!\n').red)
so.deposit = so.buy_max_amt
}
if (!so.min_periods) so.min_periods = 1

so.selector = objectifySelector(selector || conf.selector)
var engine = engineFactory(s, conf)
Expand Down

0 comments on commit 9f22a2a

Please sign in to comment.