public async void TestGetEMA()
        {
            IndicatorBLL indBll = new IndicatorBLL(this.s3_bucket_name, this.tempTickerFolder);

            var smaResult = await indBll.GetEMA("CCL", 20, 2, 20100101);

            Console.WriteLine(ObjectHelper.ToJson(smaResult));
        }
예제 #2
0
        public async Task <ActionResult> Get_EMA(string code, int period, double mfactor = 2, int?start = 0, int?end = 0, string type = "day")
        {
            IndicatorBLL bll = new IndicatorBLL(this.s3_bucket_name, this.local_temp_folder);

            IndSingleValueEntity[] resultList;

            if (type.ToLower() == "day")
            {
                resultList = await bll.GetEMA(code, period, mfactor, start, end, "day");
            }
            else if (type.ToLower() == "week")
            {
                resultList = await bll.GetEMA(code, period, mfactor, start, end, "week");
            }
            else
            {
                return(BadRequest($"Wrong type input: {type}"));
            }

            return(Ok(resultList));
        }