From f4ab1be8632c949fda6f631c726992918271c967 Mon Sep 17 00:00:00 2001 From: jtplatt99 Date: Tue, 7 Apr 2020 13:22:23 -0400 Subject: [PATCH] Add 'LeastMax' Parameter Add additional logic to compute 'LeastMax', which represents the worst case scenario maximum price achievable during the week (assuming everything is sold on the correct day). --- index.html | 1 + js/predictions.js | 1 + js/scripts.js | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 23bcb89..6a3d808 100644 --- a/index.html +++ b/index.html @@ -188,6 +188,7 @@ Friday Saturday Week Min + Least Max Week Max diff --git a/js/predictions.js b/js/predictions.js index 4db235a..8bb70c1 100644 --- a/js/predictions.js +++ b/js/predictions.js @@ -661,6 +661,7 @@ function analyze_possibilities(sell_prices, first_buy, previous_pattern) { weekMaxes.push(day.max); } poss.weekMin = Math.min(...weekMins); + poss.weekLeastMax = Math.max(...weekMins); poss.weekMax = Math.max(...weekMaxes); } diff --git a/js/scripts.js b/js/scripts.js index 7dd9bf6..025294c 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -139,7 +139,7 @@ const calculateOutput = function (data, first_buy, previous_pattern) { out_line += `${day.min}`; } } - out_line += `${poss.weekMin}${poss.weekMax}`; + out_line += `${poss.weekMin}${poss.weekLeastMax}${poss.weekMax}`; output_possibilities += out_line }