Esempio n. 1
0
        public List <string> ComposeVolumePerCoinTweets(ElapsedTime timeInterval)
        {
            var total = _dxDataRepository.GetTotalVolumeAndTradesByCoinAndElapsedTime(timeInterval);

            var childrenTweets = new List <string>();

            foreach (var coin in total.Keys)
            {
                var totalCoin = total[coin];
                if (totalCoin.NumberOfTrades > 0)
                {
                    string  tweet       = "Trading Volume $" + coin + ":\n\n";
                    decimal volumeUSD   = totalCoin.Volumes["USD"];
                    decimal volumeBTC   = totalCoin.Volumes["BTC"];
                    decimal volumeBLOCK = totalCoin.Volumes["BLOCK"];

                    if (!volumeUSD.Equals(0))
                    {
                        tweet += "$USD: $" + totalCoin.Volumes["USD"].ToString("N2", CultureInfo.InvariantCulture) + "\n";
                    }

                    if (!volumeBTC.Equals(0))
                    {
                        tweet += "$BTC: " + totalCoin.Volumes["BTC"].ToString("N3", CultureInfo.InvariantCulture) + " BTC\n";
                    }

                    if (!volumeBLOCK.Equals(0))
                    {
                        tweet += "$BLOCK: " + totalCoin.Volumes["BLOCK"].ToString("N3", CultureInfo.InvariantCulture) + " BLOCK\n";
                    }

                    if (!units.Contains(coin))
                    {
                        tweet += "$" + coin + ": " + totalCoin.Volumes[coin].ToString("N3", CultureInfo.InvariantCulture) + " " + coin + "\n";
                    }

                    tweet += "\n\nNumber of Trades: " + totalCoin.NumberOfTrades;

                    childrenTweets.Add(tweet);
                }
            }
            return(childrenTweets);
        }
Esempio n. 2
0
 public IActionResult GetTotalVolumeAndTradesByCoin(ElapsedTime elapsedTime)
 {
     return(Ok(_dxDataRepository.GetTotalVolumeAndTradesByCoinAndElapsedTime(elapsedTime)));
 }