IBMStockTrader / tradr

Vue.js and Node.js frontend for StockTrader 🚀
Apache License 2.0
1 stars 18 forks source link

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

Open greghint opened 5 years ago

greghint commented 5 years ago

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

image

jwalcorn commented 4 years ago

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.

jwalcorn commented 4 years ago

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"... ;)