Exemplo n.º 1
0
        public async Task <object> kline(string userName, string name, DateTime date)
        {
            try
            {
                var begin = date.AddMinutes(-60 * 24);
                var end   = date.AddMinutes(10);

                var buyList   = await new PigMoreStatisticsDao().ListBuy(userName, name, begin, end);
                var sellList  = await new PigMoreStatisticsDao().ListSell(userName, name, begin, end);
                var klineList = new KlineDao().ListKline(name, begin, end);
                return(new
                {
                    buyList = buyList.Select(it => new { it.BDate, it.BTradeP }),
                    sellList = sellList.Select(it => new { it.SDate, it.STradeP }),
                    klineList = klineList.Select(it => new { it.Close, it.Id, it.High })
                });
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message, ex);
                return(null);
            }
        }
Exemplo n.º 2
0
        public async Task <object> symbolKline(string userName, string symbolName, string quoteCurrency, int day)
        {
            try
            {
                var begin = DateTime.Now.AddDays(-60 * 24 * day);
                var end   = DateTime.Now;

                var buyList   = await new DogMoreStatisticsDao().ListBuy(userName, symbolName, quoteCurrency, begin, end);
                var sellList  = await new DogMoreStatisticsDao().ListSell(userName, symbolName, quoteCurrency, begin, end);
                var klineList = new KlineDao().ListTodayKline(symbolName, quoteCurrency, begin, end);
                return(new
                {
                    buyList = buyList.Select(it => new { it.BuyDate, it.BuyTradePrice }),
                    sellList = sellList.Select(it => new { it.SellDate, it.SellTradePrice }),
                    klineList = klineList.Select(it => new { it.Close, it.Id, it.High })
                });
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message, ex);
                throw ex;
            }
        }