IBMStockTrader/tradr

"Year to Date" isn't accurate. Remove or add as feature

greghint opened this issue · 2 comments

The "Year to Date" in portfolio details is not accurate. Need to remove or replace with accurate data.

image

This should work now, if you have Kafka (such as IBM Event Streams), Mongo, and the Trade History microservice installed. Trade History calculates the percent delta between what you paid for all of your stocks and what they are worth now. Portfolio now exposes a getPortfolioReturns method (GET /{owner}/returns) that provides this percentage as a string. I'll let @rtclauss comment on whether he's actually calling this method. It returns "Unknown" if the call to TradeHistory fails, or if TradeHistory can't get to its Mongo, where it stores the original prices paid for each stock.

Note we should probably change the label on this to just "Return on Investment", since what TradeHistory returns has no relation to the start of the current calendar year. It's effectively "Beginning-of-time to Date"... ;)