private void ShowGainPercent(string[] args) { var spent = _coinspotService.GetAllDeposits().GetTotalDeposited(); var value = _coinspotService.GetPortfolioValue(); var gain = value - spent; var gainPercent = ((value / spent) - 1.0f) * 100.0f; if (_lastDollar == 0) { _lastGainPercent = gainPercent; } Colored(() => Line($"Gain %{gainPercent:0.##}"), ConsoleColor.Yellow); var diff = (gainPercent - _lastGainPercent); Colored(() => Line($"Diff %{diff:0.###}"), diff < 0 ? ConsoleColor.Red : ConsoleColor.Green); _lastGainPercent = gainPercent; }
public float GetTotalSpent() => _coinspotService.GetAllDeposits().GetTotalDeposited();