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).
master
jtplatt99 4 years ago committed by Mike Bryant
parent ea190f6d38
commit f4ab1be863

@ -188,6 +188,7 @@
<th colspan="2">Friday</th>
<th colspan="2">Saturday</th>
<th rowspan="2">Week Min</th>
<th rowspan="2">Least Max</th>
<th rowspan="2">Week Max</th>
</tr>
<tr>

@ -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);
}

@ -139,7 +139,7 @@ const calculateOutput = function (data, first_buy, previous_pattern) {
out_line += `<td class="one">${day.min}</td>`;
}
}
out_line += `<td class="one">${poss.weekMin}</td><td class="one">${poss.weekMax}</td></tr>`;
out_line += `<td class="one">${poss.weekMin}</td><td class="one">${poss.weekLeastMax}</td><td class="one">${poss.weekMax}</td></tr>`;
output_possibilities += out_line
}

Loading…
Cancel
Save