Example #1
0
        public decimal GetTotalPercentage(CoinMarketTicker ticker, UserCoin coin)
        {
            if (ticker == null || ticker.Market != UserTickerMarket)
            {
                return(0);
            }

            return((ticker.Last * coin.Quantity) / user.UserSummary.TotalBalance * 100m);
        }
Example #2
0
        public decimal GetProfitPercentage(CoinMarketTicker ticker, UserCoin coin)
        {
            if (ticker == null || coin.BuyPrice == 0 ||
                ticker.Market != UserTickerMarket)
            {
                return(0);
            }

            return((ticker.Last - coin.BuyPrice) / coin.BuyPrice * 100m);
        }