return;
}
try {
//get last existing update and its date
SharesUpdate lastUpdate = (SharesUpdate) getSharesUpdateViaRest(composeKey(stockName, "last"));
//get all updates between last existing update and requested date in history
List<String> stockHistoryKeys = getStockHistoryKeySet(stockName, lastUpdate.getDate(), toSeconds(maxHistoryArg), toSeconds(stepArg));
float previous = 0.0f, current = 0.0f;
console.printf("------------- History of %s -------------\n", stockName);
for (String key : stockHistoryKeys) {
SharesUpdate sharesUpdate = (SharesUpdate) getSharesUpdateViaRest(key);
if (sharesUpdate != null) {
current = sharesUpdate.getValue();
console.printf("Date: %s, value: %f USD (%s %+f%%)\n",
sharesUpdate.getDate().toString(),
current,
current > previous ? "increase" : "decrease",
computeIncreaseInPercent(previous, current));
}
previous = current;