From b653b3993ce6188f40129fd19a684ef8e815c720 Mon Sep 17 00:00:00 2001 From: Pi-Hsun Shih Date: Wed, 15 Apr 2020 23:30:01 +0800 Subject: [PATCH] Fix peak_start not defined Fix #110. --- js/predictions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/predictions.js b/js/predictions.js index 27b5e93..f1410a6 100644 --- a/js/predictions.js +++ b/js/predictions.js @@ -173,7 +173,7 @@ function generate_peak_price( min_pred = get_price(rate_min, buy_price) - 1; max_pred = get_price(rate_max, buy_price) - 1; if (!isNaN(given_prices[start])) { - if (given_prices[start] < min_pred - FUDGE_FACTOR || given_prices[peak_start + 2] > max_pred + FUDGE_FACTOR) { + if (given_prices[start] < min_pred - FUDGE_FACTOR || given_prices[start] > max_pred + FUDGE_FACTOR) { // Given price is out of predicted range, so this is the wrong pattern return false; }