From 1fde4cbafbd0e9ef1b6fd2bfb8acbfac732054a2 Mon Sep 17 00:00:00 2001 From: Glenn Sidney Date: Wed, 27 Dec 2017 15:02:42 -0500 Subject: [PATCH] For #924 - Resolve bad output detected on neural strategy (#1003) --- extensions/strategies/neural/strategy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/strategies/neural/strategy.js b/extensions/strategies/neural/strategy.js index 88072d2ef5..f3ad05561b 100644 --- a/extensions/strategies/neural/strategy.js +++ b/extensions/strategies/neural/strategy.js @@ -57,8 +57,9 @@ module.exports = function container (get, set, clear) { var tlp = [] var tll = [] if (s.lookback[s.options.min_periods]) { + var min_predict = s.options.min_predict > s.options.min_periods ? s.options.min_periods : s.options.min_predict; for (let i = 0; i < s.options.min_periods; i++) { tll.push(s.lookback[i].close) } - for (let i = 0; i < s.options.min_predict; i++) { tlp.push(s.lookback[i].close) } + for (let i = 0; i < min_predict; i++) { tlp.push(s.lookback[i].close) } var my_data = tll.reverse() var learn = function () { //Learns